(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.
(json-response body status)
(json-response body status headers :guard map?)
(json-response body status mime-type :guard string?)
(json-response body
:guard
(fn* [p1__42571#]
(or (map? p1__42571#) (sequential? p1__42571#)))
status
mime-type
headers)
(json-response body
:guard
string?
status
:guard
integer?
mime-type
:guard
string?
headers
:guard
map?)
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.
(only-accept status media-types :guard sequential?)
(only-accept status media-types :guard string?)
(read-token req passphrase)
Read supplied JWToken from the request headers.
If a valid token is supplied containing :super-user return :jwttoken and associated :user. If a valid id-token is supplied return a map containing :id-token and associated :user. 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 containing :super-user return :jwttoken and associated :user. If a valid id-token is supplied return a map containing :id-token and associated :user. 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