3.5.3: authentication_handlers entries outside the new whitelist are silently dropped (breaks `{couch_httpd_auth, jwt_authentication_handler}`)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- erlang
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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)
- 主要语言
- Erlang
- 星标
- 7k
- 派生
- 1.1k
- 平均合并
- 14 小时 47 分钟
- 30 天内合并 PR
- 38
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/couchdb 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 35/100
维护者通常 1 天内回复
-
Fix: Warning: 'catch ...' is deprecated; please use 'try ... catch ... end' instead可能重新可做 @devx-arjun 于 15 天前认领,目前没有进行中的 PR。 未关闭beginner-friendly build chore patches-welcome
难度 4/5 3-5 天 新手友好度 45/100
维护者通常 1 天内回复
-
bug needs-triage
难度 4/5 3-5 天 新手友好度 48/100
维护者通常 1 天内回复
-
enhancement needs-triage
难度 3/5 1-2 天 新手友好度 55/100
维护者通常 1 天内回复
-
bug needs-triage
难度 4/5 3-5 天 新手友好度 48/100
维护者通常 1 天内回复
相似的 Issue
-
Mend: dependency security vulnerability
难度 2/5 1-3 小时 新手友好度 72/100
kube-tarian/sigrun#202 ·
-
docs: four SECURITY.md statements no longer match the code (allowed hosts, body cap, OIDC, ACLs)未关闭
难度 2/5 1-3 小时 新手友好度 78/100
akitaonrails/ai-memory#1561 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
StellarCanary/ProtocolCanary-Action#515 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
mvanhorn/cli-printing-press#5142 ·
维护者通常 1 天内回复
-
github_actions priority: medium
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复