feat(decisioning): AuthInfo.from_verified_signer — bridge to RFC 9421 verifier#365
Merged
Merged
Conversation
… verifier Closes the migration loop the AuthInfo flat-field deprecation (shipped in #363) points adopters at. The deprecation message says "use the bundled signed-request verifier middleware" — but the SDK didn't ship a helper that converts the verifier's ``VerifiedSigner`` output into typed ``AuthInfo`` / ``HttpSigCredential``. Adopters had to construct it themselves. * Add ``AuthInfo.from_verified_signer(signer, ...)`` classmethod — the supported v3 migration target. Takes the ``VerifiedSigner`` produced by ``adcp.signing.verify_request_signature``, projects ``key_id`` / ``verified_at`` / ``agent_url`` into a typed ``HttpSigCredential``, and returns ``AuthInfo`` ready for the registry dispatch. * Raises ``ValueError`` when ``signer.agent_url is None`` — the verifier wasn't configured to extract the AdCP v3 agent_url claim, and the registry has no key to dispatch on. Server-boot error rather than silent dispatch fallthrough. * Three new tests: typed projection roundtrip, missing-agent_url rejection, end-to-end VerifiedSigner → AuthInfo → registry resolves. No deprecation warning fires on the supported path. Adopter Flask middleware migrates from:: AuthInfo(kind="signed_request", key_id=signer.key_id, ...) to:: AuthInfo.from_verified_signer(signer, scopes=...) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Closes the migration loop the AuthInfo flat-field deprecation (#363) pointed adopters at. The deprecation said "use the bundled signed-request verifier middleware" — but the SDK didn't ship a helper that converts the verifier's `VerifiedSigner` output into typed `AuthInfo` / `HttpSigCredential`. Adopters had to construct it themselves.
Adopter migration:
```python
Before (fires DeprecationWarning, removal target 4.5.0):
AuthInfo(kind="signed_request", key_id=signer.key_id, principal=signer.agent_url)
After:
AuthInfo.from_verified_signer(signer, scopes=...)
```
Test plan
🤖 Generated with Claude Code