authn: name claim declarations by yaml key in Config.Validate errors
メンテナーはふだん 1 日以内に返信
@sthanikan2000 がすでに取り組んでいます。
2026年10月23日 から。
評価
この issue はまだ評価されていません。
説明
Current Limitation
authn.Config.Validate names a bad claim declaration by its Go field path, while the rest of the same function names the yaml key. For example, with userClaims.optional: [scope] it returns:
UserClaims.Optional declares claim(s) [scope] that authn already binds (fixed schema: client_id, grant_type, scope, roles, and the JWT registered claims)
but a missing audience returns audience is required, and Config carries yaml tags (userClaims, clientClaims) so a host can embed it in its own config file. A deployer who wrote userClaims.optional is shown UserClaims.Optional, a different spelling from the key they edited, and one that differs from every other message Validate returns.
The names come from the what strings in Config.Validate (config.go): "UserClaims.Optional", "UserClaims.Required", "ClientClaims.Optional" and "ClientClaims.Required".
Suggested Improvement
Use the yaml keys in those four strings: userClaims.optional, userClaims.required, clientClaims.optional and clientClaims.required, so claim errors read like the other Validate errors. The labels on the option path (WithUserClaims optional, ...) already name that API and stay as they are.
This only changes error text. A host that maps Config onto its own, differently named keys would still need to translate the message itself.
Version
github.com/OpenNSW/core/authn v0.4.0
Additional Context
Low priority; nothing is blocked. It came up in OpenNSW/nsw-srilanka#709, which lets a deployment list extra token claims in its own config and passes them to core/authn, so the core message reaches deployers unchanged.
- 主要言語
- Go
- スター
- 6
- フォーク
- 8
- 平均マージ
- 21時間 36分
- マージ済み PR(30日)
- 42
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
OpenNSW/core のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
payment: test fixtures hardcode real gateway names (govpay/lankapay) instead of generic placeholdersオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
nsw-sl cleanup Type/Improvement
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
-
remote: let the host inject a logger, and log with one consistent policy対応中かも @mushrafmim が 5 日前に担当しました。 オープンType/Improvement
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
☢️ Bug v3
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
area/import-export area/projects concern/ux
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
go-vikunja/vikunja#4455 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Dependabot PRs no longer merge automatically対応中かも @dwisiswant0 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
projectdiscovery/urlfinder#160 ·
メンテナーはふだん 1 日以内に返信
-
database
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
chnm/legal-modernism#450 ·
メンテナーはふだん 1 日以内に返信
-
tech-debt
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信