From 4e808cbed78e61665223ed994da2dcf6b645fb1e Mon Sep 17 00:00:00 2001 From: kingbri Date: Fri, 26 Jul 2024 15:04:29 -0400 Subject: [PATCH] Auth: Fix disable auth when checking for key permissions Since authentication is disabled, remove the limited permissions for requests. Signed-off-by: kingbri --- common/auth.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/auth.py b/common/auth.py index 4f7c9f8..174208d 100644 --- a/common/auth.py +++ b/common/auth.py @@ -84,6 +84,10 @@ def get_key_permission(request: Request): Internal only! Use the depends functions for incoming requests. """ + # Give full admin permissions if auth is disabled + if DISABLE_AUTH: + return "admin" + # Hyphens are okay here test_key = coalesce( request.headers.get("x-admin-key"),