AuthenticationExtensionMiddleware
Middleware to add auth information to item response served by upstream API.
AuthenticationExtensionMiddleware
dataclass
¶
Bases: JsonResponseMiddleware
Middleware to add the authentication extension to the response.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
app
|
Callable[list, Awaitable[None]]
|
|
required |
default_public
|
bool
|
|
required |
private_endpoints
|
dict[str, Sequence[Literal[GET, POST, PUT, DELETE, PATCH]]]
|
|
required |
public_endpoints
|
dict[str, Sequence[Literal[GET, POST, PUT, DELETE, PATCH]]]
|
|
required |
oidc_discovery_url
|
str
|
|
required |
auth_scheme_name
|
str
|
|
'oidc'
|
auth_scheme
|
dict[str, Any]
|
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'>
|
extension_url
|
str
|
|
'https://stac-extensions.github.io/authentication/v1.1.0/schema.json'
|
json_content_type_expr
|
str
|
|
'application/(geo\\+)?json'
|
Source code in src/stac_auth_proxy/middleware/AuthenticationExtensionMiddleware.py
21 22 23 24 25 26 27 28 29 30 31 32 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 |
|
should_transform_response(request: Request, scope: Scope) -> bool
¶
Determine if the response should be transformed.
Source code in src/stac_auth_proxy/middleware/AuthenticationExtensionMiddleware.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|
transform_json(data: dict[str, Any], request: Request) -> dict[str, Any]
¶
Augment the STAC Item with auth information.
Source code in src/stac_auth_proxy/middleware/AuthenticationExtensionMiddleware.py
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 |
|