Skip to content

Commit 4121ba8

Browse files
committed
refactor(config): update endpoint type aliases for clarity and structure
1 parent 59c6a97 commit 4121ba8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/stac_auth_proxy/config.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
from pydantic_settings import BaseSettings, SettingsConfigDict
99

1010
METHODS = Literal["GET", "POST", "PUT", "DELETE", "PATCH"]
11-
EndpointMethodsNoScope: TypeAlias = dict[str, Sequence[METHODS]]
12-
EndpointMethods: TypeAlias = dict[str, Sequence[Union[METHODS, tuple[METHODS, str]]]]
11+
EndpointMethods: TypeAlias = dict[str, Sequence[METHODS]]
12+
EndpointMethodsWithScope: TypeAlias = dict[
13+
str, Sequence[Union[METHODS, tuple[METHODS, str]]]
14+
]
1315

1416
_PREFIX_PATTERN = r"^/.*$"
1517

@@ -55,14 +57,14 @@ class Settings(BaseSettings):
5557
# Auth
5658
enable_authentication_extension: bool = True
5759
default_public: bool = False
58-
public_endpoints: EndpointMethodsNoScope = {
60+
public_endpoints: EndpointMethods = {
5961
r"^/$": ["GET"],
6062
r"^/api.html$": ["GET"],
6163
r"^/api$": ["GET"],
6264
r"^/docs/oauth2-redirect": ["GET"],
6365
r"^/healthz": ["GET"],
6466
}
65-
private_endpoints: EndpointMethods = {
67+
private_endpoints: EndpointMethodsWithScope = {
6668
# https://github.com/stac-api-extensions/collection-transaction/blob/v1.0.0-beta.1/README.md#methods
6769
r"^/collections$": ["POST"],
6870
r"^/collections/([^/]+)$": ["PUT", "PATCH", "DELETE"],

0 commit comments

Comments
 (0)