Some Ring middleware
Some Ring middleware
(wrap-catchall handler)
Catches and logs exceptions.
Catches and logs exceptions.
(wrap-debug-requests handler)
Logs requests and responses with taonsso.timbre/debug
.
Logs requests and responses with `taonsso.timbre/debug`.
(wrap-mount handler state-var)
Ensures that mount.core/start
has been called.
state-var
: the var of a mount component, used for checking if mount has been
started already.
Ensures that `mount.core/start` has been called. `state-var`: the var of a mount component, used for checking if mount has been started already.
(wrap-trident-defaults handler {:keys [uid-opts state-var origins]})
Wraps handler
with a bunch of middleware.
Includes all the middleware in this namespace, plus
ring.middleware.cors/wrap-cors
,
ring.middleware.format-params/wrap-clojure-params
and
ring.middleware.defaults/wrap-defaults
(with api-defaults
).
uid-opts
: see wrap-uid
state-var
: see wrap-mount
origins
: passed to wrap-cors
for :access-control-allow-origin
Wraps `handler` with a bunch of middleware. Includes all the middleware in this namespace, plus `ring.middleware.cors/wrap-cors`, `ring.middleware.format-params/wrap-clojure-params` and `ring.middleware.defaults/wrap-defaults` (with `api-defaults`). - `uid-opts`: see [[wrap-uid]] - `state-var`: see [[wrap-mount]] - `origins`: passed to `wrap-cors` for `:access-control-allow-origin`
(wrap-uid handler {:keys [verify-token uid-key] :or {uid-key "user_id"}})
Authenticates the request, or gives a 401 response.
Takes the value of the Authorization header and passes it to verify-token
,
which should return a map of claims (e.g. {"user_id": "foo", "email": "alice@example.com"}
).
The following keys will be added to the request: :claims
(the return value
of verify-token
) and :uid
((get claims uid-key)
, for convenience).
Authenticates the request, or gives a 401 response. Takes the value of the Authorization header and passes it to `verify-token`, which should return a map of claims (e.g. `{"user_id": "foo", "email": "alice@example.com"}`). The following keys will be added to the request: `:claims` (the return value of `verify-token`) and `:uid` (`(get claims uid-key)`, for convenience).
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close