Skip to content

Commit 1a75550

Browse files
committed
docs: add illustration for appying filters on non-filter compliant endpoints
1 parent 9b172dd commit 1a75550

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ If enabled, filters are applied to the following endpoints:
329329
- **Applied Filter:** `ITEMS_FILTER`
330330
- **Strategy:** Validate items in body with generated CQL2 query.
331331

332-
#### Example GET Request Flow
332+
#### Example Request Flow for multi-record endpoints
333333

334334
```mermaid
335335
sequenceDiagram
@@ -341,6 +341,20 @@ sequenceDiagram
341341
STAC API->>Client: Response
342342
```
343343

344+
#### Example Request Flow for single-record endpoints
345+
346+
The Filter Extension does not apply to fetching individual records. As such, we must validate the record _after_ it is returned from the upstream API but _before_ it is returned to the user:
347+
348+
```mermaid
349+
sequenceDiagram
350+
Client->>Proxy: GET /collections/abc123
351+
Note over Proxy: EnforceAuth checks credentials
352+
Note over Proxy: BuildCql2Filter creates filter
353+
Proxy->>STAC API: GET /collection/abc123
354+
Note over Proxy: ApplyCql2Filter validates the response
355+
STAC API->>Client: Response
356+
```
357+
344358
#### Authoring Filter Generators
345359

346360
The `ITEMS_FILTER_CLS` configuration option can be used to specify a class that will be used to generate a CQL2 filter for the request. The class must define a `__call__` method that accepts a single argument: a dictionary containing the request context; and returns a valid `cql2-text` expression (as a `str`) or `cql2-json` expression (as a `dict`).

0 commit comments

Comments
 (0)