Skip to content

feat(decisioning): BuyerAgentRegistry Protocol + AuthInfo discrimination + billing_capability enforcement (Tier 2) #349

@bokelley

Description

@bokelley

Summary

Tier 2 of the v3-identity / round-2 SDK roadmap. Implements the round-2 spine: a BuyerAgentRegistry Protocol that resolves an authenticated agent identity to a registered BuyerAgent record, kind-discriminated Credential union, and billing_capability enforcement on sync_accounts.

Implements the Python side of adcp-client#1269 (JS BuyerAgentRegistry design).

Design

Full design lives in the RFC — see docs/proposals/v3-identity-bundle-design.md, section "Tier 2 — BuyerAgentRegistry (the round-2 spine, per #1269)".

Surface

  • BuyerAgent frozen dataclass: agent_url, display_name, status, billing_capability, default_account_terms, allowed_brands, ext
  • BuyerAgentRegistry Protocol with factory pattern (signing_only / bearer_only / mixed) per Python feedback at adcp-client#1269 comment
  • Kind-discriminated Credential union: ApiKeyCredential | OAuthCredential | HttpSigCredential
  • AuthInfo migration with one-minor deprecation cycle (tracked separately in companion issue)
  • Dispatch wire-up: registry call after auth verification, before accounts.resolve
  • RequestContext.buyer_agent field
  • sync_accounts enforcement of billing_capability (reject mismatched billing with INVALID_BILLING_MODEL)
  • New error codes: REQUEST_AUTH_UNRECOGNIZED_AGENT, AGENT_SUSPENDED, AGENT_BLOCKED
  • Reference: examples/buyer_agent_registry_sqlalchemy.py

Cross-references

Notes

Designed against 3.1 shapes — wire types stay 3.0 compliant; data model + Protocols anticipate 3.1's #3690 verifier chain.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions