Skip to content

Commit 109eec0

Browse files
committed
docs(architecture): add filtering diagrams
1 parent 70e66ed commit 109eec0

File tree

5 files changed

+54
-0
lines changed

5 files changed

+54
-0
lines changed

docs/architecture/filtering-data.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Filtering Data
2+
3+
> [!NOTE]
4+
>
5+
> For more information on using filters to solve authorization needs, more information can be found in the [user guide](../user-guide/record-level-auth.md).
6+
7+
## Example Request Flow for multi-record endpoints
8+
9+
```mermaid
10+
sequenceDiagram
11+
Client->>Proxy: GET /collections
12+
Note over Proxy: EnforceAuth checks credentials
13+
Note over Proxy: BuildCql2Filter creates filter
14+
Note over Proxy: ApplyCql2Filter applies filter to request
15+
Proxy->>STAC API: GET /collection?filter=(collection=landsat)
16+
STAC API->>Client: Response
17+
```
18+
19+
## Example Request Flow for single-record endpoints
20+
21+
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:
22+
23+
```mermaid
24+
sequenceDiagram
25+
Client->>Proxy: GET /collections/abc123
26+
Note over Proxy: EnforceAuth checks credentials
27+
Note over Proxy: BuildCql2Filter creates filter
28+
Proxy->>STAC API: GET /collection/abc123
29+
Note over Proxy: ApplyCql2Filter validates the response
30+
STAC API->>Client: Response
31+
```

docs/user-guide/deployment.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Deployment

docs/user-guide/record-level-auth.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ Record-level authorization is implemented through **data filtering**—a strateg
1717

1818
For endpoints where the filter extension doesn't apply (such as single-item endpoints), the filters are used to validate response data from the upstream STAC API before the user receives the data, ensuring complete authorization coverage.
1919

20+
> [!NOTE]
21+
>
22+
> For more information on _how_ data filtering works, some more information can be found in the [architecture section](../architecture/filtering-data.md) of the docs.
23+
2024
## Supported Operations
2125

2226
### Collection-Level Filtering

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ nav:
3737
- Tips: user-guide/tips.md
3838
- Architecture:
3939
- Middleware Stack: architecture/middleware-stack.md
40+
- Filtering Data: architecture/filtering-data.md
4041
- Changelog: changelog.md
4142

4243
plugins:

src/stac_auth_proxy/lambda.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""Handler for AWS Lambda."""
2+
3+
from stac_auth_proxy import create_app
4+
5+
try:
6+
from mangum import Mangum
7+
except ImportError:
8+
raise ImportError(
9+
"mangum is required to use the Lambda handler. Install stac-auth-proxy[lambda]."
10+
)
11+
12+
13+
handler = Mangum(
14+
create_app(),
15+
# NOTE: lifespan="off" skips conformance check and upstream health checks on startup
16+
lifespan="off",
17+
)

0 commit comments

Comments
 (0)