Repository navigation
docs(examples): add the federated-union OpenID Federation demo - #418
Merged
Merged
Conversation
examples/federated-union runs three fictional countries' identity federations joined into one OpenID Federation 1.0 trust anchor, the Meridian Union, in one process with each entity at its own *.localhost host. A service in one country signs in a citizen of another with no prior registration on either side: services find identity providers by resolving their Trust Chains, and identity providers register services automatically. The Union's metadata policy and naming constraints apply on top of each country's own, identity providers carry level-of-assurance Trust Marks from accreditation offices the Union lists in trust_mark_issuers, and citizens choose which requested claims to share. A console shows every member, decodes its statements, resolves any Trust Chain, logs federation traffic and runs three scenes: a forged assurance mark, a suspended country, and a compromised national authority contained by naming constraints. It's a separate Go module built against this checkout, uses only the public API, and has end-to-end tests for every scene. CI gains an examples job for it; release-please and Sonar's coverage metric exclude it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Share the demo's repeated literals as constants and a countryHost helper, split the console's chain view out of its resolve handler, and suppress text:S8566 for examples' go.mod files, which have no third-party dependencies for a go.sum to pin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
A runnable showcase in the style of OID4VCgo's
passport-vdc. Three fictional countries (Northland, Southport, Eastmark) each run their own identity federation, then join the Meridian Union, an OpenID Federation 1.0 trust anchor above them. A service in one country signs in a citizen of another, with no registration on either side beforehand.Everything runs in one process: 15 entities, each at its own
*.localhosthost, on one TLS listener. Browsers resolve*.localhostto loopback natively, so there's no hosts-file setup.What it shows
Cross-border sign-in with no onboarding: the bank resolves EastID's Trust Chain (EastID → Eastmark authority → Union); EastID registers the bank automatically (§12.1).
Layered policy: the Union's metadata policy narrows each service's grant types, and Southport adds its own requirement. The console compares declared and resolved metadata.
Recognized assurance: identity providers carry level-of-assurance Trust Marks from accreditation offices listed in the Union's
trust_mark_issuers. Services verify them withRequireFederationAccreditation.Data minimization: the bank requests claims (
BeginAuthorizationRequest.Claims), and the citizen unticks what they won't share (ApprovedIdentityClaims).Console scenes:
A live log of federation traffic sits alongside.
How
claimsparameter).replace, likepassport-vdc.ParseSessionHandle(fix(client)!: bind authorization callbacks to the user agent that began the flow #397).Repo wiring
examples: vet,go test -race, and golangci-lint on the demo module.release-please-config.json:exclude-paths: ["examples"].sonar-project.properties:examples/**excluded from the coverage metric only; all other rules still apply.Testing
union/e2e_test.goboots the whole federation on a free port and drives each scenario through the actual pages, with a cookie-jar browser client:go test -raceandgolangci-lintare clean on the demo module.Developer-experience notes found while building it (follow-ups, not in this PR)
invalid_client: unknown client, and the embedder gets no reason either. The cause here, a missingtoken_endpoint_auth_signing_alg, took reading the source to find. A registration-failure hook would help.federation.OpenIDRelyingPartyMetadatadoesn't mention thatprivate_key_jwtneedsTokenEndpointAuthSigningAlgfor a FAPIgo identity provider.🤖 Generated with Claude Code