mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
fix(user_api_key_auth.py): more precisely expand scope to handle 'basic' tokens
This commit is contained in:
parent
742e3cbccf
commit
5fdbfcee44
4 changed files with 3 additions and 4 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -85,8 +85,10 @@ def _get_bearer_token(
|
||||||
):
|
):
|
||||||
if api_key.startswith("Bearer "): # ensure Bearer token passed in
|
if api_key.startswith("Bearer "): # ensure Bearer token passed in
|
||||||
api_key = api_key.replace("Bearer ", "") # extract the token
|
api_key = api_key.replace("Bearer ", "") # extract the token
|
||||||
|
elif api_key.startswith("Basic "):
|
||||||
|
api_key = api_key.replace("Basic ", "") # handle langfuse input
|
||||||
else:
|
else:
|
||||||
api_key = api_key
|
api_key = ""
|
||||||
return api_key
|
return api_key
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue