stac_auth_proxy
STAC Auth Proxy package.
This package contains the components for the STAC authentication and proxying system. It includes FastAPI routes for handling authentication, authorization, and interaction with some internal STAC API.
Settings
¶
Bases: BaseSettings
Configuration settings for the STAC Auth Proxy.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
upstream_url
|
HttpUrl
|
|
required |
oidc_discovery_url
|
HttpUrl
|
|
required |
oidc_discovery_internal_url
|
HttpUrl
|
|
required |
allowed_jwt_audiences
|
Sequence[str] | None
|
|
None
|
root_path
|
str
|
|
''
|
override_host
|
bool
|
|
True
|
healthz_prefix
|
str
|
|
'/healthz'
|
wait_for_upstream
|
bool
|
|
True
|
check_conformance
|
bool
|
|
True
|
enable_compression
|
bool
|
|
True
|
openapi_spec_endpoint
|
str | None
|
|
'/api'
|
openapi_auth_scheme_name
|
str
|
|
'oidcAuth'
|
openapi_auth_scheme_override
|
dict | None
|
|
None
|
swagger_ui_endpoint
|
str | None
|
|
'/api.html'
|
swagger_ui_init_oauth
|
dict
|
dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2) |
<class 'dict'>
|
enable_authentication_extension
|
bool
|
|
True
|
default_public
|
bool
|
|
False
|
public_endpoints
|
dict[str, Sequence[Literal['GET', 'POST', 'PUT', 'DELETE', 'PATCH']]]
|
|
{'^/$': ['GET'], '^/api.html$': ['GET'], '^/api$': ['GET'], '^/conformance$': ['GET'], '^/docs/oauth2-redirect': ['GET'], '^/healthz': ['GET']}
|
private_endpoints
|
dict[str, Sequence[Union[Literal['GET', 'POST', 'PUT', 'DELETE', 'PATCH'], tuple[Literal['GET', 'POST', 'PUT', 'DELETE', 'PATCH'], str]]]]
|
|
{'^/collections$': ['POST'], '^/collections/([^/]+)$': ['PUT', 'PATCH', 'DELETE'], '^/collections/([^/]+)/items$': ['POST'], '^/collections/([^/]+)/items/([^/]+)$': ['PUT', 'PATCH', 'DELETE'], '^/collections/([^/]+)/bulk_items$': ['POST']}
|
items_filter
|
_ClassInput | None
|
|
None
|
items_filter_path
|
str
|
|
'^(/collections/([^/]+)/items(/[^/]+)?$|/search$)'
|
collections_filter
|
_ClassInput | None
|
|
None
|
collections_filter_path
|
str
|
|
'^/collections(/[^/]+)?$'
|
Source code in src/stac_auth_proxy/config.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
|
parse_audience(v) -> Optional[Sequence[str]]
classmethod
¶
Parse a comma separated string list of audiences into a list.
Source code in src/stac_auth_proxy/config.py
110 111 112 113 114 |
|
build_lifespan(settings: Settings | None = None, **settings_kwargs: Any)
¶
Create a lifespan handler that runs startup checks.
Parameters¶
settings : Settings | None, optional
Pre-built settings instance. If omitted, a new one is constructed from
settings_kwargs
.
**settings_kwargs : Any
Keyword arguments used to configure the health and conformance checks if
settings
is not provided.
Returns¶
Callable[[FastAPI], AsyncContextManager[Any]]
A callable suitable for the lifespan
parameter of FastAPI
.
Source code in src/stac_auth_proxy/lifespan.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
|
configure_app(app: FastAPI, settings: Optional[Settings] = None, **settings_kwargs: Any) -> FastAPI
¶
Apply routes and middleware to a FastAPI app.
Parameters¶
app : FastAPI
The FastAPI app to configure.
settings : Settings | None, optional
Pre-built settings instance. If omitted, a new one is constructed from
settings_kwargs
.
**settings_kwargs : Any
Keyword arguments used to configure the health and conformance checks if
settings
is not provided.
Source code in src/stac_auth_proxy/app.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
|
create_app(settings: Optional[Settings] = None) -> FastAPI
¶
FastAPI Application Factory.
Source code in src/stac_auth_proxy/app.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
|