fix(proxy): block bulk user creation during the master key lockout
Some checks failed
Terraform Provider / gofmt, vet, build, test (push) Has been cancelled
ai-gateway image / ai-gateway release image (push) Has been cancelled
LiteLLM Rust / rust-lint (push) Has been cancelled
LiteLLM Rust / rust-test (push) Has been cancelled
Terraform Provider / Provider endpoints vs proxy OpenAPI schema (push) Has been cancelled

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
mateo 2026-09-15 18:40:44 +00:00
parent 0f1a44fb15
commit 12c71ab407
2 changed files with 3 additions and 1 deletions

View file

@ -41,7 +41,7 @@ class _DeploymentMarker(TypedDict, total=False):
_DEPLOYMENT_MARKERS: Final = TypeAdapter(list[_DeploymentMarker])
_VIRTUAL_KEY_MINTING_ROUTES: Final = ("/user/new",)
_VIRTUAL_KEY_MINTING_ROUTES: Final = ("/user/new", "/management/v1/users/bulk")
_ACCESS_CREDENTIAL_ROUTES: Final = (
"/credentials",

View file

@ -103,6 +103,7 @@ def test_insecure_master_key_warning_survives_redaction():
("/key/service-account/generate", "POST", "manage_virtual_keys"),
("/key/block", "POST", "manage_virtual_keys"),
("/user/new", "POST", "manage_virtual_keys"),
("/management/v1/users/bulk", "POST", "manage_virtual_keys"),
("/key/info", "GET", None),
("/user/info", "GET", None),
("/key/list", "GET", None),
@ -143,6 +144,7 @@ def test_master_key_lockout_action_none_when_key_secure(route, method):
("/key/generate", "POST"),
("/key/abc/regenerate", "POST"),
("/user/new", "POST"),
("/management/v1/users/bulk", "POST"),
],
)
@pytest.mark.parametrize("reason", ["example_key", "missing"])