authn: name claim declarations by yaml key in Config.Validate errors
Maintainers usually reply within 1 day
@sthanikan2000 is already working on this.
Since Oct 23, 2026.
Assessment
This issue has not been assessed yet.
Description
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.
- Dominant language
- Go
- Stars
- 6
- Forks
- 8
- Avg merge
- 21h 36m
- Merged PRs (30d)
- 42
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenNSW/core
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
payment: test fixtures hardcode real gateway names (govpay/lankapay) instead of generic placeholdersOpen
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
nsw-sl cleanup Type/Improvement
Difficulty 3/5 1-2 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
-
remote: let the host inject a logger, and log with one consistent policyPossibly taken @mushrafmim claimed this 5 days ago. OpenType/Improvement
Difficulty 4/5 3-5 days Newbie friendliness 22/100
Maintainers usually reply within 1 day
Similar issues
-
☢️ Bug v3
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
area/import-export area/projects concern/ux
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
go-vikunja/vikunja#4455 · 1 comment ·
Maintainers usually reply within 2 days
-
Dependabot PRs no longer merge automaticallyPossibly taken @dwisiswant0 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
projectdiscovery/urlfinder#160 ·
Maintainers usually reply within 1 day
-
database
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
chnm/legal-modernism#450 ·
Maintainers usually reply within 1 day
-
tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day