Skip to main content

get_acc_list

Function get_acc_list 

Source
pub async fn get_acc_list(
    __arg0: State<RestState>,
    rec: Option<Extension<Arc<KeyRecord>>>,
) -> Result<Json<Value>, (StatusCode, Json<Value>)>
Expand description

GET /api/accounts — 获取交易账户列表.

v1.4.103 codex F6 (P2): 受限 key (allowed_acc_ids 非空) 调用此 endpoint 时, daemon 按 allowed_acc_ids filter 返回的 acc_list — 之前不 filter, 受限 key 仍能看到全部账户的 acc_id 列表 (信息泄漏, 跨租户 discovery).

v1.4.104 阶段 7-1: 删 35 LoC inline JSON-level filter, 改走 adapter 的 proto_request_with_filterFilterRegistry::apply (proto-bytes-level). 跟 gRPC server.rs / WS ws_listener.rs 同源 (cross-surface 单一注册表).

codex 0522 F2 v1.4.106: 改走 proto_request_with_ctx 接完整 CallerContext (含 key_id + allowed_acc_ids), 单一来源: (1) IncomingRequest.caller_allowed_acc_ids defense-in-depth (2) IncomingRequest.caller_key_id per-key 审计 / cleanup (3) FilterRegistry::apply 响应 acc_list 过滤 之前手写 .and_then(|r| r.allowed_acc_ids.as_ref()).filter(non-empty) 容易让 REST 自己定义一套 empty-set 语义;现在走 CallerContext::from_key_record 自动对齐核心 futu-auth::Limits contract: None / empty = 无限制,deny-all 使用 sentinel {0}