Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

3.5.3: authentication_handlers entries outside the new whitelist are silently dropped (breaks `{couch_httpd_auth, jwt_authentication_handler}`)

オープン
#6,166 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
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
  1. Run CouchDB 3.5.3 with the config above and a valid [jwt_keys] / [jwt_auth] setup.
  2. curl -H "Authorization: Bearer <valid token>" http://localhost:5984/_session
  3. The response is a 401 (or "authenticated" is not "jwt"). The same request works on 3.5.2.
  4. GET /_node/_local/_config/chttpd/authentication_handlers still 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_fun behaviour 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
平均マージ
10時間 25分
マージ済み PR(30日)
35

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/couchdb のほかの issue

apache/couchdb の issue をすべて見る

似ている issue

Security の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。