Commit Graph
3 Commits
Author SHA1 Message Date
debpalash 6f509359b1 fix(api-activity): register the route with the repo's guard inventories
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.
2026-12-01 04:40:40 +05:30
DeryFerd ab3d6d6941 fix(auth): include the telephony gateway in the route census
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'.
2026-11-17 14:40:38 +07:00
Dery Ferdikaanddebpalash 001470e611 test(api): fail any mutating route that ships without an authorization decision (#4130)
* 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>
2026-11-14 19:17:31 +05:30