Skip to content

feat(federation)!: honour or refuse an automatically registered RP's subject_type - #647

Merged
osanderson merged 1 commit into
mainfrom
feat/ppid-federation
Oct 12, 2026
Merged

osanderson merged 1 commit into
mainfrom
feat/ppid-federation

Conversation

@osanderson

Copy link
Copy Markdown
Collaborator

An automatically registered Relying Party's subject_type metadata (OpenID Connect Dynamic Client Registration 1.0 §2) was ignored, so one asking for pairwise subjects silently got public ones. This is the federation part of pairwise subject support.

Behaviour

  • The client records the subject_type its resolved metadata names (after superiors' metadata_policy), or the server's default when it names none.
  • A subject_type the server doesn't issue (e.g. pairwise from a public-only server, or public under SubjectTypesPairwiseOnly), or an unknown value, fails the registration: the RP gets invalid_client, and OnResolutionFailure hears why.
  • A pairwise RP's sector is the single https host its redirect URIs share (as for any client); redirect URIs on several hosts fail its registration.
  • sector_identifier_uri isn't fetched in this release: a pairwise RP publishing one is refused rather than given a sector other than the one it named (so supporting it later won't change anyone's sub); a public RP's is ignored.

API

  • federation.AutomaticRegistrationConfig.SubjectTypes and .DefaultSubjectType. server.New sets both from Config.Subjects through the same helper that builds subject_types_supported, so discovery and registration agree. Zero means public only.
  • federation.OpenIDRelyingPartyMetadata.SubjectType, for an RP publishing its own metadata.

Breaking: an RP asking for a subject type the server doesn't issue is now refused instead of registered with public subjects. UPGRADING.md has a v0.55.0 section.

Tests: metadata variants, a superior's policy forcing pairwise, conflicts with the server's types, sector rules, a stable result across registrations, config validation, and the wiring through server.New (registration, ClientSubject and discovery). All 12 mutants of the new logic were caught.

🤖 Generated with Claude Code

…subject_type

An automatically registered Relying Party's subject_type (OpenID
Connect Dynamic Client Registration 1.0 section 2) used to be ignored,
so one asking for pairwise subjects got public ones. Automatic
registration now records the subject_type the Relying Party's resolved
metadata names (after its superiors' metadata policy), or the server's
default when it names none, and refuses one the server doesn't issue:
the Relying Party gets invalid_client and OnResolutionFailure hears
why.

A pairwise Relying Party's sector is the single https host its
redirect URIs share, derived as for any other client, so redirect URIs
on several hosts fail its registration. sector_identifier_uri isn't
fetched in this release, so a pairwise Relying Party publishing one is
refused rather than given a sector other than the one it named; a
public one's is ignored.

federation.AutomaticRegistrationConfig gains SubjectTypes and
DefaultSubjectType, which server.New sets from Config.Subjects through
the same helper discovery's subject_types_supported uses, so what is
advertised is what registration accepts. Left zero, they mean public
only. federation.OpenIDRelyingPartyMetadata gains SubjectType for an
RP publishing its own metadata.

BREAKING CHANGE: an automatically registered Relying Party whose metadata asks for a subject_type the server doesn't issue (pairwise, while the server issues only public subjects) is no longer registered, rather than given public subjects. A pairwise one must have redirect URIs on one https host and no sector_identifier_uri. See UPGRADING.md for v0.55.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@sonarqubecloud

Copy link
Copy Markdown

@osanderson
osanderson merged commit 911571d into main Oct 12, 2026
19 checks passed
@osanderson
osanderson deleted the feat/ppid-federation branch October 12, 2026 17:17
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