(test) proxy_custom_auth

This commit is contained in:
ishaan-jaff 2024-02-01 14:54:57 -08:00
parent 9fb68710be
commit 311957b615

View file

@ -8,8 +8,10 @@ load_dotenv()
async def user_api_key_auth(request: Request, api_key: str) -> UserAPIKeyAuth:
try:
from litellm.proxy.proxy_server import MISSING_BEARER
print(f"api_key: {api_key}")
if api_key == "":
if api_key == MISSING_BEARER:
raise Exception(
f"CustomAuth - Malformed API Key passed in. Ensure Key has `Bearer` prefix"
)