Skip to content

feat(verifier): protect dynamic client registration with static/JWT auth - #282

Open
leifj wants to merge 3 commits into
SUNET:mainfrom
sirosfoundation:feature/verifier-dcr-auth-modes
Open

feat(verifier): protect dynamic client registration with static/JWT auth#282
leifj wants to merge 3 commits into
SUNET:mainfrom
sirosfoundation:feature/verifier-dcr-auth-modes

Conversation

@leifj

@leifj leifj commented Mar 6, 2026

Copy link
Copy Markdown
Contributor
  • 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

@leifj
leifj force-pushed the feature/verifier-dcr-auth-modes branch 2 times, most recently from 73fd207 to c4d4871 Compare March 6, 2026 10:11
@sonarqubecloud

sonarqubecloud Bot commented Mar 6, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 DynamicRegistrationAuthConfig and DynamicRegistrationJWTAuthConfig config structs in the model, with validation tags and defaults
  • New registration_auth.go middleware supporting open/static/jwt auth modes, wired into the POST /register route 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.

Comment thread internal/verifier/httpserver/service.go
Comment thread pkg/model/config.go
Comment thread pkg/model/config.go
Leif Johansson added 2 commits July 9, 2026 18:08
- 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
@leifj
leifj force-pushed the feature/verifier-dcr-auth-modes branch from 59ee210 to 8f96a53 Compare July 9, 2026 16:16
# Conflicts:
#	internal/verifier/httpserver/service.go
@leifj

leifj commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto latest main after #514 merged. One conflict in internal/verifier/httpserver/service.go — both sides added independent fields (registerAuth here, openidFederationService from #514), kept both. Regenerated docs/CONFIGURATION.md. Build, vet, and make test all green.

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants