From f181d9cccec3932fb55172ea3a552bcff068b852 Mon Sep 17 00:00:00 2001 From: Pavel Mackarichev Date: Mon, 11 Sep 2023 16:35:18 +0300 Subject: [PATCH] feat(es): log confing only in debug mode --- odd_collector/adapters/elasticsearch/adapter.py | 4 ++-- odd_collector/domain/plugin.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/odd_collector/adapters/elasticsearch/adapter.py b/odd_collector/adapters/elasticsearch/adapter.py index 8cda7303..9db2b358 100644 --- a/odd_collector/adapters/elasticsearch/adapter.py +++ b/odd_collector/adapters/elasticsearch/adapter.py @@ -19,7 +19,7 @@ class Adapter(AbstractAdapter): def __init__(self, config: ElasticsearchPlugin) -> None: self.__es_client = Elasticsearch( hosts=[f"{config.host}:{config.port}"], - basic_auth=(config.username, config.password), + basic_auth=(config.username, config.password.get_secret_value()), verify_certs=config.verify_certs, ca_certs=config.ca_certs, ) @@ -37,7 +37,7 @@ def get_data_source_oddrn(self) -> str: return self.__oddrn_generator.get_data_source_oddrn() def get_datasets(self) -> Iterable[DataEntity]: - logger.info(f"Start collecting datasets from Elasticsearch at {self.config}") + logger.debug(f"Start collecting datasets from Elasticsearch at {self.config}") result = [] logger.info("Get indices") indices = self.__get_indices() diff --git a/odd_collector/domain/plugin.py b/odd_collector/domain/plugin.py index b0feb447..f114dc39 100644 --- a/odd_collector/domain/plugin.py +++ b/odd_collector/domain/plugin.py @@ -124,7 +124,7 @@ class ElasticsearchPlugin(WithHost): host: str port: str username: str - password: str + password: SecretStr verify_certs: Optional[bool] = None ca_certs: Optional[str] = None