fix(proxy_server.py): allow internal_user with permissions to create/view/delete their own keys

This commit is contained in:
Krrish Dholakia 2024-06-05 16:10:37 -07:00
parent e78cf92610
commit 7bef67c486
2 changed files with 12 additions and 0 deletions

View file

@ -1365,6 +1365,11 @@ async def user_api_key_auth(
status_code=status.HTTP_403_FORBIDDEN,
detail=f"user not allowed to access this route, role= {_user_role}. Trying to access: {route}",
)
elif (
_user_role == LitellmUserRoles.INTERNAL_USER
and route in LiteLLMRoutes.internal_user_routes.value
):
pass
else:
user_role = "unknown"
user_id = "unknown"