Expand description
CommConfig transaction actor and atomically published last-good snapshot.
C++ PullCommonConfigV2() 对齐:动态拉取后台 IP 池 + 配置, 比 DNS / 硬编码
更权威 (guaranteed_ip_for_conn 按 ConnIdentity 分组).
Network IO, page action policy, raw transaction accumulation, typed projection, persistence, and publication stay in separate modules so a partial transaction can never escape as a runtime snapshot.
Parent auth/mod.rs pub mod commconfig; 路径不变 (mod.rs re-export 全 pub 项).
Structs§
- Common
Config Snapshot - CommConfig 协议返回的完整快照(含过期时间)。
- Forced
IpEntry
Enums§
Constants§
- COMMCONFIG_
PRE_ LOGIN_ TIMEOUT - C++ login waits up to 30 seconds for pre-login CommonConfig and allows login to continue when that request cannot be replayed.
- CONN_
WEB_ AU - CONN_
WEB_ CA - CONN_
WEB_ CN - CONN_
WEB_ HK - CONN_
WEB_ JP - CONN_
WEB_ MY - CONN_
WEB_ SG - CONN_
WEB_ US
Functions§
- api_
root_ for_ client - bootstrap_
before_ login - broker_
auth_ webtcp_ identity - broker_auth 的 WebTCP-short identity 归一入口。
- client_
version_ dotted nClientVer = 1031->"10.31.0", matching the C++ formatting.- common_
http_ auth_ token - Build the shared Futu common HTTP
auth_token. - common_
http_ client_ token - Build the C++ common HTTP
client_token. - default_
webtcp_ identity_ for_ client_ type - C++
WebRequestManager::UpdateCommConfig()的 WebTCP identity 兜底规则: 服务端未下发有效web_tcp_config.web_conn_identity时,moomoo app type 默认CONN_WEB_US,其它(Futu OpenD/Futu HK)默认CONN_WEB_HK。 - empty_
snapshot - Empty startup snapshot used only when no valid persisted last-good exists.
- forced_
ip_ for_ attribution - gen_
totp_ sha1 - 生成 6 位 TOTP auth_token。对齐 C++
GenGoogleOTPCode_SHA1(OMBase_API_OTP.cpp:12): - ips_
for_ attribution - 从 snapshot 取某 attribution 对应的 IP 池(去拷贝成
Vec<(String, u16)>)。 如果没有则返回空。调用者可以把返回值 merge 到硬编码池最前面。 - ips_
for_ broker - 从 snapshot 取 broker_id 对应的 broker 专用 IP 池。
- ips_
for_ web_ identity - 从 snapshot 取 WebTCP-short identity 对应的 IP 池。
- is_
web_ identity - 对齐 C++
FTConnCmn.proto的CONN_WEB_*identity。 - load_
last_ good_ snapshot - new_
shared_ snapshot - server_
now_ ts - CommConfig timestamps use the same server-time basis as C++
INNBiz_SvrTime::GetSvrTimeStamp(), not the daemon host clock alone. - spawn_
actor - webtcp_
addrs_ for_ identity - broker_auth WebTCP-short 的连接候选池:commconfig 优先,空时落到 C++ hardcoded WebTCP 池。调用方不应自己拼 DNS 域名作为主路径。
- webtcp_
hardcoded_ addrs - C++
LoadHardcodeAddress()里 WebTCP-short identity 的本地保底池。
Type Aliases§
- Auth
Guaranteed Domain Map - 解析后的
auth_guaranteed_domain_list—— 原始鉴权域名 → 兜底域名。 - Forced
IpMap - 解析后的
forced_ip_for_conn—— identity → (ip, port, expire_ts)。 - Guaranteed
Broker IpMap - 解析后的 Broker 部分
guaranteed_ip_for_conn—— broker_id → IP 列表。 key 是FTConnCmn.protoConnIdentity里的CONN_BROKER_FUTU_*值 (1001=HK / 1007=US / 1008=SG / 1009=AU / 1012=JP / 1017=MY / 1019=CA)。 - Guaranteed
IpMap - 解析后的 Platform 部分
guaranteed_ip_for_conn—— attribution → IP 列表。 - Guaranteed
WebIp Map - 解析后的 WebTCP-short 部分
guaranteed_ip_for_conn—— web conn_identity → IP 列表。 key 是FTConnCmn.protoCONN_WEB_*的 10100..10107。 - Shared
Comm Config