Skip to content

Commit 203b88b

Browse files
committed
Adding API key option to ES config.
1 parent 86a72e7 commit 203b88b

File tree

1 file changed

+3
-0
lines changed
  • stac_fastapi/elasticsearch/stac_fastapi/elasticsearch

1 file changed

+3
-0
lines changed

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/config.py

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

42+
if api_key := os.getenv("ES_API_KEY"):
43+
config["headers"]["x-api-key"] = api_key
44+
4245
return config
4346

4447

0 commit comments

Comments
 (0)