Skip to content

Commit e34e923

Browse files
GrzegorzPustulkaGrzegorz Pustulkajonhealy1BBrixenBennett Patrick Brixen
authored
Enable collection filtering support for stac-auth-proxy (#411)
Added `collection-search#filter` conformance class to CollectionSearchExtension to enable compatibility with stac-auth-proxy collection filtering **PR Checklist:** - [ ] Code is formatted and linted (run `pre-commit run --all-files`) - [ ] Tests pass (run `make test`) - [ ] Documentation has been updated to reflect changes, if applicable - [ ] Changes are added to the changelog --------- Co-authored-by: Grzegorz Pustulka <gpustulka@cloudferro.com> Co-authored-by: Jonathan Healy <jonathan.d.healy@gmail.com> Co-authored-by: Bennett Brixen <bbrixen02@gmail.com> Co-authored-by: Bennett Patrick Brixen <bpbrixe@sandia.gov>
1 parent 970f65e commit e34e923

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1111
### Added
1212

1313
- 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)
14+
- 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)
1415

1516
### Changed
1617

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/app.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
)
3232
from stac_fastapi.extensions.core import (
3333
AggregationExtension,
34+
CollectionSearchExtension,
3435
FilterExtension,
3536
FreeTextExtension,
3637
SortExtension,
@@ -60,6 +61,14 @@
6061
FilterConformanceClasses.ADVANCED_COMPARISON_OPERATORS
6162
)
6263

64+
# Adding collection search extension for compatibility with stac-auth-proxy
65+
# (https://github.com/developmentseed/stac-auth-proxy)
66+
# The extension is not fully implemented yet but is required for collection filtering support
67+
collection_search_extension = CollectionSearchExtension()
68+
collection_search_extension.conformance_classes.append(
69+
"https://api.stacspec.org/v1.0.0-rc.1/collection-search#filter"
70+
)
71+
6372
aggregation_extension = AggregationExtension(
6473
client=EsAsyncBaseAggregationClient(
6574
database=database_logic, session=session, settings=settings
@@ -75,6 +84,7 @@
7584
TokenPaginationExtension(),
7685
filter_extension,
7786
FreeTextExtension(),
87+
collection_search_extension,
7888
]
7989

8090
if TRANSACTIONS_EXTENSIONS:

stac_fastapi/opensearch/stac_fastapi/opensearch/app.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from stac_fastapi.core.utilities import get_bool_env
2626
from stac_fastapi.extensions.core import (
2727
AggregationExtension,
28+
CollectionSearchExtension,
2829
FilterExtension,
2930
FreeTextExtension,
3031
SortExtension,
@@ -60,6 +61,14 @@
6061
FilterConformanceClasses.ADVANCED_COMPARISON_OPERATORS
6162
)
6263

64+
# Adding collection search extension for compatibility with stac-auth-proxy
65+
# (https://github.com/developmentseed/stac-auth-proxy)
66+
# The extension is not fully implemented yet but is required for collection filtering support
67+
collection_search_extension = CollectionSearchExtension()
68+
collection_search_extension.conformance_classes.append(
69+
"https://api.stacspec.org/v1.0.0-rc.1/collection-search#filter"
70+
)
71+
6372
aggregation_extension = AggregationExtension(
6473
client=EsAsyncBaseAggregationClient(
6574
database=database_logic, session=session, settings=settings
@@ -75,6 +84,7 @@
7584
TokenPaginationExtension(),
7685
filter_extension,
7786
FreeTextExtension(),
87+
collection_search_extension,
7888
]
7989

8090

0 commit comments

Comments
 (0)