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:
Yassin Kortam 2026-06-08 17:26:14 -07:00
parent 8acdf46464
commit 58f67b04d5

View file

@ -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)