Fix API Key Being Logged (#12978)

* AIF-262 Fix for keys being logged

* AIF-262 Undid http exception detail removal

* AIF-262 Converted f-string to normal
This commit is contained in:
aayush-malviya-acquia
2025-07-31 22:41:18 -07:00
committed by GitHub
parent 9955521194
commit 1e315dc33b
+2 -2
View File
@@ -579,7 +579,7 @@ async def _user_api_key_auth_builder( # noqa: PLR0915
elif api_key == "":
# missing 'Bearer ' prefix
raise Exception(
f"Malformed API Key passed in. Ensure Key has `Bearer ` prefix. Passed in: {passed_in_key}"
"Malformed API Key passed in. Ensure Key has `Bearer ` prefix."
)
if route == "/user/auth":
@@ -1237,7 +1237,7 @@ def get_api_key_from_custom_header(
api_key = _get_bearer_token(api_key=custom_api_key)
verbose_proxy_logger.debug(
"Found custom API key using header: {}, setting api_key={}".format(
custom_litellm_key_header_name, api_key
custom_litellm_key_header_name, abbreviate_api_key(api_key)
)
)
else: