From b89cfce12927d613a8fe6b6b382f6ed4be45c24a Mon Sep 17 00:00:00 2001 From: Anthony Lukach Date: Thu, 2 Jan 2025 23:34:59 -0800 Subject: [PATCH] Rm maybe auth check for public endpoints --- src/stac_auth_proxy/app.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/stac_auth_proxy/app.py b/src/stac_auth_proxy/app.py index 8540881..f03f5b2 100644 --- a/src/stac_auth_proxy/app.py +++ b/src/stac_auth_proxy/app.py @@ -71,7 +71,7 @@ def create_app(settings: Optional[Settings] = None) -> FastAPI: else openapi_handler ), methods=methods, - dependencies=[Security(auth_scheme.maybe_validated_user)], + dependencies=[], ) # Catchall for remainder of the endpoints @@ -80,13 +80,7 @@ def create_app(settings: Optional[Settings] = None) -> FastAPI: proxy_handler.stream, methods=["GET", "POST", "PUT", "PATCH", "DELETE"], dependencies=( - [ - Security( - auth_scheme.maybe_validated_user - if settings.default_public - else auth_scheme.validated_user - ) - ] + [] if settings.default_public else [Security(auth_scheme.validated_user)] ), )