taolib.testing.remote.config#

SSH 连接配置读取与脱敏。

Classes#

SshConfig

SSH 连接配置结构(与 Fabric Connection 的关键字参数兼容)。

Functions#

_clone_toml_value(→ Any)

_load_toml_table_from_path(→ dict[str, Any])

load_ssh_config(→ SshConfig)

从 TOML 读取 SSH 连接配置(返回深拷贝)。

redact_ssh_config(→ dict[str, Any])

脱敏 SSH 配置,避免输出敏感字段。

clear_ssh_config_cache(→ None)

清理配置读取缓存(用于测试或动态更新配置文件的场景)。

Module Contents#

class taolib.testing.remote.config.SshConfig#

Bases: TypedDict

SSH 连接配置结构(与 Fabric Connection 的关键字参数兼容)。

host: str#
user: str#
port: int#
connect_kwargs: dict[str, Any]#
taolib.testing.remote.config._clone_toml_value(value: Any) Any#
taolib.testing.remote.config._load_toml_table_from_path(resolved_path: str) dict[str, Any]#
taolib.testing.remote.config.load_ssh_config(config_path: str | pathlib.Path) SshConfig#

从 TOML 读取 SSH 连接配置(返回深拷贝)。

taolib.testing.remote.config.redact_ssh_config(config: SshConfig | dict[str, Any]) dict[str, Any]#

脱敏 SSH 配置,避免输出敏感字段。

taolib.testing.remote.config.clear_ssh_config_cache() None#

清理配置读取缓存(用于测试或动态更新配置文件的场景)。