Commit d09309a
feat(adagents): fetch_agent_authorizations_from_directory for AAO inverse lookup (closes #746)
Adds a client function for the AAO directory's `GET /v1/agents/{agent_url}/publishers`
endpoint (adcp#4823 / #4828) — the inverse-lookup path that returns the set
of publishers whose adagents.json authorizes a given agent_url. Result is a
typed `AgentAuthorizationsDirectoryResult` (Pydantic, validated against the
real wire body). A 404 from the directory is the "not indexed" answer and
surfaces as a result with `publishers=[]`; timeouts raise
`AdagentsTimeoutError`; malformed or schema-noncompliant responses raise
`AdagentsValidationError`.
The directory's answer is *discovery*, not authorization — callers should
still verify each returned `publisher_domain` via `fetch_adagents` before
trusting the edge. Same SSRF gates apply (HTTPS only, DNS pre-check,
private/reserved address ban, 5 MiB body cap, no redirect follow).
Also bumps the schema pin to 3.1.0-beta.2 so `schemas/cache/` includes
`aao/agent-publishers.json`. Full Pydantic regen is deferred —
datamodel-code-generator mis-resolves `../enums/channels.json` when the
chain originates at a depth-0 schema (root-level `adagents.json` now
transitively references the new `core/product-format-declaration.json`,
which itself uses `../enums/...`). The hand-written models in this PR are
scoped to the new endpoint; unblocking full regen is tracked separately.
Tests use `httpx.MockTransport` to exercise the real wire shape end-to-end
and assert against `.model_validate()` on the Pydantic classes — covering
happy path, 404 → empty, `since` cursor passthrough, timeout, malformed
JSON, schema-mismatch, non-HTTPS guard, and 5xx surface.
Refs salesagent #511.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent dccae2e commit d09309a
666 files changed
Lines changed: 556505 additions & 2 deletions
File tree
- schemas/cache/3.1.0-beta.2
- a2ui
- aao
- account
- brand
- bundled
- content-standards
- core
- creative
- media-buy
- property
- protocol
- signals
- sponsored-intelligence
- collection
- compliance
- content-standards
- core
- assets
- requirements
- creative
- asset-types
- enums
- error-details
- extensions
- formats/canonical
- governance
- media-buy
- pricing-options
- property
- protocol
- registries
- signals
- sponsored-intelligence
- tmp
- src/adcp
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
0 commit comments