feat(oauth): add secure buyer authorization helpers - #1079
Merged
Conversation
| sibling_task = asyncio.create_task(sibling()) | ||
| with pytest.raises(OAuthDiscoveryError) as caught: | ||
| await discover_oauth_metadata("https://auth.example/tenant", timeout=0.05) | ||
| await sibling_task |
| await asyncio.sleep(0) | ||
| task.cancel() | ||
| with pytest.raises(asyncio.CancelledError): | ||
| await task |
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — purely additive OAuth 2.0 helper with no blocking or medium findings.
What I checked:
- New
src/adcp/oauth.py(888 net new lines): fail-closed buyer-side OAuth authorization-code + S256 PKCE helper. Reviewer confirms security-critical paths (state compare, consume-before-I/O replay safety, DNS-pinned SSRF-guarded transports, deadline-covers-DNS timeouts, secret-safe error surfaces) are correct and adversarially tested. - Public surface change wired in with a matching
public_api_snapshot.jsonupdate, type-check fixture, and README section — no public-API break, no type-layering violation. - Correct
feat(oauth):conventional-commit prefix; purely additive (2009 additions, 0 deletions), so no semver-break signal required. - CI gates remain armed.
high_riskis true only becausesrc/adcp/__init__.pywas modified — but the reviewer found no medium-or-higher concerns on that file, so the modification is presumed safe (row 5 does not fire). No deletions.gated_pathsis false, so row 2 does not apply despitereview_decision: REVIEW_REQUIRED.- No no-auto-approve team match.
Findings: Only two low findings (correct replay-ordering note; id_token opaqueness observation), both omitted from blocking consideration.
No rows 1–8 fired → row 9 approve.
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 the buyer OAuth helper item in #1031.
What changed
This deliberately accepts an authorization-server issuer URL, not an MCP resource URL; resource-to-issuer discovery remains an RFC 9728 concern. It does not expose experimental AdCP 3.2 schema types.
Validation
make lint typecheck-alluv run pytest -q— 7,235 passed, 77 skipped, 9 deselected, 1 xfailed