Skip to content

Commit ad4b2eb

Browse files
committed
Support root path to enable requesting from a different route than root
1 parent 2d04011 commit ad4b2eb

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/stac_auth_proxy/app.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@ async def lifespan(app: FastAPI):
6767
app = FastAPI(
6868
openapi_url=None, # Disable OpenAPI schema endpoint, we want to serve upstream's schema
6969
lifespan=lifespan,
70+
root_path=settings.root_path,
7071
)
72+
if app.root_path:
73+
logger.debug("Mounted app at %s", app.root_path)
7174

7275
#
7376
# Handlers (place catch-all proxy handler last)

src/stac_auth_proxy/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class Settings(BaseSettings):
3838
oidc_discovery_url: HttpUrl
3939
oidc_discovery_internal_url: HttpUrl
4040

41+
root_path: str = ""
4142
wait_for_upstream: bool = True
4243
check_conformance: bool = True
4344
enable_compression: bool = True

0 commit comments

Comments
 (0)