Liking cljdoc? Tell your friends :D

ring.middleware.turnstile


AnyMapclj

raw docstring

compute-limitsclj

(compute-limits limit-fns request ctx)

Inputs: [limit-fns :- [LimitFunction] request :- HttpRequest ctx] Returns: [Limit]

Inputs: [limit-fns :- [LimitFunction] request :- HttpRequest ctx]
Returns: [Limit]
raw docstring

default-rate-limit-handlerclj

(default-rate-limit-handler request next-slot-in-sec limit)

first-reached-limitclj

(first-reached-limit limits)

Inputs: [limits :- [Limit]] Returns: (s/maybe Limit)

Inputs: [limits :- [Limit]]
Returns: (s/maybe Limit)
raw docstring

header-limitclj

(header-limit n header name-in-headers)

Inputs: [n header name-in-headers] Returns: LimitFunction

Inputs: [n header name-in-headers]
Returns: LimitFunction
raw docstring

HttpRequestclj


HttpResponseclj


ip-limitclj

(ip-limit n)

Inputs: [n]

Inputs: [n]
raw docstring

LimitFunctionclj

raw docstring

make-tokenclj

(make-token)

next-slot-in-secclj

(next-slot-in-sec next-slot-in-ms)

rate-limit-headersclj

(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]
raw docstring

rate-limited?clj

(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
raw docstring

RedisConnclj

raw docstring

RedisSpecclj

raw docstring

turnstile-expiration-msclj


with-turnstileclj

(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
raw docstring

wrap-rate-limitclj

(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
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close