feat(verifier): protect dynamic client registration with static/JWT auth - #282
feat(verifier): protect dynamic client registration with static/JWT auth#282leifj wants to merge 3 commits into
Conversation
leifj
commented
Mar 6, 2026
- Add verifier OIDC dynamic_registration_auth config
- Support modes: open, static(file bearer token), jwt(JWKS validation)
- Wire auth middleware to POST /register endpoint
- Keep introspection as reserved/not implemented
- Add middleware tests for auth modes and bearer handling
- Add config examples in config.yaml and README
- Regenerate docs/CONFIGURATION.md
73fd207 to
c4d4871
Compare
|
There was a problem hiding this comment.
Pull request overview
This PR adds authorization middleware for the verifier's OAuth 2.0 Dynamic Client Registration endpoint (POST /register), supporting three modes: open (default, no auth), static bearer token (loaded from a file), and JWT validation (against a configured JWKS/issuer/audience). An introspection mode is declared as reserved but not yet implemented.
Changes:
- New
DynamicRegistrationAuthConfigandDynamicRegistrationJWTAuthConfigconfig structs in the model, with validation tags and defaults - New
registration_auth.gomiddleware supporting open/static/jwt auth modes, wired into thePOST /registerroute in the httpserver - Comprehensive tests for all auth modes, bearer token extraction, and validator construction
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
pkg/model/config.go |
Adds DynamicRegistrationAuthConfig and DynamicRegistrationJWTAuthConfig structs to OIDCConfig |
internal/verifier/middleware/registration_auth.go |
New middleware implementing open, static, and JWT auth validators for registration endpoint |
internal/verifier/middleware/registration_auth_test.go |
Tests for all auth modes, bearer extraction, and validator construction |
internal/verifier/httpserver/service.go |
Wires the new registerAuth middleware into the POST /register route |
config.yaml |
Adds commented configuration examples for dynamic registration auth |
README.md |
Adds documentation section explaining the new authorization modes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add verifier OIDC dynamic_registration_auth config - Support modes: open, static(file bearer token), jwt(JWKS validation) - Wire auth middleware to POST /register endpoint - Keep introspection as reserved/not implemented - Add middleware tests for auth modes and bearer handling - Add config examples in config.yaml and README - Regenerate docs/CONFIGURATION.md
- Reduce cognitive complexity in NewRegistrationAuthMiddleware - Deduplicate repeated string literals - Rename tests to satisfy Sonar naming rule
59ee210 to
8f96a53
Compare
# Conflicts: # internal/verifier/httpserver/service.go
|


