feat!: require explicit AuthorizationResponseIssPolicy - #358
Merged
Merged
Conversation
client.Config.RequireAuthorizationResponseIss was an optional bool defaulting to false — the weaker RFC 9207 posture (tolerate a callback missing "iss"). NewFromDiscovery correctly raises it to true when discovery confirms the issuer supports the parameter, but a caller building Config by hand (never calling NewFromDiscovery) gets the silent-weak default with no signal they should have looked at this field at all: there's no way to tell "explicitly chose to tolerate a missing iss" from "never thought about it". Replace the bool with a closed AuthorizationResponseIssPolicy enum, zero value deliberately invalid — the same shape as PARDPoPBinding, except PARDPoPBinding's zero value is a real, safe default (RFC 9449 itself recommends it) while this field has no universally-safe default: "require" breaks every AS that doesn't send iss, "tolerate" is the weaker posture. New now rejects an unset value the same way it already rejects an invalid Profile or PARDPoPBinding. NewFromDiscovery's own "only ever raises the bar, never lowers what the caller set" semantics are unchanged. BREAKING CHANGE: client.Config.RequireAuthorizationResponseIss (bool) is renamed to AuthorizationResponseIssPolicy (AuthorizationResponseIssPolicy) and is now required. Existing callers must set it explicitly: RequireAuthorizationResponseIss (matches former true) or TolerateAbsentAuthorizationResponseIss (matches former false/zero value). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Merged
8 tasks
|
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
From a cross-project security rubric review (constructor-time validation, boolean security toggles, extension-point interfaces, fail-open/fail-closed, algorithm agility, type-system enforcement, TLS defaults): FAPIgo's one gap under "boolean security toggles" was
client.Config.RequireAuthorizationResponseIss, an optional bool defaulting tofalse— the weaker RFC 9207 posture.NewFromDiscoverycorrectly raises it totruewhen discovery confirms support, but a caller buildingConfigby hand gets the silent-weak default with no signal to look at this field at all — there's no way to distinguish "explicitly chose to tolerate a missing iss" from "never thought about it".Replaces the bool with a closed
AuthorizationResponseIssPolicyenum, zero value deliberately invalid — same shape asPARDPoPBinding, exceptPARDPoPBinding's zero value is a real, safe default (RFC 9449 itself recommends it) while this field has no universally-safe default:RequireAuthorizationResponseIssbreaks every AS that doesn't sendiss,TolerateAbsentAuthorizationResponseIssis the weaker posture.Newnow rejects an unset value the same way it already rejects an invalidProfileorPARDPoPBinding.NewFromDiscovery's own "only ever raises the bar, never lowers what the caller set" semantics are unchanged.BREAKING CHANGE
client.Config.RequireAuthorizationResponseIss(bool) is renamed toAuthorizationResponseIssPolicy(AuthorizationResponseIssPolicy) and is now required. Existing callers must set it explicitly:RequireAuthorizationResponseIss(matches formertrue) orTolerateAbsentAuthorizationResponseIss(matches formerfalse/zero value).Test plan
gofmt -l .cleango build ./...go vet ./...go test -race ./...— all packages passgolangci-lint run ./...— 0 issuesTestNewRejectsInvalidConfigwith both an out-of-range and a zero-value case for the new enum🤖 Generated with Claude Code
https://claude.ai/code/session_01JCpqoxEg7XUkkGg312zXyS