Skip to content

feat(decisioning): AuthInfo.from_verified_signer — bridge to RFC 9421 verifier#365

Merged
bokelley merged 1 commit into
mainfrom
bokelley/v3-tier2-verifier-authinfo-bridge
May 2, 2026
Merged

feat(decisioning): AuthInfo.from_verified_signer — bridge to RFC 9421 verifier#365
bokelley merged 1 commit into
mainfrom
bokelley/v3-tier2-verifier-authinfo-bridge

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

@bokelley bokelley commented May 2, 2026

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.

  • New `AuthInfo.from_verified_signer(signer, scopes=..., operator=..., extra=...)` classmethod.
  • Raises `ValueError` when `signer.agent_url is None` — server-boot error pointing at the verifier misconfig rather than silent registry fallthrough.
  • 3 new tests covering happy path, missing-agent_url rejection, and end-to-end dispatch.

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

  • `pytest tests/`: 3059 passed (was 3054; +5)
  • All bridge tests pass without firing the synthesis DeprecationWarning
  • ruff/mypy/black clean

🤖 Generated with Claude Code

… 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>
@bokelley bokelley merged commit 5ae109b into main May 2, 2026
12 checks passed
@bokelley bokelley deleted the bokelley/v3-tier2-verifier-authinfo-bridge branch May 2, 2026 19:54
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