authn: name claim declarations by yaml key in Config.Validate errors
I maintainer di solito rispondono entro 1 giorno
@sthanikan2000 ci sta già lavorando.
Dal 23/10/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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.
- Lingua principale
- Go
- Stelle
- 6
- Fork
- 8
- Merge medio
- 21h 36m
- PR unite (30g)
- 42
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di OpenNSW/core
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
payment: test fixtures hardcode real gateway names (govpay/lankapay) instead of generic placeholdersAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
nsw-sl cleanup Type/Improvement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
I maintainer di solito rispondono entro 1 giorno
-
remote: let the host inject a logger, and log with one consistent policyForse già presa @mushrafmim l’ha presa 5 giorni fa. ApertaType/Improvement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di OpenNSW/core
Issue simili
-
☢️ Bug v3
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
area/import-export area/projects concern/ux
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
go-vikunja/vikunja#4455 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Dependabot PRs no longer merge automaticallyForse già presa @dwisiswant0 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
projectdiscovery/urlfinder#160 ·
I maintainer di solito rispondono entro 1 giorno
-
database
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
chnm/legal-modernism#450 ·
I maintainer di solito rispondono entro 1 giorno
-
tech-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno