Recognise require_admin_diagnostics as an authorization gate in the
route-auth dump, expose the request ID through CORS_EXPOSED_HEADERS,
and count the new router in docs/STRUCTURE.md.
scripts/dump_route_auth.py walked main.app only. The telephony gateway builds a
second FastAPI app for its own loopback listener and serves three routes there:
the Twilio voice webhook, its status callback and the media-stream WebSocket.
None appeared in the census, so the guard that every mutating route carries an
authorization dependency or a written allowlist decision never saw them.
Walk every route-serving app, tag each record with its app, list the covered apps
in the output, and allowlist the gateway's three routes with the decision each
makes (X-Twilio-Signature in-body, or the single-use per-call stream token). Add
a guard so a third app cannot serve routes outside the census.
tests/test_route_authorization_policy.py runs 16 passed; reverting the census
makes the new guard fail with KeyError: 'apps'.
* test(api): fail any mutating route that ships without an authorization decision
The existing policy test only checks the routers and routes someone listed, so a new mutating route with no dependency passed every gate. scripts/dump_route_auth.py reports the authorization callables attached to each route, and the new test requires a dependency or an allowlist entry with a written decision. Every WebSocket route is covered, and only the read-only GET / fallback is excluded from the dump.
* fix(auth-policy): retain root WebSockets and verify documented guards (#4130)
---------
Co-authored-by: debpalash <4178343+debpalash@users.noreply.github.com>