Merge pull request #4164 from BerriAI/litellm_fix_error_inernal_users_sso_saw

[Admin UI] Fix error Internal Users see when using SSO
This commit is contained in:
Ishaan Jaff 2024-06-12 19:45:10 -07:00 • committed by GitHub
commit 4fc16a6bec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 4 additions and 2 deletions

View file

@ -224,6 +224,7 @@ class LiteLLMRoutes(enum.Enum):
"/key/delete",
"/global/spend/logs",
"/global/predict/spend/logs",
"/sso/get/logout_url",
]
management_routes: List = [ # key

View file

@ -879,6 +879,7 @@ async def user_api_key_auth(
## check for cache hit (In-Memory Cache)
original_api_key = api_key # (Patch: For DynamoDB Backwards Compatibility)
_user_role = None
if api_key.startswith("sk-"):
api_key = hash_token(token=api_key)
valid_token: Optional[UserAPIKeyAuth] = user_api_key_cache.get_cache( # type: ignore
@ -1512,7 +1513,7 @@ async def user_api_key_auth(
):
return UserAPIKeyAuth(
api_key=api_key,
user_role="app_owner",
user_role=_user_role,
parent_otel_span=parent_otel_span,
**valid_token_dict,
)

View file

@ -3618,6 +3618,7 @@ class Router:
except Exception:
model_info = None
# get llm provider
model, llm_provider = "", ""
try:
model, llm_provider, _, _ = litellm.get_llm_provider(
model=litellm_params.model,

View file

@ -2405,7 +2405,6 @@ export const getProxyBaseUrlAndLogoutUrl = async (
if (!response.ok) {
const errorData = await response.text();
message.error(errorData, 10);
throw new Error("Network response was not ok");
}