Includes:
record
, errrors
, params
)Introduces loose convention of putting a record under :record
in
the context
Extends liberator's representations to handle transit
Includes: * Utility functions for retrieving common values from the context (`record`, `errrors`, `params`) * A template of decision defaults appropriate for an SPA * Utility functions for auth Introduces loose convention of putting a record under `:record` in the context Extends liberator's representations to handle transit
(->ctx x k)
Make it easy to thread data into liberator context
Make it easy to thread data into liberator context
(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
A base set of liberator resource decisions
(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
(html-resource path)
Serve resource at path
as html
Serve resource at `path` as html
(initialize-decisions decisions context-initializer)
Adds :initalize
to multiple decisions. Used by
sweet-tooth.endpoint.module.liberator-reitit-router
to inject
context values set in routes.
Adds `:initalize` to multiple decisions. Used by `sweet-tooth.endpoint.module.liberator-reitit-router` to inject context values set in routes.
(validate-describe rules & [describe-context])
Use describe lib to validate a request. Returns a function that's
meant to be used with the :malformed?
liberator decision
Use describe lib to validate a request. Returns a function that's meant to be used with the `:malformed?` liberator decision
(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