docs(identity): drop overstated framework-agnostic claim in extractors

This commit is contained in:
Yassin Kortam 2026-06-08 15:39:07 -07:00
parent 6713edfe09
commit a909d21f19

View file

@ -25,11 +25,8 @@ def hash_principal_token(api_key: str) -> str:
def extract_api_key_principal(api_key: Optional[str]) -> Optional[ApiKeyPrincipal]:
"""Build an ``ApiKeyPrincipal`` from a raw API key string.
Returns ``None`` when no key is supplied. Callers that need to pull
the key out of a FastAPI request should call ``get_api_key`` from
``litellm.proxy.auth.user_api_key_auth`` first; this extractor stays
framework-agnostic on purpose so it can be reused by non-FastAPI
entrypoints (CLI, MCP, background jobs).
Returns ``None`` when no key is supplied. Callers that need to pull the
key out of a request should call ``get_api_key`` first.
"""
if not api_key:
return None