(allow-anonymous ctx)
Allow unless there is a JWToken provided and it's invalid.
Allow unless there is a JWToken provided and it's invalid.
(allow-authenticated ctx)
Allow only if a valid JWToken is provided.
Allow only if a valid JWToken is provided.
(allow-id-token ctx)
Allow options request. Allow jwtoken. Allow id token. Allow anonymous.
Allow options request. Allow jwtoken. Allow id token. Allow anonymous.
(authenticated? ctx)
Return true if the request contains a valid JWToken
Return true if the request contains a valid JWToken
(error-response error status)
(error-response error status headers)
Helper to format a JSON ring response with an error.
Helper to format a JSON ring response with an error.
(get-token headers)
Read supplied JWToken from the Authorization in the request headers.
Return nil if no JWToken provided.
Read supplied JWToken from the Authorization in the request headers. Return nil if no JWToken provided.
Helper to format a generic JSON body ring response
Helper to format a generic JSON body ring response
(location-response location body media-type)
(location-response location body status media-type)
(malformed-json? ctx)
(malformed-json? ctx allow-nil?)
Read in the body param from the request as a string, parse it into JSON, make sure all the keys are keywords, and then return it, mapped to :data as the 2nd value in a vector, with the first value indicating it's not malformed. Otherwise just indicate it's malformed.
Read in the body param from the request as a string, parse it into JSON, make sure all the keys are keywords, and then return it, mapped to :data as the 2nd value in a vector, with the first value indicating it's not malformed. Otherwise just indicate it's malformed.
(read-token headers passphrase)
Read supplied JWToken from the request headers.
If a valid token is supplied return a map containing :jwtoken and associated :user. If invalid token is supplied return a map containing :jwtoken and false. If no Authorization headers are supplied return nil.
Read supplied JWToken from the request headers. If a valid token is supplied return a map containing :jwtoken and associated :user. If invalid token is supplied return a map containing :jwtoken and false. If no Authorization headers are supplied return nil.
(rep v)
Add ^:replace meta to the value to avoid Liberator deep merge/concat it's value.
Add ^:replace meta to the value to avoid Liberator deep merge/concat it's value.
(text-response body status)
(text-response body status headers)
Helper to format a text ring response
Helper to format a text ring response
(wrap-500 handler)
Ring middleware to ensure that in the case of a 500 error response or an exception, we don't leak error details in the body of the response.
Ring middleware to ensure that in the case of a 500 error response or an exception, we don't leak error details in the body of the response.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close