Skip to content

Commit b3dd73e

Browse files
committed
feat: support specifying cls & args & kwargs separately
1 parent 7496b76 commit b3dd73e

File tree

2 files changed

+13
-16
lines changed

2 files changed

+13
-16
lines changed

README.md

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -107,23 +107,18 @@ The application is configurable via environment variables.
107107
- **Required:** No, defaults to `null` (disabled)
108108
- **Example:** `/api`
109109
- Filtering
110-
- **`ITEMS_FILTER`**, [cql2 expression](https://developmentseed.org/cql2-rs/latest/python/#cql2.Expr) generator for item-level filtering
110+
- **`ITEMS_FILTER_CLS`**, [cql2 expression](https://developmentseed.org/cql2-rs/latest/python/#cql2.Expr) generator for item-level filtering
111111
- **Type:** JSON object with class configuration
112112
- **Required:** No, defaults to `null` (disabled)
113-
- **Components**:
114-
- `cls`: Python import path
115-
- `args`: List of positional arguments
116-
- `kwargs`: Dictionary of keyword arguments
117-
- **Example:**
118-
```json
119-
{
120-
"cls": "my_package.filters:OrganizationFilter",
121-
"args": ["org1"],
122-
"kwargs": {
123-
"field_name": "properties.organization"
124-
}
125-
}
126-
```
113+
- **Example:** `my_package.filters:OrganizationFilter`
114+
- **`ITEMS_FILTER_ARGS`**, [cql2 expression](https://developmentseed.org/cql2-rs/latest/python/#cql2.Expr) generator for item-level filtering
115+
- **Type:** List of positional arguments used to initialize the class
116+
- **Required:** No, defaults to `[]`
117+
- **Example:**: `["org1"]`
118+
- **`ITEMS_FILTER_KWARGS`**, [cql2 expression](https://developmentseed.org/cql2-rs/latest/python/#cql2.Expr) generator for item-level filtering
119+
- **Type:** Dictionary of keyword arguments used to initialize the class
120+
- **Required:** No, defaults to `{}`
121+
- **Example:** `{ "field_name": "properties.organization" }`
127122

128123
### Customization
129124

src/stac_auth_proxy/config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ class Settings(BaseSettings):
6666
# Filters
6767
items_filter: Optional[ClassInput] = None
6868

69-
model_config = SettingsConfigDict()
69+
model_config = SettingsConfigDict(
70+
env_nested_delimiter="_",
71+
)
7072

7173
@model_validator(mode="before")
7274
@classmethod

0 commit comments

Comments
 (0)