fix(user_api_key_auth.py): more precisely expand scope to handle 'basic' tokens

This commit is contained in:
Krrish Dholakia 2024-08-13 22:00:33 -07:00
parent 742e3cbccf
commit 5fdbfcee44
4 changed files with 3 additions and 4 deletions

View file

@ -85,8 +85,10 @@ def _get_bearer_token(
):
if api_key.startswith("Bearer "): # ensure Bearer token passed in
api_key = api_key.replace("Bearer ", "") # extract the token
elif api_key.startswith("Basic "):
api_key = api_key.replace("Basic ", "") # handle langfuse input
else:
api_key = api_key
api_key = ""
return api_key