(compute-limits limit-fns request ctx)
Inputs: [limit-fns :- [LimitFunction] request :- HttpRequest ctx] Returns: [Limit]
Inputs: [limit-fns :- [LimitFunction] request :- HttpRequest ctx] Returns: [Limit]
(default-rate-limit-handler request next-slot-in-sec limit)
(first-reached-limit limits)
Inputs: [limits :- [Limit]] Returns: (s/maybe Limit)
Inputs: [limits :- [Limit]] Returns: (s/maybe Limit)
(header-limit n header name-in-headers)
Inputs: [n header name-in-headers] Returns: LimitFunction
Inputs: [n header name-in-headers] Returns: LimitFunction
(make-token)
(next-slot-in-sec next-slot-in-ms)
(rate-limit-headers {:keys [turnstile nb-request-per-hour name-in-headers]}
remaining-header-enabled)
Inputs: [{:keys [turnstile nb-request-per-hour name-in-headers]} :- Limit remaining-header-enabled :- s/Bool]
Inputs: [{:keys [turnstile nb-request-per-hour name-in-headers]} :- Limit remaining-header-enabled :- s/Bool]
(rate-limited? {:keys [turnstile nb-request-per-hour]})
Inputs: [{:keys [turnstile nb-request-per-hour]} :- Limit] Returns: s/Bool
Inputs: [{:keys [turnstile nb-request-per-hour]} :- Limit] Returns: s/Bool
(with-turnstile {:keys [rate-limit-key] :as limit}
{:keys [redis-conn key-prefix] :as ctx})
Inputs: [{:keys [rate-limit-key], :as limit} :- Limit {:keys [redis-conn key-prefix], :as ctx}] Returns: Limit
Inputs: [{:keys [rate-limit-key], :as limit} :- Limit {:keys [redis-conn key-prefix], :as ctx}] Returns: Limit
(wrap-rate-limit handler
{:keys [redis-conn limit-fns rate-limit-handler key-prefix
remaining-header-enabled]
:or {rate-limit-handler default-rate-limit-handler
key-prefix ""
remaining-header-enabled false}
:as conf})
Middleware for the turnstile rate limiting service
Middleware for the turnstile rate limiting service
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close