Skip to content

Commit

Permalink
Merge branch 'main' into common_core
Browse files Browse the repository at this point in the history
  • Loading branch information
jonhealy1 committed Feb 3, 2024
2 parents 3c1151b + 223a927 commit d32a244
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 9 deletions.
4 changes: 0 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Added

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

### Changed

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

### Fixed

## [v1.1.0]
Expand Down
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ services:
- RELOAD=true
- ENVIRONMENT=local
- WEB_CONCURRENCY=10
- ES_HOST=172.17.0.1
- ES_HOST=opensearch
- ES_PORT=9202
- ES_USE_SSL=false
- ES_VERIFY_CERTS=false
Expand Down Expand Up @@ -74,6 +74,7 @@ services:
opensearch:
container_name: os-container
image: opensearchproject/opensearch:${OPENSEARCH_VERSION:-2.11.1}
hostname: opensearch
environment:
- discovery.type=single-node
- plugins.security.disabled=true
Expand Down
1 change: 0 additions & 1 deletion stac_fastapi/core/stac_fastapi/core/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ async def all_collections(self, **kwargs) -> Collections:
next_link = None
if len(hits) == limit:
last_hit = hits[-1]
logger.info(last_hit)
next_search_after = last_hit["sort"]
next_token = urlsafe_b64encode(
",".join(map(str, next_search_after)).encode()
Expand Down
2 changes: 1 addition & 1 deletion stac_fastapi/elasticsearch/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[metadata]
version = attr: stac_fastapi.elasticsearch.version.__version__
version = 1.1.0
2 changes: 1 addition & 1 deletion stac_fastapi/elasticsearch/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

setup(
name="stac-fastapi.elasticsearch",
description="An implementation of STAC API based on the FastAPI framework with Elasticsearch.",
description="An implementation of STAC API based on the FastAPI framework with both Elasticsearch and Opensearch.",
long_description=desc,
long_description_content_type="text/markdown",
python_requires=">=3.8",
Expand Down
9 changes: 9 additions & 0 deletions stac_fastapi/opensearch/stac_fastapi/opensearch/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ def _es_config() -> Dict[str, Any]:
if (u := os.getenv("ES_USER")) and (p := os.getenv("ES_PASS")):
config["http_auth"] = (u, p)

if api_key := os.getenv("ES_API_KEY"):
if isinstance(config["headers"], dict):
headers = {**config["headers"], "x-api-key": api_key}

else:
config["headers"] = {"x-api-key": api_key}

config["headers"] = headers

return config


Expand Down

0 comments on commit d32a244

Please sign in to comment.