Skip to content

Commit d9d0ca1

Browse files
committed
refactor(config): restructure settings classes for STAC Auth Proxy
- Renamed `Settings` class to `CoreSettings` and created a new `ProxySettings` class that inherits from it. - Updated imports in `__init__.py` to include `CoreSettings` and `ProxySettings`. - Adjusted configuration structure to better organize settings related to proxy functionality.
1 parent c894026 commit d9d0ca1

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

src/stac_auth_proxy/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
"""
88

99
from .app import configure_app, create_app
10-
from .config import Settings
10+
from .config import CoreSettings, ProxySettings, Settings
1111
from .lifespan import build_lifespan
1212

1313
__all__ = [
1414
"build_lifespan",
1515
"create_app",
1616
"configure_app",
1717
"Settings",
18+
"ProxySettings",
19+
"CoreSettings",
1820
]

src/stac_auth_proxy/config.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,14 @@ def __call__(self):
4040
return cls(*self.args, **self.kwargs)
4141

4242

43-
class Settings(BaseSettings):
43+
class CoreSettings(BaseSettings):
4444
"""Configuration settings for the STAC Auth Proxy."""
4545

4646
# External URLs
47-
upstream_url: HttpUrl
4847
oidc_discovery_url: HttpUrl
4948
oidc_discovery_internal_url: HttpUrl
5049
allowed_jwt_audiences: Optional[Sequence[str]] = None
5150

52-
root_path: str = ""
53-
override_host: bool = True
5451
healthz_prefix: str = Field(pattern=_PREFIX_PATTERN, default="/healthz")
5552
wait_for_upstream: bool = True
5653
check_conformance: bool = True
@@ -112,3 +109,15 @@ def _default_oidc_discovery_internal_url(cls, data: Any) -> Any:
112109
def parse_audience(cls, v) -> Optional[Sequence[str]]:
113110
"""Parse a comma separated string list of audiences into a list."""
114111
return str2list(v)
112+
113+
114+
class ProxySettings(CoreSettings):
115+
"""Configuration settings for the STAC Auth Proxy."""
116+
117+
# Proxy Configuration
118+
upstream_url: HttpUrl
119+
root_path: str = ""
120+
override_host: bool = True
121+
122+
123+
Settings = ProxySettings

0 commit comments

Comments
 (0)