`masterKey` function is not called on server start
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, typescript
- Lĩnh vực
- backend
Hướng nghiên cứu
Bắt đầu trong src/ParseServer.ts tại ParseServer.start() và theo dõi cách các tác vụ khởi động truy cập các tùy chọn được Config.put() trả về. Tái hiện vấn đề với một hàm masterKey từ chối, sau đó xác minh rằng quá trình khởi động gọi nó và từ chối trước khi phục vụ các yêu cầu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- JavaScript
- Star
- 21.4k
- Fork
- 4.8k
- Merge trung bình
- 1 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 49
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của parse-community/parse-server
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
parse-community/parse-server#10720 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
parse-community/parse-server#10699 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
RedisCacheAdapter put, del and clear reject on a Redis outage, producing unhandled rejectionsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
parse-community/parse-server#10634 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
parse-community/parse-server#10631 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
/installations and /audiences reject a find sent as POST + _method=GET with "Invalid key name: 0"Đang mở
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 65/100
parse-community/parse-server#10626 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của parse-community/parse-server
Issue tương tự
-
新讀者走讀回報,照著一篇文章實際操作Đang mởdocumentation good first issue help wanted
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 92/100
Maintainer thường phản hồi trong vòng 1 ngày
-
automated issue report
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
lirantal/discoprint#29 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
RSS feed autodiscoveryĐang mởfeature-request
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
louislam/uptime-kuma#7914 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Code Cleanup dependencies
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
ProjectSidewalk/SidewalkWebpage#5609 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
help wanted javascript
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
OWASP/cornucopia#3538 ·
Maintainer thường phản hồi trong vòng 1 ngày