stac-fastapi-elasticsearch 6.0.0__py3-none-any.whl → 6.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- stac_fastapi/elasticsearch/app.py +11 -1
- stac_fastapi/elasticsearch/config.py +4 -0
- stac_fastapi/elasticsearch/database_logic.py +7 -0
- stac_fastapi/elasticsearch/version.py +1 -1
- {stac_fastapi_elasticsearch-6.0.0.dist-info → stac_fastapi_elasticsearch-6.1.0.dist-info}/METADATA +17 -15
- stac_fastapi_elasticsearch-6.1.0.dist-info/RECORD +10 -0
- stac_fastapi_elasticsearch-6.0.0.dist-info/RECORD +0 -10
- {stac_fastapi_elasticsearch-6.0.0.dist-info → stac_fastapi_elasticsearch-6.1.0.dist-info}/WHEEL +0 -0
- {stac_fastapi_elasticsearch-6.0.0.dist-info → stac_fastapi_elasticsearch-6.1.0.dist-info}/entry_points.txt +0 -0
- {stac_fastapi_elasticsearch-6.0.0.dist-info → stac_fastapi_elasticsearch-6.1.0.dist-info}/top_level.txt +0 -0
|
@@ -31,6 +31,7 @@ from stac_fastapi.elasticsearch.database_logic import (
|
|
|
31
31
|
)
|
|
32
32
|
from stac_fastapi.extensions.core import (
|
|
33
33
|
AggregationExtension,
|
|
34
|
+
CollectionSearchExtension,
|
|
34
35
|
FilterExtension,
|
|
35
36
|
FreeTextExtension,
|
|
36
37
|
SortExtension,
|
|
@@ -60,6 +61,14 @@ filter_extension.conformance_classes.append(
|
|
|
60
61
|
FilterConformanceClasses.ADVANCED_COMPARISON_OPERATORS
|
|
61
62
|
)
|
|
62
63
|
|
|
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
|
+
|
|
63
72
|
aggregation_extension = AggregationExtension(
|
|
64
73
|
client=EsAsyncBaseAggregationClient(
|
|
65
74
|
database=database_logic, session=session, settings=settings
|
|
@@ -75,6 +84,7 @@ search_extensions = [
|
|
|
75
84
|
TokenPaginationExtension(),
|
|
76
85
|
filter_extension,
|
|
77
86
|
FreeTextExtension(),
|
|
87
|
+
collection_search_extension,
|
|
78
88
|
]
|
|
79
89
|
|
|
80
90
|
if TRANSACTIONS_EXTENSIONS:
|
|
@@ -107,7 +117,7 @@ post_request_model = create_post_request_model(search_extensions)
|
|
|
107
117
|
app_config = {
|
|
108
118
|
"title": os.getenv("STAC_FASTAPI_TITLE", "stac-fastapi-elasticsearch"),
|
|
109
119
|
"description": os.getenv("STAC_FASTAPI_DESCRIPTION", "stac-fastapi-elasticsearch"),
|
|
110
|
-
"api_version": os.getenv("STAC_FASTAPI_VERSION", "6.
|
|
120
|
+
"api_version": os.getenv("STAC_FASTAPI_VERSION", "6.1.0"),
|
|
111
121
|
"settings": settings,
|
|
112
122
|
"extensions": extensions,
|
|
113
123
|
"client": CoreClient(
|
|
@@ -56,6 +56,10 @@ def _es_config() -> Dict[str, Any]:
|
|
|
56
56
|
if (u := os.getenv("ES_USER")) and (p := os.getenv("ES_PASS")):
|
|
57
57
|
config["http_auth"] = (u, p)
|
|
58
58
|
|
|
59
|
+
# Include timeout setting if set
|
|
60
|
+
if request_timeout := os.getenv("ES_TIMEOUT"):
|
|
61
|
+
config["request_timeout"] = request_timeout
|
|
62
|
+
|
|
59
63
|
# Explicitly exclude SSL settings when not using SSL
|
|
60
64
|
if not use_ssl:
|
|
61
65
|
return config
|
|
@@ -43,6 +43,10 @@ from stac_fastapi.sfeos_helpers.database import (
|
|
|
43
43
|
return_date,
|
|
44
44
|
validate_refresh,
|
|
45
45
|
)
|
|
46
|
+
from stac_fastapi.sfeos_helpers.database.query import (
|
|
47
|
+
ES_MAX_URL_LENGTH,
|
|
48
|
+
add_collections_to_body,
|
|
49
|
+
)
|
|
46
50
|
from stac_fastapi.sfeos_helpers.database.utils import (
|
|
47
51
|
merge_to_operations,
|
|
48
52
|
operations_to_script,
|
|
@@ -520,6 +524,9 @@ class DatabaseLogic(BaseDatabaseLogic):
|
|
|
520
524
|
query = search.query.to_dict() if search.query else None
|
|
521
525
|
|
|
522
526
|
index_param = indices(collection_ids)
|
|
527
|
+
if len(index_param) > ES_MAX_URL_LENGTH - 300:
|
|
528
|
+
index_param = ITEM_INDICES
|
|
529
|
+
query = add_collections_to_body(collection_ids, query)
|
|
523
530
|
|
|
524
531
|
max_result_window = MAX_LIMIT
|
|
525
532
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""library version."""
|
|
2
|
-
__version__ = "6.
|
|
2
|
+
__version__ = "6.1.0"
|
{stac_fastapi_elasticsearch-6.0.0.dist-info → stac_fastapi_elasticsearch-6.1.0.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: stac-fastapi-elasticsearch
|
|
3
|
-
Version: 6.
|
|
3
|
+
Version: 6.1.0
|
|
4
4
|
Summary: An implementation of STAC API based on the FastAPI framework with both Elasticsearch and Opensearch.
|
|
5
5
|
Home-page: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch
|
|
6
6
|
License: MIT
|
|
@@ -15,8 +15,8 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
15
15
|
Classifier: License :: OSI Approved :: MIT License
|
|
16
16
|
Requires-Python: >=3.9
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
|
-
Requires-Dist: stac-fastapi-core==6.
|
|
19
|
-
Requires-Dist: sfeos-helpers==6.
|
|
18
|
+
Requires-Dist: stac-fastapi-core==6.1.0
|
|
19
|
+
Requires-Dist: sfeos-helpers==6.1.0
|
|
20
20
|
Requires-Dist: elasticsearch[async]~=8.18.0
|
|
21
21
|
Requires-Dist: uvicorn~=0.23.0
|
|
22
22
|
Requires-Dist: starlette<0.36.0,>=0.35.0
|
|
@@ -51,7 +51,7 @@ Requires-Dist: uvicorn[standard]~=0.23.0; extra == "server"
|
|
|
51
51
|
[](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/network/members)
|
|
52
52
|
[](https://pypi.org/project/stac-fastapi-elasticsearch/)
|
|
53
53
|
[](https://github.com/radiantearth/stac-spec/tree/v1.1.0)
|
|
54
|
-
[](https://github.com/stac-utils/stac-fastapi)
|
|
55
55
|
|
|
56
56
|
## Sponsors & Supporters
|
|
57
57
|
|
|
@@ -241,28 +241,30 @@ You can customize additional settings in your `.env` file:
|
|
|
241
241
|
|------------------------------|--------------------------------------------------------------------------------------|--------------------------|---------------------------------------------------------------------------------------------|
|
|
242
242
|
| `ES_HOST` | Hostname for external Elasticsearch/OpenSearch. | `localhost` | Optional |
|
|
243
243
|
| `ES_PORT` | Port for Elasticsearch/OpenSearch. | `9200` (ES) / `9202` (OS)| Optional |
|
|
244
|
-
| `ES_USE_SSL` | Use SSL for connecting to Elasticsearch/OpenSearch. | `
|
|
245
|
-
| `ES_VERIFY_CERTS` | Verify SSL certificates when connecting. | `
|
|
244
|
+
| `ES_USE_SSL` | Use SSL for connecting to Elasticsearch/OpenSearch. | `true` | Optional |
|
|
245
|
+
| `ES_VERIFY_CERTS` | Verify SSL certificates when connecting. | `true` | Optional |
|
|
246
|
+
| `ES_API_KEY` | API Key for external Elasticsearch/OpenSearch. | N/A | Optional |
|
|
247
|
+
| `ES_TIMEOUT` | Client timeout for Elasticsearch/OpenSearch. | DB client default | Optional |
|
|
246
248
|
| `STAC_FASTAPI_TITLE` | Title of the API in the documentation. | `stac-fastapi-<backend>` | Optional |
|
|
247
249
|
| `STAC_FASTAPI_DESCRIPTION` | Description of the API in the documentation. | N/A | Optional |
|
|
248
250
|
| `STAC_FASTAPI_VERSION` | API version. | `2.1` | Optional |
|
|
249
|
-
| `STAC_FASTAPI_LANDING_PAGE_ID` | Landing page ID
|
|
251
|
+
| `STAC_FASTAPI_LANDING_PAGE_ID` | Landing page ID | `stac-fastapi` | Optional |
|
|
250
252
|
| `APP_HOST` | Server bind address. | `0.0.0.0` | Optional |
|
|
251
|
-
| `APP_PORT` | Server port. | `
|
|
253
|
+
| `APP_PORT` | Server port. | `8000` | Optional |
|
|
252
254
|
| `ENVIRONMENT` | Runtime environment. | `local` | Optional |
|
|
253
255
|
| `WEB_CONCURRENCY` | Number of worker processes. | `10` | Optional |
|
|
254
256
|
| `RELOAD` | Enable auto-reload for development. | `true` | Optional |
|
|
255
257
|
| `STAC_FASTAPI_RATE_LIMIT` | API rate limit per client. | `200/minute` | Optional |
|
|
256
|
-
| `BACKEND` | Tests-related variable | `elasticsearch` or `opensearch` based on the backend | Optional
|
|
257
|
-
| `ELASTICSEARCH_VERSION`
|
|
258
|
-
| `OPENSEARCH_VERSION` | OpenSearch version | `2.11.1` | Optional
|
|
259
|
-
| `ENABLE_DIRECT_RESPONSE`
|
|
260
|
-
| `RAISE_ON_BULK_ERROR`
|
|
261
|
-
| `DATABASE_REFRESH`
|
|
258
|
+
| `BACKEND` | Tests-related variable | `elasticsearch` or `opensearch` based on the backend | Optional |
|
|
259
|
+
| `ELASTICSEARCH_VERSION` | Version of Elasticsearch to use. | `8.11.0` | Optional |
|
|
260
|
+
| `OPENSEARCH_VERSION` | OpenSearch version | `2.11.1` | Optional |
|
|
261
|
+
| `ENABLE_DIRECT_RESPONSE` | Enable direct response for maximum performance (disables all FastAPI dependencies, including authentication, custom status codes, and validation) | `false` | Optional |
|
|
262
|
+
| `RAISE_ON_BULK_ERROR` | Controls whether bulk insert operations raise exceptions on errors. If set to `true`, the operation will stop and raise an exception when an error occurs. If set to `false`, errors will be logged, and the operation will continue. **Note:** STAC Item and ItemCollection validation errors will always raise, regardless of this flag. | `false` | Optional |
|
|
263
|
+
| `DATABASE_REFRESH` | Controls whether database operations refresh the index immediately after changes. If set to `true`, changes will be immediately searchable. If set to `false`, changes may not be immediately visible but can improve performance for bulk operations. If set to `wait_for`, changes will wait for the next refresh cycle to become visible. | `false` | Optional |
|
|
262
264
|
| `ENABLE_TRANSACTIONS_EXTENSIONS` | Enables or disables the Transactions and Bulk Transactions API extensions. If set to `false`, the POST `/collections` route and related transaction endpoints (including bulk transaction operations) will be unavailable in the API. This is useful for deployments where mutating the catalog via the API should be prevented. | `true` | Optional |
|
|
263
265
|
|
|
264
266
|
> [!NOTE]
|
|
265
|
-
> The variables `ES_HOST`, `ES_PORT`, `ES_USE_SSL`, and `
|
|
267
|
+
> The variables `ES_HOST`, `ES_PORT`, `ES_USE_SSL`, `ES_VERIFY_CERTS` and `ES_TIMEOUT` apply to both Elasticsearch and OpenSearch backends, so there is no need to rename the key names to `OS_` even if you're using OpenSearch.
|
|
266
268
|
|
|
267
269
|
## Interacting with the API
|
|
268
270
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
stac_fastapi/elasticsearch/__init__.py,sha256=w_MZutYLreNV372sCuO46bPb0TngmPs4u8737ueS0wE,31
|
|
2
|
+
stac_fastapi/elasticsearch/app.py,sha256=EK0H5qiRX-frbSHkBkZ_4Lzo0Jn8hBzJckSLCYbQlKs,5662
|
|
3
|
+
stac_fastapi/elasticsearch/config.py,sha256=itvPYr4TiOg9pWQrycgGaQxQ_Vc2KKP3aHdtH0OUZvw,5322
|
|
4
|
+
stac_fastapi/elasticsearch/database_logic.py,sha256=8P-eUGkDQAABOJWaYd_NTHpKpKug7o2c6BMDWYHH5m4,56201
|
|
5
|
+
stac_fastapi/elasticsearch/version.py,sha256=7IrY7mbr0cGVqZsk6wmCeITxZjDgz_mPHUswrziX5ME,45
|
|
6
|
+
stac_fastapi_elasticsearch-6.1.0.dist-info/METADATA,sha256=a2Z6VUi-YBORUsPZZDBJt1HuLqPeEPKtFgE2PqKEXj8,32286
|
|
7
|
+
stac_fastapi_elasticsearch-6.1.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
8
|
+
stac_fastapi_elasticsearch-6.1.0.dist-info/entry_points.txt,sha256=aCKixki0LpUl64UPsPMtiNvfdyq-QsTCxVjJ54VF6Jk,82
|
|
9
|
+
stac_fastapi_elasticsearch-6.1.0.dist-info/top_level.txt,sha256=vqn-D9-HsRPTTxy0Vk_KkDmTiMES4owwBQ3ydSZYb2s,13
|
|
10
|
+
stac_fastapi_elasticsearch-6.1.0.dist-info/RECORD,,
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
stac_fastapi/elasticsearch/__init__.py,sha256=w_MZutYLreNV372sCuO46bPb0TngmPs4u8737ueS0wE,31
|
|
2
|
-
stac_fastapi/elasticsearch/app.py,sha256=CPa_JaIA39dJ1qTYRZsCsmcmpcnjAZ2T4S0wyeUzqEg,5188
|
|
3
|
-
stac_fastapi/elasticsearch/config.py,sha256=PKSowbXmSryMj0Oq15XJduyPL2c_NlDkewXnR1DFP2o,5181
|
|
4
|
-
stac_fastapi/elasticsearch/database_logic.py,sha256=dvhYUe2baZhA4-Saww4tV89scLMHrDgK3lwas-m3U70,55930
|
|
5
|
-
stac_fastapi/elasticsearch/version.py,sha256=Fo5UFEQVxJZ3nywa3IY-enu5UQBE0X45nrQaRBe8c9o,45
|
|
6
|
-
stac_fastapi_elasticsearch-6.0.0.dist-info/METADATA,sha256=pHi-zn9w3UJAYmrCLN_mU7MCKMFGtvo8BMa4JKrhFQs,31931
|
|
7
|
-
stac_fastapi_elasticsearch-6.0.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
8
|
-
stac_fastapi_elasticsearch-6.0.0.dist-info/entry_points.txt,sha256=aCKixki0LpUl64UPsPMtiNvfdyq-QsTCxVjJ54VF6Jk,82
|
|
9
|
-
stac_fastapi_elasticsearch-6.0.0.dist-info/top_level.txt,sha256=vqn-D9-HsRPTTxy0Vk_KkDmTiMES4owwBQ3ydSZYb2s,13
|
|
10
|
-
stac_fastapi_elasticsearch-6.0.0.dist-info/RECORD,,
|
{stac_fastapi_elasticsearch-6.0.0.dist-info → stac_fastapi_elasticsearch-6.1.0.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|