Skip to content

Commit edbd85a

Browse files
committed
uncomment fix
1 parent 4f1f360 commit edbd85a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/stac_auth_proxy/middleware/UpdateOpenApiMiddleware.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ def transform_json(self, data: dict[str, Any], request: Request) -> dict[str, An
6262
# Add security to private endpoints
6363
for path, method_config in data["paths"].items():
6464
for method, config in method_config.items():
65-
# if method == "options":
66-
# # OPTIONS requests are not authenticated, https://fetch.spec.whatwg.org/#cors-protocol-and-credentials
67-
# continue
65+
if method == "options":
66+
# OPTIONS requests are not authenticated, https://fetch.spec.whatwg.org/#cors-protocol-and-credentials
67+
continue
6868
match = find_match(
6969
path,
7070
method,

tests/test_openapi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def test_oidc_in_openapi_spec_public_endpoints(
129129
source_api: FastAPI, source_api_server: str
130130
):
131131
"""When OpenAPI spec endpoint is set & endpoints are marked public, those endpoints are not marked private in the spec."""
132-
public = {r"^/queryables$": ["GET"], r"^/api": ["GET"]}
132+
public = {r"^/queryables$": ["GET"], r"^/api$": ["GET"]}
133133
app = app_factory(
134134
upstream_url=source_api_server,
135135
openapi_spec_endpoint=source_api.openapi_url,
@@ -148,7 +148,7 @@ def test_oidc_in_openapi_spec_public_endpoints(
148148
if method == "options":
149149
assert (
150150
not security
151-
), "OPTIONS requests should not require authentication"
151+
), f"OPTIONS {path} requests should not require authentication"
152152
continue
153153

154154
if security:

0 commit comments

Comments
 (0)