Auth: Fix disable auth when checking for key permissions

Since authentication is disabled, remove the limited permissions
for requests.

Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
kingbri 2024-07-26 15:04:29 -04:00
parent f47d96790c
commit 4e808cbed7

View file

@ -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"),