The agent's API had no machine-readable description, so DAST could not
seed a scan of it from a spec (#997) and integrators had nothing to
generate a client from.
- utoipa 6 + utoipa-axum 0.3: `build_router` registers described routes
with `routes!`, which takes each route's path, method, parameters and
body from the handler's `#[utoipa::path]`, so the two cannot drift.
- `GET /api/v1/openapi.json` serves the document (OpenAPI 3.1). It sits
under the API prefix, so the customer authentication covers it, and it
is one of the paths the DAST spec parser tries and not one the API
fuzzer flags as exposed.
- A bearer scheme, set on every operation except the public ones: the
DAST spec parser reads operation-level `security` only.
- Described so far: the six DAST routes, with path and pagination
parameters and the add-target body (core types stay opaque, so core
needs no schema derive yet). Response bodies are not described yet.
- CI gate: a test fails when a plain route call in `routes.rs` is not in
`undescribed_routes.txt`, or the file names a route that is gone. The
list (101 paths) only shrinks; describing a route deletes its line.
- Docs: the description in the API-keys guide.
Tests:
- unit: the gate; the DAST operations carry bearer security, `{id}` path
and `page`/`limit` query parameters and a JSON body; OpenAPI 3.1; the
spec path is not a public one;
- integration: the running agent serves the document as JSON.
Part 1 of #1006. API keys cannot read the document yet: no key scope
covers it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9