Skip to content

Enable collection filtering support for stac-auth-proxy #411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Added

- Added the ability to set timeout for Opensearch and Elasticsearch clients by setting the environmental variable `ES_TIMEOUT` [#408](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/408)
- Added `collection-search#filter` conformance class to CollectionSearchExtension to enable compatibility with stac-auth-proxy collection filtering [#411](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/411)

### Changed

Expand Down
10 changes: 10 additions & 0 deletions stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
)
from stac_fastapi.extensions.core import (
AggregationExtension,
CollectionSearchExtension,
FilterExtension,
FreeTextExtension,
SortExtension,
Expand Down Expand Up @@ -60,6 +61,14 @@
FilterConformanceClasses.ADVANCED_COMPARISON_OPERATORS
)

# Adding collection search extension for compatibility with stac-auth-proxy
# (https://github.com/developmentseed/stac-auth-proxy)
# The extension is not fully implemented yet but is required for collection filtering support
collection_search_extension = CollectionSearchExtension()
collection_search_extension.conformance_classes.append(
"https://api.stacspec.org/v1.0.0-rc.1/collection-search#filter"
)

aggregation_extension = AggregationExtension(
client=EsAsyncBaseAggregationClient(
database=database_logic, session=session, settings=settings
Expand All @@ -75,6 +84,7 @@
TokenPaginationExtension(),
filter_extension,
FreeTextExtension(),
collection_search_extension,
]

if TRANSACTIONS_EXTENSIONS:
Expand Down
10 changes: 10 additions & 0 deletions stac_fastapi/opensearch/stac_fastapi/opensearch/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from stac_fastapi.core.utilities import get_bool_env
from stac_fastapi.extensions.core import (
AggregationExtension,
CollectionSearchExtension,
FilterExtension,
FreeTextExtension,
SortExtension,
Expand Down Expand Up @@ -60,6 +61,14 @@
FilterConformanceClasses.ADVANCED_COMPARISON_OPERATORS
)

# Adding collection search extension for compatibility with stac-auth-proxy
# (https://github.com/developmentseed/stac-auth-proxy)
# The extension is not fully implemented yet but is required for collection filtering support
collection_search_extension = CollectionSearchExtension()
collection_search_extension.conformance_classes.append(
"https://api.stacspec.org/v1.0.0-rc.1/collection-search#filter"
)

aggregation_extension = AggregationExtension(
client=EsAsyncBaseAggregationClient(
database=database_logic, session=session, settings=settings
Expand All @@ -75,6 +84,7 @@
TokenPaginationExtension(),
filter_extension,
FreeTextExtension(),
collection_search_extension,
]


Expand Down