refactor: Remove debug logging for security checks

This commit is contained in:
lc631017672
2025-07-07 10:27:48 +08:00
parent 1199d7cc3c
commit 64a68f1176

View File

@@ -80,12 +80,10 @@ class SecurityService:
# 否则检查请求头中的x-goog-api-key
if not x_goog_api_key:
logger.debug(f"Failed auth attempt: key='{key}', x_goog_api_key=None")
logger.error("Invalid key and missing x-goog-api-key header")
raise HTTPException(status_code=401, detail="Invalid key and missing x-goog-api-key header")
if x_goog_api_key not in settings.ALLOWED_TOKENS and x_goog_api_key != settings.AUTH_TOKEN:
logger.debug(f"Failed auth attempt: key='{key}', x_goog_api_key='{x_goog_api_key}'")
logger.error("Invalid key and invalid x-goog-api-key")
raise HTTPException(status_code=401, detail="Invalid key and invalid x-goog-api-key")