SyntropyWeb.Plugs.RateLimiter
(syntropy v0.2.0)
Copy Markdown
Applies Syntropy.RateLimiter to API pipelines.
Each pipeline declares its class (plug SyntropyWeb.Plugs.RateLimiter, class: :read). Requests are keyed by the bearer token (hashed — the
plaintext never becomes a bucket key) or, absent one, by the peer IP.
Exhausted buckets answer 429 with a retry-after header.
Summary
Functions
@spec call(Plug.Conn.t(), Syntropy.RateLimiter.class()) :: Plug.Conn.t()
@spec init(keyword()) :: Syntropy.RateLimiter.class()