security: auth hatasi 401 yerine 404 don

Ne yaptik:
- verify_api_key: HTTPException 401 -> 404, detail 'Not Found'

Neden yaptik:
- API key'siz erisimde JSON hata mesaji gorunuyordu
- 404 ile endpoint yokmus gibi gozukur, domain ifsa olmaz
This commit is contained in:
furkanyigit34
2026-05-18 12:37:07 +03:00
parent 363a23dc30
commit 4c6320f710

View File

@@ -65,10 +65,7 @@ async def verify_api_key(request: Request, api_key: Optional[str] = Security(API
# API_KEY env var not set — authentication disabled
return
if not api_key or api_key != API_KEY:
raise HTTPException(
status_code=401,
detail="Invalid or missing API key"
)
raise HTTPException(status_code=404, detail="Not Found")
# GS1 Barcode Prefix to Country Mapping (EAN-13 / EAN-8)
# Source: https://www.gs1.org/standards/id-keys/company-prefix