Skip to main content

Module trade_pwd

Module trade_pwd 

Source
Expand description

交易密码来源封装

优先级(对 LLM 透明,它只会调 futu_unlock_trade 工具,密码永不入 prompt):

  1. 环境变量 FUTU_TRADE_PWD(显式运行时 override)
  2. 账号级 OS credential store(macOS 发布包仅兼容读取旧条目)
  3. legacy 全局 credential store —— v1.4.109 前的 trade-password 兜底读取
  4. 都没有 → 报错

MD5 在 server 端计算后再发网关。LLM 从来看不到明文 / MD5。所有 credential-store 操作由 futu-auth 的 single-flight / circuit-breaker owner 执行。

Functions§

get_trade_password_for_account
试着拿到交易密码明文。成功则返回 Ok(pwd);任何来源都没找到返回 Err
get_trade_password_md5_for_account
把密码 MD5 化再返回(unlock_trade RPC 要的格式)
keyring_platform_detail 🔒
keyring_read_error 🔒
md5_hex 🔒
missing_trade_password_message 🔒
non_empty_trimmed 🔒
read_keyring_password 🔒
trade_password_from_sources 🔒
trade_pwd_account_from 🔒