litellm/tests/proxy_behavior/management
Yuneng Jiang 671e0bc129
test(proxy_behavior): pin /key/regenerate authz matrix + rotation contract (22 scenarios)
Slice 11 of the management-endpoints behavior-pinning effort. 21 matrix
scenarios (8 actors × 3 target shapes, minus the cross_org/owner combo
that exists in the seed but isn't applicable) plus one smoke for the
``/key/{key:path}/regenerate`` route registration.

On 200 outcomes the test verifies the full rotation contract:
  * the regenerate response key differs from the old cleartext,
  * the OLD cleartext returns 401 on a follow-up ``/key/info``,
  * the NEW cleartext returns 200 on a follow-up ``/key/info``.

On denied outcomes the test verifies the OLD cleartext still works —
catching any handler that mutates the token row on a failed call.

Pinned authz divergence vs /key/update: regenerate routes most denials
through the team-member-perm 401 path rather than the role-gate 403
path. The matrices for both endpoints are now in tree side-by-side, so
any future refactor that "harmonises" the codes will turn one of the two
red.

Plan: https://www.notion.so/36643b8acdab8128a581ced0f6a4744d
2026-05-19 21:50:57 -07:00
..
__init__.py test(proxy_behavior): scaffold session-scoped async ASGI client + liveness smoke 2026-05-19 21:21:00 -07:00
actors.py test(proxy_behavior): pin /key/generate authz matrix (18 scenarios) 2026-05-19 21:40:45 -07:00
conftest.py test(proxy_behavior): per-test scratch namespace + targeted delete_many teardown 2026-05-19 21:35:05 -07:00
test_key_generate.py test(proxy_behavior): pin /key/generate authz matrix (18 scenarios) 2026-05-19 21:40:45 -07:00
test_key_info.py test(proxy_behavior): pin /key/info authz matrix (24 scenarios) 2026-05-19 21:43:38 -07:00
test_key_list.py test(proxy_behavior): pin /key/list default-visibility matrix (8 scenarios) 2026-05-19 21:45:29 -07:00
test_key_regenerate.py test(proxy_behavior): pin /key/regenerate authz matrix + rotation contract (22 scenarios) 2026-05-19 21:50:57 -07:00
test_key_update.py test(proxy_behavior): pin /key/update authz matrix + mutation re-read (21 scenarios) 2026-05-19 21:48:47 -07:00
test_no_management_imports.py style(proxy_behavior): apply black to G3 grep test 2026-05-19 21:36:15 -07:00
test_scratch_teardown.py test(proxy_behavior): per-test scratch namespace + targeted delete_many teardown 2026-05-19 21:35:05 -07:00
test_smoke.py test(proxy_behavior): per-test scratch namespace + targeted delete_many teardown 2026-05-19 21:35:05 -07:00
test_world_seed.py test(proxy_behavior): seed 8-actor read-world for the authz matrix 2026-05-19 21:31:38 -07:00