tiny_auth_support #6
@@ -668,9 +668,15 @@ def install_guards(app) -> None:
|
|||||||
def _auth_guard():
|
def _auth_guard():
|
||||||
if not enabled():
|
if not enabled():
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
# Allow unauthenticated health checks for monitoring.
|
||||||
|
if request.path == "/api/health" or request.path.startswith("/api/health/"):
|
||||||
|
return None
|
||||||
|
|
||||||
g.api_token_authenticated = False
|
g.api_token_authenticated = False
|
||||||
if auth_bypassed_request():
|
if auth_bypassed_request():
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if request.path.startswith("/api/"):
|
if request.path.startswith("/api/"):
|
||||||
token_user = authenticate_api_token(_request_api_token())
|
token_user = authenticate_api_token(_request_api_token())
|
||||||
if token_user:
|
if token_user:
|
||||||
|
|||||||
Reference in New Issue
Block a user