fix: 增强代理密码脱敏策略并补充异常日志

- 密码脱敏阈值从 4 提升至 8,短密码全部遮蔽
- 为系统代理获取、proxy_node 解析、代理 URL 构建添加 warning 日志
This commit is contained in:
fawney19
2026-02-07 14:37:44 +08:00
parent db96c9a46e
commit 02906dad0e
2 changed files with 8 additions and 5 deletions

View File

@@ -27,10 +27,10 @@ pipeline = ApiRequestPipeline()
def _mask_password(password: str | None) -> str | None:
"""脱敏密码仅显示前2位和后2位"""
"""脱敏密码仅显示前2位和后2位(长度不足 8 时全部遮蔽)"""
if not password:
return None
if len(password) <= 4:
if len(password) < 8:
return "****"
return password[:2] + "****" + password[-2:]