Skip to content

feat: add external client resolution and RFC 8414 metadata - #131

Open
greg6775 wants to merge 2 commits into
luikyv:mainfrom
dev-null-GmbH:codex/client-resolver-rfc8414
Open

greg6775 wants to merge 2 commits into
luikyv:mainfrom
dev-null-GmbH:codex/client-resolver-rfc8414

Conversation

@greg6775

@greg6775 greg6775 commented Aug 2, 2026 •

Copy link
Copy Markdown

Summary

Applications can load current client metadata from their own store without exposing dynamic registration, using provider.WithClientFunc and goidc.ClientFunc. Static clients take precedence; DCR and OpenID Federation remain mutually exclusive with the callback.

The callback contract requires a non-nil client with the requested ID on success and goidc.ErrNotFound only for unknown clients. Return a fresh snapshot per lookup; fetched JWKS are cached on that snapshot. Implementations reusing client pointers own synchronization and cache invalidation. JWKS fetching and authorization-endpoint error handling retain their existing upstream behavior.

Publish RFC 8414 metadata at /.well-known/oauth-authorization-server{issuer-path} and correct path-based OIDC discovery to {issuer-path}/.well-known/openid-configuration. The previous nonstandard OIDC discovery route is removed for issuers with paths.

Verification

Locally verified on 2026-10-08 with Go 1.27.2:

  • go test ./...
  • go test -race ./internal/client ./internal/discovery ./internal/authorize ./pkg/provider
  • go vet ./...
  • golangci-lint run --new-from-rev=upstream/main (0 issues)
  • git diff --check

Tests cover static precedence, fresh client lookups and disablement, lookup error propagation, per-snapshot JWKS caching and key rotation, metadata routes, and disabled dynamic registration.

Full golangci-lint 2.14.0 reports three unchanged baseline findings: two deliberately mixed-case DPoP header tests and the federation example's deprecated Transport.Dial. Upstream Actions and the conformance suite still need a maintainer-approved run; the original runs expired awaiting approval.

References: RFC 8414 and OpenID Connect Discovery 1.0.

Integration check on 2026-10-08: the current heads of #131–#134 merge without conflicts, and go test ./... passes on their combined tree (c46e03f8823665c0387d317dc9990d1f54095272).

@luikyv luikyv left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Hey, thanks for taking the time to contribute to this repo. I really appreciate it, this is a nice feature to have in the module

I've requested a few changes. Let me know if anything isn't clear. Feel free to reach out via email or linkedin if you'd like to discuss anything in more detail

Comment thread internal/authorize/authorize.go Resolved
Comment thread pkg/goidc/model.go Resolved
Comment thread internal/client/util.go Resolved
Comment thread internal/client/util.go Resolved
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