|
8 | 8 | from pydantic_settings import BaseSettings, SettingsConfigDict |
9 | 9 |
|
10 | 10 | 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 | +] |
13 | 15 |
|
14 | 16 | _PREFIX_PATTERN = r"^/.*$" |
15 | 17 |
|
@@ -55,14 +57,14 @@ class Settings(BaseSettings): |
55 | 57 | # Auth |
56 | 58 | enable_authentication_extension: bool = True |
57 | 59 | default_public: bool = False |
58 | | - public_endpoints: EndpointMethodsNoScope = { |
| 60 | + public_endpoints: EndpointMethods = { |
59 | 61 | r"^/$": ["GET"], |
60 | 62 | r"^/api.html$": ["GET"], |
61 | 63 | r"^/api$": ["GET"], |
62 | 64 | r"^/docs/oauth2-redirect": ["GET"], |
63 | 65 | r"^/healthz": ["GET"], |
64 | 66 | } |
65 | | - private_endpoints: EndpointMethods = { |
| 67 | + private_endpoints: EndpointMethodsWithScope = { |
66 | 68 | # https://github.com/stac-api-extensions/collection-transaction/blob/v1.0.0-beta.1/README.md#methods |
67 | 69 | r"^/collections$": ["POST"], |
68 | 70 | r"^/collections/([^/]+)$": ["PUT", "PATCH", "DELETE"], |
|
0 commit comments