Skip to content

fix(federation): bound an omitted array parameter by one_of - #984

Merged
osanderson merged 4 commits into
mainfrom
fix/federation-one-of-omitted
Nov 25, 2026
Merged

osanderson merged 4 commits into
mainfrom
fix/federation-one-of-omitted

Conversation

@osanderson

Copy link
Copy Markdown
Collaborator

Closes a gap in federation automatic registration: an RP could avoid a one_of policy on an array parameter by leaving the parameter out. It also documents and pins how value: null behaves on authorization_details_types.

fix(federation): one_of bounds an omitted array parameter

one_of acts only on a parameter that is present (OpenID Federation 1.0 §6.1.3.1.4), and automatic registration reads an omitted authorization_details_types as every type the operator allows. Under a Trust Anchor policy {"one_of": ["account_information"]}:

  • an RP that published the parameter was refused;
  • an RP that left it out was registered for every configured type, payment included.

intfed.PermittedArrayStrings already limited an omitted parameter by subset_of and value. It now also limits it by the values the merged one_of options list:

  • a string option lists itself;
  • an array option lists its string elements;
  • anything else lists nothing.

These are intersected with the other operators, and across the chain the way one_of already merges.

Other parameters:

  • grant_types goes through the same function. An RP that leaves it out already got only the authorization code flow, so nothing changes in practice. New matrix cases pin this.
  • scope already handled one_of. PermittedSpaceDelimitedStrings now splits its operands and calls PermittedArrayStrings, with the same results.

UPGRADING.md has a section under v0.86.0. Federations whose Trust Anchor or Intermediates put one_of on authorization_details_types may see RPs registered with fewer types.

test(federation) and docs:: value: null on authorization_details_types

The behaviour is unchanged. value: null removes the parameter, so the RP is treated as having omitted it and gets every operator type that no other operator withholds. That can be wider than what the RP published.

  • Tests: a new test pins this at the Trust Anchor and at an Intermediate, and with a Trust Anchor subset_of that narrows it.
  • Docs: the AuthorizationDetailsTypes doc comment and docs/guides/openid-federation.md now say this, and recommend subset_of or one_of for restricting types.
  • Policy validation: an Intermediate's value: null under a Trust Anchor's one_of is refused when the policies are merged, and a test pins that too.

Tests

  • PermittedArrayStrings: cases for string and array options, an empty list, non-string options, and combinations with value, value: null and subset_of.
  • Absence matrix: one_of cases at the Trust Anchor, at an Intermediate, at both, and combined with an Intermediate's default, for both array parameters. The three authorization_details_types cases fail without the fix.
  • Mutants: four new ones, plus one existing scope mutant moved onto the shared code. All five are killed.
  • Suites: the race suite and every example module pass, and lint is clean. Both federation fuzz targets pass 60-second runs.

Nothing on the wire changes. This only affects which capabilities an OP stores for an automatically registered client, and the conformance plans set no metadata_policy.

🤖 Generated with Claude Code

osanderson and others added 4 commits November 25, 2026 22:16
one_of acts only on a parameter that is present (OpenID Federation 1.0
6.1.3.1.4), and automatic registration reads an omitted
authorization_details_types as every type the operator allows. The
policy bound it applies to an omitted parameter
(intfed.PermittedArrayStrings) read subset_of and value but not one_of,
so under a Trust Anchor's {"one_of":["account_information"]} an RP
publishing the parameter was refused while one leaving it out was
registered for every configured type, payment included.

PermittedArrayStrings now also bounds the parameter by the values the
merged one_of's options list between them (a string option lists
itself, an array option its string elements), intersected with
subset_of and value as those already were. grant_types is read the same
way; an RP leaving it out already got nothing beyond the authorization
code flow. PermittedSpaceDelimitedStrings, which already handled one_of
for scope, now delegates to it after splitting the operands, with the
same results.

The absence matrix gains one_of cases at the Trust Anchor, at an
Intermediate, intersected across both, and combined with an
Intermediate's default, for authorization_details_types and
grant_types.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A superior's {"value":null} on authorization_details_types removes the
parameter an RP publishes, which then reads as left out, so the RP is
registered for every type the operator allows, more than it listed.
That is the documented rule for an omitted parameter and is kept; the
tests pin it at the Trust Anchor and at an Intermediate, and with a
Trust Anchor's subset_of still bounding the result. They also pin that
an Intermediate's value null under a Trust Anchor's one_of is refused,
since a merged value must be among the one_of values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A superior's value null removes authorization_details_types rather than
restricting it, and a removed parameter reads as left out, which
registers every type the operator allows. Say so where the
omitted-parameter rule is documented, and point a Trust Anchor wanting
to restrict the types at subset_of or one_of.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move the scope one_of mutant to where the bound now lives
(PermittedArrayStrings) and have it run the authorization_details_types
absence matrix too, and add mutants for the string and array one_of
options, the intersection of subset_of, value and one_of, and a one_of
alone bounding the parameter.

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

codecov Bot commented Nov 25, 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 02ca401 into main Nov 25, 2026
34 checks passed
@osanderson
osanderson deleted the fix/federation-one-of-omitted branch November 25, 2026 15:06
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