mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 19:24:27 +00:00
fix(user_api_key_auth.py): fix linting errors
This commit is contained in:
parent
cbad9e7502
commit
996763af1e
1 changed files with 6 additions and 4 deletions
|
@ -1152,7 +1152,7 @@ async def user_api_key_auth(
|
||||||
):
|
):
|
||||||
return UserAPIKeyAuth(
|
return UserAPIKeyAuth(
|
||||||
api_key=api_key,
|
api_key=api_key,
|
||||||
user_role=_user_role,
|
user_role=_user_role, # type: ignore
|
||||||
parent_otel_span=parent_otel_span,
|
parent_otel_span=parent_otel_span,
|
||||||
**valid_token_dict,
|
**valid_token_dict,
|
||||||
)
|
)
|
||||||
|
@ -1164,7 +1164,9 @@ async def user_api_key_auth(
|
||||||
# No token was found when looking up in the DB
|
# No token was found when looking up in the DB
|
||||||
raise Exception("Invalid proxy server token passed")
|
raise Exception("Invalid proxy server token passed")
|
||||||
if valid_token_dict is not None:
|
if valid_token_dict is not None:
|
||||||
user_role = _get_user_role(user_id_information=user_id_information)
|
retrieved_user_role: Optional[str] = _get_user_role(
|
||||||
|
user_id_information=user_id_information
|
||||||
|
)
|
||||||
if user_id_information is not None and _is_user_proxy_admin(
|
if user_id_information is not None and _is_user_proxy_admin(
|
||||||
user_id_information
|
user_id_information
|
||||||
):
|
):
|
||||||
|
@ -1177,14 +1179,14 @@ async def user_api_key_auth(
|
||||||
elif _has_user_setup_sso() and route in LiteLLMRoutes.sso_only_routes.value:
|
elif _has_user_setup_sso() and route in LiteLLMRoutes.sso_only_routes.value:
|
||||||
return UserAPIKeyAuth(
|
return UserAPIKeyAuth(
|
||||||
api_key=api_key,
|
api_key=api_key,
|
||||||
user_role=user_role or LitellmUserRoles.INTERNAL_USER,
|
user_role=retrieved_user_role or LitellmUserRoles.INTERNAL_USER, # type: ignore
|
||||||
parent_otel_span=parent_otel_span,
|
parent_otel_span=parent_otel_span,
|
||||||
**valid_token_dict,
|
**valid_token_dict,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
return UserAPIKeyAuth(
|
return UserAPIKeyAuth(
|
||||||
api_key=api_key,
|
api_key=api_key,
|
||||||
user_role=user_role or LitellmUserRoles.INTERNAL_USER,
|
user_role=retrieved_user_role or LitellmUserRoles.INTERNAL_USER, # type: ignore
|
||||||
parent_otel_span=parent_otel_span,
|
parent_otel_span=parent_otel_span,
|
||||||
**valid_token_dict,
|
**valid_token_dict,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue