Skip to content

Commit b89cfce

Browse files
committed
Rm maybe auth check for public endpoints
1 parent 39dd77b commit b89cfce

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/stac_auth_proxy/app.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def create_app(settings: Optional[Settings] = None) -> FastAPI:
7171
else openapi_handler
7272
),
7373
methods=methods,
74-
dependencies=[Security(auth_scheme.maybe_validated_user)],
74+
dependencies=[],
7575
)
7676

7777
# Catchall for remainder of the endpoints
@@ -80,13 +80,7 @@ def create_app(settings: Optional[Settings] = None) -> FastAPI:
8080
proxy_handler.stream,
8181
methods=["GET", "POST", "PUT", "PATCH", "DELETE"],
8282
dependencies=(
83-
[
84-
Security(
85-
auth_scheme.maybe_validated_user
86-
if settings.default_public
87-
else auth_scheme.validated_user
88-
)
89-
]
83+
[] if settings.default_public else [Security(auth_scheme.validated_user)]
9084
),
9185
)
9286

0 commit comments

Comments
 (0)