Liking cljdoc? Tell your friends :D

trident.ring

Some Ring middleware

Some Ring middleware
raw docstring

wrap-catchallclj

(wrap-catchall handler)

Catches and logs exceptions.

Catches and logs exceptions.
sourceraw docstring

wrap-debug-requestsclj

(wrap-debug-requests handler)

Logs requests and responses with taonsso.timbre/debug.

Logs requests and responses with `taonsso.timbre/debug`.
sourceraw docstring

wrap-mountclj

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

wrap-trident-defaultsclj

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

wrap-uidclj

(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).
sourceraw docstring

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

× close