Liking cljdoc? Tell your friends :D

ring.middleware.turnstile


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]
sourceraw docstring

default-rate-limit-handlerclj

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

first-reached-limitclj

(first-reached-limit limits)

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

Inputs: [limits :- [Limit]]
Returns: (s/maybe Limit)
sourceraw 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
sourceraw docstring

HttpRequestclj

source

HttpResponseclj

source

ip-limitclj

(ip-limit n)

Inputs: [n]

Inputs: [n]
sourceraw docstring

LimitFunctionclj

sourceraw docstring

make-tokenclj

(make-token)
source

next-slot-in-secclj

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

rate-limit-headersclj

(rate-limit-headers {:keys [turnstile nb-request-per-hour name-in-headers]})

Inputs: [{:keys [turnstile nb-request-per-hour name-in-headers]} :- Limit]

Inputs: [{:keys [turnstile nb-request-per-hour name-in-headers]} :- Limit]
sourceraw 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
sourceraw docstring

turnstile-expiration-msclj

source

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
sourceraw docstring

wrap-rate-limitclj

(wrap-rate-limit handler
                 {:keys [redis-conn limit-fns rate-limit-handler key-prefix]
                  :or {rate-limit-handler default-rate-limit-handler
                       key-prefix ""}
                  :as conf})

Middleware for the turnstile rate limiting service

Middleware for the turnstile rate limiting service
sourceraw docstring

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

× close