`masterKey` function is not called on server start
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- node.js, typescript
- 领域
- backend
调研方向
从 src/ParseServer.ts 中的 ParseServer.start() 开始,跟踪启动任务如何访问 Config.put() 返回的选项。使用会拒绝的 masterKey 函数重现该问题,然后验证启动过程会调用它,并在处理请求之前拒绝。
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- JavaScript
- 星标
- 21.4k
- 派生
- 4.8k
- 平均合并
- 5 小时 28 分钟
- 30 天内合并 PR
- 91
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
parse-community/parse-server 的其他 Issue
-
Query with an include path through an inherited object member fails with an internal server error可能已有人在做 @charan-rathore 于 2 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
parse-community/parse-server#10795 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
parse-community/parse-server#10794 · 1 条评论 ·
维护者通常 1 天内回复
-
Add MongoDB 9 support可能已有人在做 @ga262 于 16 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
parse-community/parse-server#10750 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
parse-community/parse-server#10720 · 1 条评论 ·
维护者通常 1 天内回复
-
Node.js version in `.nvmrc` does not satisfy `engines.node`可能已有人在做 @kokokoXUY 于 25 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 92/100
parse-community/parse-server#10699 · 1 条评论 ·
维护者通常 1 天内回复
查看 parse-community/parse-server 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 80/100
MagicMirrorOrg/MagicMirror#4310 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
bluerobotics/Cockpit-docs#48 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
tc39/proposal-temporal#3332 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
opennextjs/opennextjs-cloudflare#1461 ·
维护者通常 1 天内回复