You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by cr...@apache.org on 2026/09/07 08:42:57 UTC
(iotdb-mcp-server) branch redact-password-in-config-log created (now 3ff1cbd)
This is an automated email from the ASF dual-hosted git repository.
CritasWang pushed a change to branch redact-password-in-config-log
in repository https://gitbox.apache.org/repos/asf/iotdb-mcp-server.git
at 3ff1cbd Mask password in startup config log output
This branch includes the following new commits:
new 3ff1cbd Mask password in startup config log output
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(iotdb-mcp-server) 01/01: Mask password in startup config log output
Posted by cr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
CritasWang pushed a commit to branch redact-password-in-config-log
in repository https://gitbox.apache.org/repos/asf/iotdb-mcp-server.git
commit 3ff1cbd58e8a1fb2fded0c8be08b9338cbf7cc8e
Author: CritasWang <cr...@outlook.com>
AuthorDate: Mon Sep 7 16:42:40 2026 +0800
Mask password in startup config log output
The startup log printed the full IoTDB config dict including the password field. Log a copy of the config with the password masked instead, and exclude the password from the Config repr.
---
src/iotdb_mcp_server/config.py | 4 ++--
src/iotdb_mcp_server/server.py | 4 +++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/iotdb_mcp_server/config.py b/src/iotdb_mcp_server/config.py
index a646891..7e4ad78 100644
--- a/src/iotdb_mcp_server/config.py
+++ b/src/iotdb_mcp_server/config.py
@@ -17,7 +17,7 @@
#
import argparse
-from dataclasses import dataclass
+from dataclasses import dataclass, field
import os
@@ -42,7 +42,7 @@ class Config:
IoTDB username
"""
- password: str
+ password: str = field(repr=False)
"""
IoTDB password
"""
diff --git a/src/iotdb_mcp_server/server.py b/src/iotdb_mcp_server/server.py
index 997a760..489687e 100644
--- a/src/iotdb_mcp_server/server.py
+++ b/src/iotdb_mcp_server/server.py
@@ -63,7 +63,9 @@ db_config = {
max_pool_size = 100 # Increased from 100 for better concurrency
-logger.info(f"IoTDB Config: {db_config}")
+# Never print credentials: log a copy of the config with the password masked.
+logged_config = {**db_config, "password": "***"}
+logger.info(f"IoTDB Config: {logged_config}")
# Ensure export directory exists
if not os.path.exists(config.export_path):