mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-05 02:41:56 +00:00
fix(identity): drop module-level fastapi import from store
store.py lives outside proxy/ but is re-exported by litellm/identity/__init__, so importing the identity package pulled fastapi at module load and broke SDK-only installs that omit the proxy extras. Use http.HTTPStatus for the 401 code instead; the value is unchanged (Greptile review finding).
This commit is contained in:
parent
8acdf46464
commit
58f67b04d5
1 changed files with 2 additions and 3 deletions
|
|
@ -7,10 +7,9 @@ carrier.
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from http import HTTPStatus
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from fastapi import status
|
||||
|
||||
from litellm.identity.principal import classify_principal_kind
|
||||
from litellm.integrations.otel.model.spans import SpanRole
|
||||
from litellm.integrations.otel.runtime import traced
|
||||
|
|
@ -144,7 +143,7 @@ async def load_identity(
|
|||
),
|
||||
type=ProxyErrorTypes.token_not_found_in_db,
|
||||
param="key",
|
||||
code=status.HTTP_401_UNAUTHORIZED,
|
||||
code=HTTPStatus.UNAUTHORIZED,
|
||||
)
|
||||
|
||||
await cache.set(hashed_token, uak)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue