Expand description
Bounded sliding-window throttles for authentication attempts.
Pure state plus an injected clock, so tests drive the time axis instead of
sleeping. Deliberately in-process: a shared backend belongs behind
Bucket’s interface, not woven through its callers, and until one exists
the effective limit is replicas × limit — which is why the surfaces using
this run single-replica.
Structs§
- Bucket
- A sliding-window counter per key, holding at most
Limits::capacitykeys. - Limits
- Throttle shape: how many attempts, over what window, across how many keys.
- System
Clock - Delegates to
Instant::now.
Enums§
Traits§
- Clock
- “What time is it now”, injected so tests need not sleep.