3.5.3: authentication_handlers entries outside the new whitelist are silently dropped (breaks `{couch_httpd_auth, jwt_authentication_handler}`)
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ó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- erlang
- Lĩnh vực
- authentication, backend
Hướng nghiên cứu
Start in chttpd:set_auth_handlers/0 and the authentication_handler_map/1 clauses, where unknown {Module, Function} entries fall through to false, and compare with chttpd_auth:jwt_authentication_handler/1 and couch_httpd_auth:jwt_authentication_handler/1 from 3.5.2. Pull request #6152 introduced the whitelist. Done means either the configured {couch_httpd_auth, jwt_authentication_handler} tuple authenticates Bearer tokens again, or each ignored entry logs a warning at startup. Agree with the maintainers on which of these to do first.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
After upgrading from 3.5.2 to 3.5.3, JWT authentication stopped working and all Bearer-token requests returned 401. Basic auth kept working.
Our [chttpd] config:
[chttpd]
authentication_handlers = {couch_httpd_auth, jwt_authentication_handler}, {chttpd_auth, default_authentication_handler}
require_valid_user = true
#6152 changed chttpd:set_auth_handlers/0 to map entries through a fixed whitelist. Only the short names and the {chttpd_auth, ...} tuples are accepted. Any other entry falls through to authentication_handler_map(_) -> false and is dropped without a log message.
In 3.5.2, chttpd_auth:jwt_authentication_handler/1 just delegates to couch_httpd_auth:jwt_authentication_handler/1, and both were exported. The configured tuple was valid and worked. The PR states that "for compatibility we still accept existing tuple forms", but this functionally equivalent tuple is no longer accepted, in a patch release.
Steps to Reproduce
- Run CouchDB 3.5.3 with the config above and a valid
[jwt_keys]/[jwt_auth]setup. curl -H "Authorization: Bearer <valid token>" http://localhost:5984/_session- The response is a 401 (or
"authenticated"is not"jwt"). The same request works on 3.5.2. GET /_node/_local/_config/chttpd/authentication_handlersstill shows the configured value, and nothing in the log shows that the JWT handler was dropped.
Expected Behaviour
- Either keep accepting previously working tuples (for example by falling back to the old
make_arity_1_funbehaviour for unknown{Module, Function}entries), - or at least log a warning or error at startup for each ignored entry, so a misconfiguration is visible instead of silently disabling an authentication method.
Workaround
Change the entry to {chttpd_auth, jwt_authentication_handler} or jwt.
Environment
- CouchDB version used: 3.5.3 (official Docker image, tag
couchdb:3.5) - Operating system and version: Linux (Docker)
- Ngôn ngữ chính
- Erlang
- Star
- 7k
- Fork
- 1.1k
- Merge trung bình
- 10 giờ 25 phút
- Pull request đã merge (30 ngày)
- 35
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
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 apache/couchdb
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Fix: Warning: 'catch ...' is deprecated; please use 'try ... catch ... end' insteadCó thể làm lại được @devx-arjun đã nhận 12 ngày trước và không có pull request nào đang mở. Đang mởbeginner-friendly build chore patches-welcome
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
apache/couchdb#6144 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug needs-triage
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
apache/couchdb#6132 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[ENHANCEMENT]: Add seq checkpoints to continuous feedsCó thể đã có người làm @nickva đã nhận 4 ngày trước. Đang mởenhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
apache/couchdb#6120 · 7 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement needs-triage
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của apache/couchdb
Issue tương tự
-
good first issue security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
TencentCloud/Octop#2187 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
OpenPrinting/cups#1772 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
oauth2-proxy skips authentication for /public/*, so a namespace named "public" is unauthenticatedĐang mởbug rust security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày