Middleware Stack¶
Aside from the actual communication with the upstream STAC API, the majority of the proxy's functionality occurs within a chain of middlewares. Each request passes through this chain, wherein each middleware performs a specific task:
-
- Handles authentication and authorization
- Configurable public/private endpoints
- OIDC integration
- Places auth token payload in request state
-
- Builds CQL2 filters based on request context/state
- Places CQL2 expression in request state
-
Cql2ApplyFilterQueryStringMiddleware
- Retrieves CQL2 expression from request state
- Augments
GET
requests with CQL2 filter by appending to querystring
-
- Retrieves CQL2 expression from request state
- Augments
POST`/`PUT`/`PATCH
requests with CQL2 filter by modifying body
-
Cql2ValidateResponseBodyMiddleware
- Retrieves CQL2 expression from request state
- Validates response against CQL2 filter for non-filterable endpoints
-
- Modifies OpenAPI specification based on endpoint configuration, adding security requirements
- Only active if
openapi_spec_endpoint
is configured
-
AddProcessTimeHeaderMiddleware
- Adds processing time headers
- Useful for monitoring/debugging