Skip to content

feat(conformance-as): add OpenID Federation self-issuance support - #261

Open
osanderson wants to merge 2 commits into
mainfrom
conformance-as-federation-well-known
Open

feat(conformance-as): add OpenID Federation self-issuance support#261
osanderson wants to merge 2 commits into
mainfrom
conformance-as-federation-well-known

Conversation

@osanderson

Copy link
Copy Markdown
Collaborator

Summary

  • Adds an optional "federation" config block wiring server.Config.Federation and server.Config.AutomaticRegistration into cmd/conformance-as, and serves the resulting self-issued Entity Configuration at /.well-known/openid-federation — carrying the same discovery document already served at /.well-known/openid-configuration as its own openid_provider Entity Type metadata, plus client_registration_types_supported: ["automatic"] (OpenID Federation 1.0 §12.1's own MUST for an OP supporting Automatic Registration).
  • Omitting the "federation" key from the config file disables all of this entirely — every existing config file and test call site is unaffected.
  • First step toward a real OpenID Federation conformance run against this binary (confirmed the local suite checkout at ~/githome/fapi/conformance-suite has Federation test plans). The actual live suite run — docker-compose service, trust anchor setup, automatic registration exercised end to end — follows in a later change.

Test plan

  • go build ./...
  • go test -race ./...
  • golangci-lint run ./... — 0 issues
  • New smoke test: starts the real production wiring (newServerMux) with Config.Federation set, fetches /.well-known/openid-federation over real TLS, verifies the returned statement self-verifies against its own claimed key, and carries the expected openid_provider metadata.

🤖 Generated with Claude Code

https://claude.ai/code/session_017N2kkxv9BR4Qmj8De3Ucs6

Adds an optional "federation" config block wiring server.Config.Federation
and server.Config.AutomaticRegistration into cmd/conformance-as, and
serves the resulting self-issued Entity Configuration at
/.well-known/openid-federation — carrying the same discovery document
already served at /.well-known/openid-configuration as its own
"openid_provider" Entity Type metadata, plus
client_registration_types_supported: ["automatic"] (OpenID Federation
1.0 §12.1's own MUST for an OP supporting Automatic Registration).

Omitting the "federation" key from the config file disables all of this
entirely, matching the module's own established "zero/nil disables the
feature" convention — every existing config file and test call site is
unaffected.

First step toward a real OpenID Federation conformance run against this
binary; verified with a new smoke test that starts the real production
wiring, fetches the well-known endpoint over real TLS, and verifies the
returned statement self-verifies and carries the expected metadata. The
actual live suite run (docker-compose service, trust anchor setup,
automatic registration exercised end to end) follows in a later change.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017N2kkxv9BR4Qmj8De3Ucs6
@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.66667% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/conformance-as/federation.go 66.66% 4 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

Config.Resolve had no direct test coverage at all before this PR (every
existing config_test.go case calls the unexported per-client
resolveClient helper instead) — this PR's own federation validation
additions inherited that gap wholesale, failing both codecov/patch and
SonarCloud's new_coverage gate.

Adds direct Resolve tests: a valid config with no federation block, a
valid one with federation, every federation validation failure this PR
added, and (as a side effect of finally exercising Resolve directly)
the handful of pre-existing top-level validation branches that had
never been covered either.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017N2kkxv9BR4Qmj8De3Ucs6
@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.

1 participant