mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
fix(rbac): also gate /key/service-account/generate for org admins
/key/service-account/generate is in org_admin_allowed_routes (via key_management_routes), so without this check an org admin could bypass disable_key_generate_for_org_admin by calling the service-account endpoint instead.
This commit is contained in:
parent
57c6a1b38b
commit
28f43a7a37
1 changed files with 2 additions and 0 deletions
|
|
@ -1454,6 +1454,8 @@ async def generate_service_account_key_fn(
|
|||
detail={"error": CommonProxyErrors.db_not_connected_error.value},
|
||||
)
|
||||
|
||||
await check_org_admin_can_generate_keys(user_api_key_dict=user_api_key_dict)
|
||||
|
||||
await validate_team_id_used_in_service_account_request(
|
||||
team_id=data.team_id,
|
||||
prisma_client=prisma_client,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue