Skip to content

Commit 529a482

Browse files
committed
use api base settings
1 parent ceae491 commit 529a482

File tree

2 files changed

+6
-4
lines changed
  • stac_fastapi
    • elasticsearch/stac_fastapi/elasticsearch
    • opensearch/stac_fastapi/opensearch

2 files changed

+6
-4
lines changed

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/config.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import certifi
88

99
from elasticsearch import AsyncElasticsearch, Elasticsearch # type: ignore
10+
from stac_fastapi.core.base_settings import ApiBaseSettings
1011
from stac_fastapi.types.config import ApiSettings
1112

1213

@@ -69,7 +70,7 @@ def _es_config() -> Dict[str, Any]:
6970
_forbidden_fields: Set[str] = {"type"}
7071

7172

72-
class ElasticsearchSettings(ApiSettings):
73+
class ElasticsearchSettings(ApiSettings, ApiBaseSettings):
7374
"""API settings."""
7475

7576
# Fields which are defined by STAC but not included in the database model
@@ -82,7 +83,7 @@ def create_client(self):
8283
return Elasticsearch(**_es_config())
8384

8485

85-
class AsyncElasticsearchSettings(ApiSettings):
86+
class AsyncElasticsearchSettings(ApiSettings, ApiBaseSettings):
8687
"""API settings."""
8788

8889
# Fields which are defined by STAC but not included in the database model

stac_fastapi/opensearch/stac_fastapi/opensearch/config.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import certifi
77
from opensearchpy import AsyncOpenSearch, OpenSearch
88

9+
from stac_fastapi.core.base_settings import ApiBaseSettings
910
from stac_fastapi.types.config import ApiSettings
1011

1112

@@ -67,7 +68,7 @@ def _es_config() -> Dict[str, Any]:
6768
_forbidden_fields: Set[str] = {"type"}
6869

6970

70-
class OpensearchSettings(ApiSettings):
71+
class OpensearchSettings(ApiSettings, ApiBaseSettings):
7172
"""API settings."""
7273

7374
# Fields which are defined by STAC but not included in the database model
@@ -80,7 +81,7 @@ def create_client(self):
8081
return OpenSearch(**_es_config())
8182

8283

83-
class AsyncOpensearchSettings(ApiSettings):
84+
class AsyncOpensearchSettings(ApiSettings, ApiBaseSettings):
8485
"""API settings."""
8586

8687
# Fields which are defined by STAC but not included in the database model

0 commit comments

Comments
 (0)