Files
roboco/tests/unit/api
463c952b16 fix(api): bind the v1 role guard to a verified agent token (#228)
The v1 flow role guards (_require_roles) are the sole gate for /api/v1/flow/*
but checked only the X-Agent-Role string — unlike get_agent_context, which
verifies the token. So a forged role header passed, and in strict mode
(ROBOCO_AGENT_AUTH_REQUIRED) the token was never required on these routes.
Call _check_agent_auth_token before the role membership test (deferred import
to avoid the cycle): missing token stays a no-op in header-trust mode, any
presented token is verified, and strict mode now requires it.

Supersedes #222 (antfleet-ops flagged the bypass); re-done as our own change so
it lands without the contributor CLA, and adds the positive valid-token test
their PR was missing.

Co-authored-by: Renn F <rennf93@users.noreply.github.com>
2026-06-19 20:57:07 +02:00
..
2026-05-02 03:11:49 +02:00
2026-05-06 21:02:31 +02:00
2026-05-06 21:02:31 +02:00
2026-05-06 21:02:31 +02:00
2026-05-06 21:02:31 +02:00
2026-05-06 21:02:31 +02:00