pub struct AuthState {
pub key_store: Arc<KeyStore>,
pub counters: Arc<RuntimeCounters>,
}Expand description
REST auth middleware 的组合 state:KeyStore(谁能进)+ RuntimeCounters(限额)
从 v1.0 起 middleware 除了 scope 检查还会在 trade:real 请求上跑一次
check_and_commit —— CheckCtx 里 market/symbol/side/value 全空,只挂
rate limit + 时段窗口两个全局闸门。精细化检查(daily / per_order /
side / 具体 market)留给下游 handler。
Fields§
§key_store: Arc<KeyStore>§counters: Arc<RuntimeCounters>Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AuthState
impl !RefUnwindSafe for AuthState
impl Send for AuthState
impl Sync for AuthState
impl Unpin for AuthState
impl !UnwindSafe for AuthState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more