Skip to content

Commit d32a244

Browse files
committed
Merge branch 'main' into common_core
2 parents 3c1151b + 223a927 commit d32a244

File tree

7 files changed

+13
-9
lines changed

7 files changed

+13
-9
lines changed

CHANGELOG.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
99

1010
### Added
1111

12-
- Added core library package for common logic [#186]https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/186
13-
1412
### Changed
1513

16-
- Moved Elasticsearch and Opensearch backends into separate packages [#186]https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/186
17-
1814
### Fixed
1915

2016
## [v1.1.0]

VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ services:
4343
- RELOAD=true
4444
- ENVIRONMENT=local
4545
- WEB_CONCURRENCY=10
46-
- ES_HOST=172.17.0.1
46+
- ES_HOST=opensearch
4747
- ES_PORT=9202
4848
- ES_USE_SSL=false
4949
- ES_VERIFY_CERTS=false
@@ -74,6 +74,7 @@ services:
7474
opensearch:
7575
container_name: os-container
7676
image: opensearchproject/opensearch:${OPENSEARCH_VERSION:-2.11.1}
77+
hostname: opensearch
7778
environment:
7879
- discovery.type=single-node
7980
- plugins.security.disabled=true

stac_fastapi/core/stac_fastapi/core/core.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ async def all_collections(self, **kwargs) -> Collections:
218218
next_link = None
219219
if len(hits) == limit:
220220
last_hit = hits[-1]
221-
logger.info(last_hit)
222221
next_search_after = last_hit["sort"]
223222
next_token = urlsafe_b64encode(
224223
",".join(map(str, next_search_after)).encode()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[metadata]
2-
version = attr: stac_fastapi.elasticsearch.version.__version__
2+
version = 1.1.0

stac_fastapi/elasticsearch/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
setup(
4242
name="stac-fastapi.elasticsearch",
43-
description="An implementation of STAC API based on the FastAPI framework with Elasticsearch.",
43+
description="An implementation of STAC API based on the FastAPI framework with both Elasticsearch and Opensearch.",
4444
long_description=desc,
4545
long_description_content_type="text/markdown",
4646
python_requires=">=3.8",

stac_fastapi/opensearch/stac_fastapi/opensearch/config.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ def _es_config() -> Dict[str, Any]:
4040
if (u := os.getenv("ES_USER")) and (p := os.getenv("ES_PASS")):
4141
config["http_auth"] = (u, p)
4242

43+
if api_key := os.getenv("ES_API_KEY"):
44+
if isinstance(config["headers"], dict):
45+
headers = {**config["headers"], "x-api-key": api_key}
46+
47+
else:
48+
config["headers"] = {"x-api-key": api_key}
49+
50+
config["headers"] = headers
51+
4352
return config
4453

4554

0 commit comments

Comments
 (0)