Skip to main content

Module commconfig

Module commconfig 

Source
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§

CommonConfigSnapshot
CommConfig 协议返回的完整快照(含过期时间)。
ForcedIpEntry

Enums§

CommConfigBootstrapOutcome
CommConfigPersistence
CommConfigSource
CommConfigStoreError

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.protoCONN_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§

AuthGuaranteedDomainMap
解析后的 auth_guaranteed_domain_list —— 原始鉴权域名 → 兜底域名。
ForcedIpMap
解析后的 forced_ip_for_conn —— identity → (ip, port, expire_ts)。
GuaranteedBrokerIpMap
解析后的 Broker 部分 guaranteed_ip_for_conn —— broker_id → IP 列表。 key 是 FTConnCmn.proto ConnIdentity 里的 CONN_BROKER_FUTU_* 值 (1001=HK / 1007=US / 1008=SG / 1009=AU / 1012=JP / 1017=MY / 1019=CA)。
GuaranteedIpMap
解析后的 Platform 部分 guaranteed_ip_for_conn —— attribution → IP 列表。
GuaranteedWebIpMap
解析后的 WebTCP-short 部分 guaranteed_ip_for_conn —— web conn_identity → IP 列表。 key 是 FTConnCmn.proto CONN_WEB_* 的 10100..10107。
SharedCommConfig