Repository navigation
fix(federation): bound an omitted array parameter by one_of - #984
Merged
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
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.



Closes a gap in federation automatic registration: an RP could avoid a
one_ofpolicy on an array parameter by leaving the parameter out. It also documents and pins howvalue: nullbehaves onauthorization_details_types.fix(federation):one_ofbounds an omitted array parameterone_ofacts only on a parameter that is present (OpenID Federation 1.0 §6.1.3.1.4), and automatic registration reads an omittedauthorization_details_typesas every type the operator allows. Under a Trust Anchor policy{"one_of": ["account_information"]}:paymentincluded.intfed.PermittedArrayStringsalready limited an omitted parameter bysubset_ofandvalue. It now also limits it by the values the mergedone_ofoptions list:These are intersected with the other operators, and across the chain the way
one_ofalready merges.Other parameters:
grant_typesgoes 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.scopealready handledone_of.PermittedSpaceDelimitedStringsnow splits its operands and callsPermittedArrayStrings, with the same results.UPGRADING.md has a section under v0.86.0. Federations whose Trust Anchor or Intermediates put
one_ofonauthorization_details_typesmay see RPs registered with fewer types.test(federation)anddocs::value: nullonauthorization_details_typesThe behaviour is unchanged.
value: nullremoves 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.subset_ofthat narrows it.AuthorizationDetailsTypesdoc comment anddocs/guides/openid-federation.mdnow say this, and recommendsubset_oforone_offor restricting types.value: nullunder a Trust Anchor'sone_ofis 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 withvalue,value: nullandsubset_of.one_ofcases at the Trust Anchor, at an Intermediate, at both, and combined with an Intermediate'sdefault, for both array parameters. The threeauthorization_details_typescases fail without the fix.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