SyntropyWeb.Plugs.RateLimiter (syntropy v0.3.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

call(conn, class)

init(opts)

@spec init(keyword()) :: Syntropy.RateLimiter.class()