From 10890913b81668785fe89abc2cd756bfa775dad4 Mon Sep 17 00:00:00 2001 From: kingbri Date: Thu, 11 Jul 2024 12:33:06 -0400 Subject: [PATCH] Auth: Revert x-admin-key allowance in API key check These kinda clash with each other. Use the correct header for the correct endpoint. Signed-off-by: kingbri --- common/auth.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/common/auth.py b/common/auth.py index 7ba13de..623de63 100644 --- a/common/auth.py +++ b/common/auth.py @@ -107,8 +107,7 @@ def get_key_permission(request: Request): async def check_api_key( x_api_key: str = Header(None), - x_admin_key: str = Header(None), - authorization: str = Header(None), + authorization: str = Header(None) ): """Check if the API key is valid.""" @@ -121,11 +120,6 @@ async def check_api_key( raise HTTPException(401, "Invalid API key") return x_api_key - if x_admin_key: - if not AUTH_KEYS.verify_key(x_admin_key, "admin_key"): - raise HTTPException(401, "Invalid API key") - return x_admin_key - if authorization: split_key = authorization.split(" ") if len(split_key) < 2: