Crate futu_auth

Crate futu_auth 

Source
Expand description

FutuOpenD-rs 授权子系统

提供 API Key + Scope + 限额 三层鉴权:

  • scope — 能力分组枚举
  • key — 单条 key 记录 + SHA-256 校验
  • store — keys.json 加载 / 原子热替换 / 明文验证
  • limits — 日累计 / 单笔上限 / 市场 / 品种白名单 / 时间窗口

Re-exports§

pub use key::hash_plaintext;
pub use key::KeyRecord;
pub use limits::CheckCtx;
pub use limits::LimitOutcome;
pub use limits::Limits;
pub use limits::RuntimeCounters;
pub use machine::fingerprint_for;
pub use machine::fingerprint_from_raw;
pub use machine::raw_machine_id;
pub use machine::MachineError;
pub use metrics::Registry as MetricsRegistry;
pub use scope::scope_for_proto_id;
pub use scope::Scope;
pub use scope::ScopeParseError;
pub use store::KeyStore;
pub use store::KeyStoreError;

Modules§

audit
审计事件发射 helpers + JSONL 订阅层
key
KeyRecord: 单条 API Key 的配置 + SHA-256 校验
limits
限额:单笔、日累计、市场/品种白名单、时间窗口
machine
软机器绑定(soft machine binding)
metrics
全局 metrics registry —— 供 /metrics Prometheus 端点消费
scope
Scope: 能力分组
store
KeyStore: keys.json 加载 + 热替换 + 明文验证