Expand description
Compile Shield config into runtime matchers, limiters, and rules.
Structs§
- Compiled
Profile - A compiled limit tier: the GCRA shaper, the per-window count reported in the
RateLimit-Limitheader, and the window itself (the fleet-gate epoch length). - Compiled
Rule - A compiled rate-limit rule.
Enums§
- KeySource
- How a rule derives its limit key.
- Phase
- Whether a rule can be decided before auth runs, or needs validated claims.
Functions§
- compile_
profile - Compile a single limit profile from its config.
- compile_
profiles - Compile every named profile.
- compile_
rules - Compile rules, validating that any pinned
profilenames an existing tier. Each rule’s phase is derived from its key: ajwt_claimkey needs validated claims and runs after auth; every other key runs before auth. - short_
hash - A short, stable, non-reversible hash (128-bit hex) of
input. Used both to fingerprint rules and to de-identify key values before they reach the shared store, and deterministic across instances so reconciliation keys agree.