fix(proxy/utils.py): remove original auth sk-.. key before logging to spend logs

This commit is contained in:
Krrish Dholakia 2024-01-23 16:19:32 -08:00
parent d52f5234b4
commit 7e0adbb9bd

View file

@ -838,6 +838,11 @@ def get_logging_payload(kwargs, response_obj, start_time, end_time):
# hash the api_key
api_key = hash_token(api_key)
if "headers" in metadata and "authorization" in metadata["headers"]:
metadata["headers"].pop(
"authorization"
) # do not store the original `sk-..` api key in the db
payload = {
"request_id": id,
"call_type": call_type,