Skip to main content

Module shield

Module shield 

Source
Expand description

Shield: request rate limiting.

Enforces the shield config as an axum middleware. Two rule kinds are supported: endpoint classes (glob path → per-client limit) and per identifier endpoints (limit by a value read from the request body). The counter backend is pluggable via RateLimitStore; the default is an in-process store, with an optional Redis store for multi-instance setups.

Modules§

matcher
Compile Shield config patterns into runtime path matchers.
rate
Rate-limit rate parsing.
store
Rate-limit counter storage.

Structs§

Shield
Compiled Shield rules plus the counter store.

Functions§

middleware
Axum middleware enforcing the compiled Shield rules.