(->ctx x k)
Make it easy to thread data into liberator context
Make it easy to thread data into liberator context
(assoc-user ctx user-key)
(auth-id {:keys [auth-id-key] :as ctx})
Retrieve the ID of authenticated user. Assumes :auth-id-key
is in
the ctx
Retrieve the ID of authenticated user. Assumes `:auth-id-key` is in the ctx
(auth-with & fns)
If any auth function authenticates the context, return true. Used to e.g. auth by ownership or adminship
If any auth function authenticates the context, return true. Used to e.g. auth by ownership or adminship
(authenticated? ctx)
To use with liberator's :authorized? decision
To use with liberator's :authorized? decision
A 'base' set of liberator resource decisions for list, create, show, update, and delete
A 'base' set of liberator resource decisions for list, create, show, update, and delete
(endpoint route decisions & [initial-context])
(error-response status errors)
For cases where the error happens before the request gets to liberator
For cases where the error happens before the request gets to liberator
(errors-map errors)
Add errors to context, setting media-type in case liberator doesn't get to that decision
Add errors to context, setting media-type in case liberator doesn't get to that decision
(exists-fn ent-fn)
Given a function to retrieve a record, store it under :record
in the
context if it exists
Given a function to retrieve a record, store it under `:record` in the context if it exists
(get-ctx path)
(html-resource path)
Serve resource at path
as html
Serve resource at `path` as html
(initialize-decisions decisions context-initializer)
A function that takes a path and decision spec and produces compojure endpoint
A function that takes a path and decision spec and produces compojure endpoint
(transit-response payload & [opts])
(validator validation)
(validator ctx-sym validation)
Used in invalid? which is why truth values are reversed
Used in invalid? which is why truth values are reversed
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close