`masterKey` function is not called on server start
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- node.js, typescript
- Ambito
- backend
Direzione di ricerca
Inizia in src/ParseServer.ts, in ParseServer.start(), e traccia il modo in cui le attività di avvio accedono alle opzioni restituite da Config.put(). Riproduci il problema con una funzione masterKey che rifiuta, quindi verifica che l’avvio la invochi e rifiuti prima di servire le richieste.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
New Issue Checklist
- Report security issues confidentially.
- Any contribution is under this license.
- Before posting search existing issues.
Issue Description
If the Parse Server option masterKey is set to a function, the function is supposed to be called when Parse Server starts; ParseServer.start() in src/ParseServer.ts adds this.config.loadMasterKey?.() to the startup tasks. However, this.config is the plain options object returned by Config.put(), not a Config instance. It has no loadMasterKey method, so the optional call does nothing. This has been the case since setting masterKey to a function was added in #9582 (Parse Server 8.0.0).
As a result, the function is only called on the first request. If it fails, for example because a secret store is unavailable, Parse Server starts nonetheless and responds to every request with status 500, including the /health endpoint. Other startup tasks, such as the migration of the schema option or the connection of the cache adapter, make the start fail instead.
Steps to reproduce
- Start Parse Server with
masterKey: () => Promise.reject(new Error('secret store unavailable')), and awaitParseServer.start(). - Send any request, for example
GET /parse/health.
Actual Outcome
ParseServer.start() resolves; the masterKey function has not been called. The request fails with status 500 and {"code":1,"message":"Internal server error."}, and so does every following request.
Expected Outcome
The masterKey function is called when Parse Server starts, and ParseServer.start() rejects if the function fails.
Environment
Server
- Parse Server version:
9.10.2-alpha.4(alphabranch); since8.0.0 - Operating system: any
- Local or remote host: any
Database
- System: any
- Database version: any
- Local or remote host: any
Client
- SDK: any
- SDK version: any
Logs
Not applicable
- Lingua principale
- JavaScript
- Stelle
- 21.4k
- Fork
- 4.8k
- Merge medio
- 7h 19m
- PR unite (30g)
- 66
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di parse-community/parse-server
-
Add MongoDB 9 supportForse già presa @ga262 l’ha presa 5 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
parse-community/parse-server#10750 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
parse-community/parse-server#10720 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Node.js version in `.nvmrc` does not satisfy `engines.node`Forse già presa @kokokoXUY l’ha presa 14 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
parse-community/parse-server#10699 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
RedisCacheAdapter put, del and clear reject on a Redis outage, producing unhandled rejectionsForse già presa @AdrianCurtin l’ha presa 58 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
parse-community/parse-server#10634 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Documentation for directAccess states the default is false, but it has defaulted to true since Parse Server 6Forse già presa @AdrianCurtin l’ha presa 58 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
parse-community/parse-server#10631 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di parse-community/parse-server
Issue simili
-
documentation good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
bug release:v5.56
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Jason-Vaughan/TangleClaw#2270 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
style-dictionary/style-dictionary#1773 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
SignalK/signalk-server#3143 ·
I maintainer di solito rispondono entro 1 giorno