taolib.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.remote.config.SshConfig[源代码]#

Bases: TypedDict

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

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

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

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

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

taolib.remote.config.clear_ssh_config_cache() None[源代码]#

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