@@ -33,7 +33,7 @@ pip install -e .
3333```
3434
3535> [ !NOTE]
36- > This project will be available on PyPi in the near future ( [ # 30 ] ( https://github.com/developmentseed/stac-auth-proxy/issues/30 ) ) .
36+ > This project will be available on PyPi in the near future[ ^ 30 ] .
3737
3838### Running
3939
@@ -43,8 +43,8 @@ The simplest way to run the project is by invoking the application via Docker:
4343docker run \
4444 -it --rm \
4545 -p 8000:8000 \
46- -e UPSTREAM_URL=https://google.com \
47- -e OIDC_DISCOVERY_URL=https://auth.openveda.cloud/realms/veda /.well-known/openid-configuration \
46+ -e UPSTREAM_URL=https://my-stac-api \
47+ -e OIDC_DISCOVERY_URL=https://my- auth-server /.well-known/openid-configuration \
4848 ghcr.io/developmentseed/stac-auth-proxy:latest
4949```
5050
@@ -71,6 +71,10 @@ The application is configurable via environment variables.
7171 - ** Type:** boolean
7272 - ** Required:** No, defaults to ` true `
7373 - ** Example:** ` false ` , ` 1 ` , ` True `
74+ - ** ` CHECK_CONFORMANCE ` ** , ensure upstream API conforms to required conformance classes before starting proxy
75+ - ** Type:** boolean
76+ - ** Required:** No, defaults to ` true `
77+ - ** Example:** ` false ` , ` 1 ` , ` True `
7478 - ** ` HEALTHZ_PREFIX ` ** , path prefix for health check endpoints
7579 - ** Type:** string
7680 - ** Required:** No, defaults to ` /healthz `
@@ -105,26 +109,26 @@ The application is configurable via environment variables.
105109 - **Required:** No, defaults to the following:
106110 ```json
107111 {
108- r "^/api.html$": ["GET"],
109- r "^/api$": ["GET"],
110- r "^/docs/oauth2-redirect": ["GET"],
111- r "^/healthz": ["GET"],
112+ "^/api.html$" : [" GET" ],
113+ "^/api$" : [" GET" ],
114+ "^/docs/oauth2-redirect" : [" GET" ],
115+ "^/healthz" : [" GET" ]
112116 }
113117 ```
114118 - **`OPENAPI_SPEC_ENDPOINT`**, path of OpenAPI specification, used for augmenting spec response with auth configuration
115119 - **Type:** string or null
116120 - **Required:** No, defaults to `null` (disabled)
117121 - **Example:** `/api`
118122- Filtering
119- - **`ITEMS_FILTER_CLS`**, [cql2 expression](https://developmentseed.org/cql2-rs/latest/python/#cql2.Expr) generator for item-level filtering
123+ - **`ITEMS_FILTER_CLS`**, CQL2 expression generator for item-level filtering
120124 - **Type:** JSON object with class configuration
121125 - **Required:** No, defaults to `null` (disabled)
122126 - **Example:** `my_package.filters:OrganizationFilter`
123- - **`ITEMS_FILTER_ARGS`**, [cql2 expression](https://developmentseed.org/cql2-rs/latest/python/#cql2.Expr) generator for item-level filtering
127+ - **`ITEMS_FILTER_ARGS`**, Positional arguments for CQL2 expression generator
124128 - **Type:** List of positional arguments used to initialize the class
125129 - **Required:** No, defaults to `[]`
126130 - **Example:**: `["org1"]`
127- - **`ITEMS_FILTER_KWARGS`**, [cql2 expression](https://developmentseed.org/cql2-rs/latest/python/#cql2.Expr) generator for item-level filtering
131+ - **`ITEMS_FILTER_KWARGS`**, Keyword arguments for CQL2 expression generator
128132 - **Type:** Dictionary of keyword arguments used to initialize the class
129133 - **Required:** No, defaults to `{}`
130134 - **Example:** `{ "field_name": "properties.organization" }`
@@ -172,7 +176,7 @@ The majority of the proxy's functionality occurs within a chain of middlewares.
172176The system supports generating CQL2 filters based on request context to provide row-level content filtering. These CQL2 filters are then set on outgoing requests prior to the upstream API.
173177
174178> [!IMPORTANT]
175- > The upstream STAC API must support the [STAC API Filter Extension](https://github.com/stac-api-extensions/filter/blob/main/README.md), including the [Features Filter](http://www.opengis.net/spec/ogcapi-features-3/1.0/conf/features-filter) conformance class on to the Features resource (`/collections/{cid}/items`) [# 37](https://github.com/developmentseed/stac-auth-proxy/issues/37) .
179+ > The upstream STAC API must support the [STAC API Filter Extension](https://github.com/stac-api-extensions/filter/blob/main/README.md), including the [Features Filter](http://www.opengis.net/spec/ogcapi-features-3/1.0/conf/features-filter) conformance class on to the Features resource (`/collections/{cid}/items`)[^ 37].
176180
177181> [!TIP]
178182> Integration with external authorization systems (e.g. [Open Policy Agent](https://www.openpolicyagent.org/)) can be achieved by specifying an `ITEMS_FILTER` that points to a class/function that, once initialized, returns a [`cql2.Expr` object](https://developmentseed.org/cql2-rs/latest/python/#cql2.Expr) when called with the request context.
@@ -191,53 +195,58 @@ If enabled, filters are intended to be applied to the following endpoints:
191195 - **Action:** Read Item
192196 - **Applied Filter:** `ITEMS_FILTER`
193197 - **Strategy:** Append body with generated CQL2 query.
194- - `GET /collections/{collection_id}`
195- - **Supported:** ❌ ([#23](https://github.com/developmentseed/stac-auth-proxy/issues/23))
196- - **Action:** Read Collection
197- - **Applied Filter:** `COLLECTIONS_FILTER`
198- - **Strategy:** Append query params with generated CQL2 query.
199198- `GET /collections/{collection_id}/items`
200199 - **Supported:** ✅
201200 - **Action:** Read Item
202201 - **Applied Filter:** `ITEMS_FILTER`
203202 - **Strategy:** Append query params with generated CQL2 query.
204203- `GET /collections/{collection_id}/items/{item_id}`
205- - **Supported:** ❌ ([#25](https://github.com/developmentseed/stac-auth-proxy/issues/25))
204+ - **Supported:** ✅
206205 - **Action:** Read Item
207206 - **Applied Filter:** `ITEMS_FILTER`
208207 - **Strategy:** Validate response against CQL2 query.
208+ - `GET /collections`
209+ - **Supported:** ❌[^23]
210+ - **Action:** Read Collection
211+ - **Applied Filter:** `COLLECTIONS_FILTER`
212+ - **Strategy:** Append query params with generated CQL2 query.
213+ - `GET /collections/{collection_id}`
214+ - **Supported:** ❌[^23]
215+ - **Action:** Read Collection
216+ - **Applied Filter:** `COLLECTIONS_FILTER`
217+ - **Strategy:** Validate response against CQL2 query.
209218- `POST /collections/`
210- - **Supported:** ❌ ([# 22](https://github.com/developmentseed/stac-auth-proxy/issues/22))
219+ - **Supported:** ❌[^ 22]
211220 - **Action:** Create Collection
212221 - **Applied Filter:** `COLLECTIONS_FILTER`
213222 - **Strategy:** Validate body with generated CQL2 query.
214223- `PUT /collections/{collection_id}}`
215- - **Supported:** ❌ ([# 22](https://github.com/developmentseed/stac-auth-proxy/issues/22))
224+ - **Supported:** ❌[^ 22]
216225 - **Action:** Update Collection
217226 - **Applied Filter:** `COLLECTIONS_FILTER`
218227 - **Strategy:** Fetch Collection and validate CQL2 query; merge Item with body and validate with generated CQL2 query.
219228- `DELETE /collections/{collection_id}`
220- - **Supported:** ❌ ([# 22](https://github.com/developmentseed/stac-auth-proxy/issues/22))
229+ - **Supported:** ❌[^ 22]
221230 - **Action:** Delete Collection
222231 - **Applied Filter:** `COLLECTIONS_FILTER`
223232 - **Strategy:** Fetch Collectiion and validate with CQL2 query.
224233- `POST /collections/{collection_id}/items`
225- - **Supported:** ❌ ([# 21](https://github.com/developmentseed/stac-auth-proxy/issues/21))
234+ - **Supported:** ❌[^ 21]
226235 - **Action:** Create Item
227236 - **Applied Filter:** `ITEMS_FILTER`
228237 - **Strategy:** Validate body with generated CQL2 query.
229238- `PUT /collections/{collection_id}/items/{item_id}`
230- - **Supported:** ❌ ([# 21](https://github.com/developmentseed/stac-auth-proxy/issues/21))
239+ - **Supported:** ❌[^ 21]
231240 - **Action:** Update Item
232241 - **Applied Filter:** `ITEMS_FILTER`
233242 - **Strategy:** Fetch Item and validate CQL2 query; merge Item with body and validate with generated CQL2 query.
234243- `DELETE /collections/{collection_id}/items/{item_id}`
235- - **Supported:** ❌ ([# 21](https://github.com/developmentseed/stac-auth-proxy/issues/21))
244+ - **Supported:** ❌[^ 21]
236245 - **Action:** Delete Item
237246 - **Applied Filter:** `ITEMS_FILTER`
238247 - **Strategy:** Fetch Item and validate with CQL2 query.
239248- `POST /collections/{collection_id}/bulk_items`
240- - **Supported:** ❌ ([# 21](https://github.com/developmentseed/stac-auth-proxy/issues/21))
249+ - **Supported:** ❌[^ 21]
241250 - **Action:** Create Items
242251 - **Applied Filter:** `ITEMS_FILTER`
243252 - **Strategy:** Validate items in body with generated CQL2 query.
@@ -253,3 +262,9 @@ sequenceDiagram
253262 Proxy->>STAC API: GET /collection?filter=(collection=landsat)
254263 STAC API->>Client: Response
255264```
265+
266+ [ ^ 21 ] : https://github.com/developmentseed/stac-auth-proxy/issues/21
267+ [ ^ 22 ] : https://github.com/developmentseed/stac-auth-proxy/issues/22
268+ [ ^ 23 ] : https://github.com/developmentseed/stac-auth-proxy/issues/23
269+ [ ^ 30 ] : https://github.com/developmentseed/stac-auth-proxy/issues/30
270+ [ ^ 37 ] : https://github.com/developmentseed/stac-auth-proxy/issues/37
0 commit comments