Skip to content

Commit b1d72ce

Browse files
committed
Fix tests
1 parent e6921d4 commit b1d72ce

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

src/stac_auth_proxy/app.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,11 @@ async def lifespan(app: FastAPI):
8181
if settings.swagger_ui_endpoint:
8282
assert (
8383
settings.openapi_spec_endpoint
84-
), "openapi_spec_endpoint must be set when using swagger_ui_url"
84+
), "openapi_spec_endpoint must be set when using swagger_ui_endpoint"
8585
app.add_route(
8686
settings.swagger_ui_endpoint,
8787
SwaggerUI(
8888
openapi_url=settings.openapi_spec_endpoint,
89-
title=settings.swagger_ui_title,
9089
init_oauth=settings.swagger_ui_init_oauth,
9190
).route,
9291
include_in_schema=False,

src/stac_auth_proxy/config.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,10 @@ class Settings(BaseSettings):
4646
enable_compression: bool = True
4747

4848
# OpenAPI / Swagger UI
49-
openapi_spec_endpoint: Optional[str] = Field(
50-
pattern=_PREFIX_PATTERN, default="/api"
51-
)
49+
openapi_spec_endpoint: Optional[str] = Field(pattern=_PREFIX_PATTERN, default=None)
5250
openapi_auth_scheme_name: str = "oidcAuth"
5351
openapi_auth_scheme_override: Optional[dict] = None
54-
swagger_ui_endpoint: Optional[str] = "/api.html"
52+
swagger_ui_endpoint: Optional[str] = None
5553
swagger_ui_init_oauth: dict = Field(default_factory=dict)
5654

5755
# Auth

tests/test_openapi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def test_no_openapi_spec_endpoint(source_api_server: str):
1515
app = app_factory(
1616
upstream_url=source_api_server,
1717
openapi_spec_endpoint=None,
18-
swagger_ui_url=None,
18+
swagger_ui_endpoint=None,
1919
)
2020
client = TestClient(app)
2121
response = client.get("/api")

0 commit comments

Comments
 (0)