diff --git a/CHANGELOG.md b/CHANGELOG.md index 62f8531a..9cbb2160 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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] diff --git a/VERSION b/VERSION deleted file mode 100644 index afaf360d..00000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.0.0 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 7db5312a..9d665bce 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 @@ -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 diff --git a/stac_fastapi/core/stac_fastapi/core/core.py b/stac_fastapi/core/stac_fastapi/core/core.py index 643779b3..5a6dd291 100644 --- a/stac_fastapi/core/stac_fastapi/core/core.py +++ b/stac_fastapi/core/stac_fastapi/core/core.py @@ -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() diff --git a/stac_fastapi/elasticsearch/setup.cfg b/stac_fastapi/elasticsearch/setup.cfg index 7a42432c..ad4714c2 100644 --- a/stac_fastapi/elasticsearch/setup.cfg +++ b/stac_fastapi/elasticsearch/setup.cfg @@ -1,2 +1,2 @@ [metadata] -version = attr: stac_fastapi.elasticsearch.version.__version__ +version = 1.1.0 diff --git a/stac_fastapi/elasticsearch/setup.py b/stac_fastapi/elasticsearch/setup.py index 3106c512..f2de8fa3 100644 --- a/stac_fastapi/elasticsearch/setup.py +++ b/stac_fastapi/elasticsearch/setup.py @@ -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", diff --git a/stac_fastapi/opensearch/stac_fastapi/opensearch/config.py b/stac_fastapi/opensearch/stac_fastapi/opensearch/config.py index db08301f..a53859fa 100644 --- a/stac_fastapi/opensearch/stac_fastapi/opensearch/config.py +++ b/stac_fastapi/opensearch/stac_fastapi/opensearch/config.py @@ -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