(sanitize-client-cert req)
Given a ring request, return a map which replaces the :ssl-client-cert with just the certificate's Common Name at :ssl-client-cert-cn. Also, remove the copy of the certificate put on the request by TK-auth.
Given a ring request, return a map which replaces the :ssl-client-cert with just the certificate's Common Name at :ssl-client-cert-cn. Also, remove the copy of the certificate put on the request by TK-auth.
(wrap-add-cache-headers handler)
Inputs: [handler :- IFn] Returns: IFn
Adds cache control invalidation headers to GET and PUT requests if they are handled by the handler
Inputs: [handler :- IFn] Returns: IFn Adds cache control invalidation headers to GET and PUT requests if they are handled by the handler
(wrap-add-x-frame-options-deny handler)
Inputs: [handler :- IFn] Returns: IFn
Adds 'X-Frame-Options: DENY' headers to requests if they are handled by the handler
Inputs: [handler :- IFn] Returns: IFn Adds 'X-Frame-Options: DENY' headers to requests if they are handled by the handler
(wrap-bad-request handler)
(wrap-bad-request handler type)
Inputs: ([handler :- IFn] [handler :- IFn type :- utils/ResponseType]) Returns: IFn
A ring middleware that catches slingshot errors thrown by utils/throw-bad-request!, logs the error and returns a 503 ring response.
Inputs: ([handler :- IFn] [handler :- IFn type :- utils/ResponseType]) Returns: IFn A ring middleware that catches slingshot errors thrown by utils/throw-bad-request!, logs the error and returns a 503 ring response.
(wrap-data-errors handler)
(wrap-data-errors handler type)
Inputs: ([handler :- IFn] [handler :- IFn type :- utils/ResponseType]) Returns: IFn
A ring middleware that catches a slingshot error thrown by throw-data-invalid! or a :kind of slingshot error of one of: :request-data-invalid :user-data-invalid :data-invalid :service-status-version-not-found logs the error and returns a 400 ring response.
Inputs: ([handler :- IFn] [handler :- IFn type :- utils/ResponseType]) Returns: IFn A ring middleware that catches a slingshot error thrown by throw-data-invalid! or a :kind of slingshot error of one of: :request-data-invalid :user-data-invalid :data-invalid :service-status-version-not-found logs the error and returns a 400 ring response.
(wrap-proxy handler proxied-path remote-uri-base & [http-opts])
Inputs: [handler :- IFn proxied-path :- (schema/either Pattern schema/Str) remote-uri-base :- schema/Str & [http-opts]] Returns: IFn
Proxies requests to proxied-path, a local URI, to the remote URI at remote-uri-base, also a string.
Inputs: [handler :- IFn proxied-path :- (schema/either Pattern schema/Str) remote-uri-base :- schema/Str & [http-opts]] Returns: IFn Proxies requests to proxied-path, a local URI, to the remote URI at remote-uri-base, also a string.
(wrap-request-logging handler)
Inputs: [handler :- IFn] Returns: IFn
A ring middleware that logs the request.
Inputs: [handler :- IFn] Returns: IFn A ring middleware that logs the request.
(wrap-response-logging handler)
Inputs: [handler :- IFn] Returns: IFn
A ring middleware that logs the response.
Inputs: [handler :- IFn] Returns: IFn A ring middleware that logs the response.
(wrap-schema-errors handler)
(wrap-schema-errors handler type)
Inputs: ([handler :- IFn] [handler :- IFn type :- utils/ResponseType]) Returns: IFn
A ring middleware that catches schema errors and returns a 500 response with the details
Inputs: ([handler :- IFn] [handler :- IFn type :- utils/ResponseType]) Returns: IFn A ring middleware that catches schema errors and returns a 500 response with the details
(wrap-service-unavailable handler)
(wrap-service-unavailable handler type)
Inputs: ([handler :- IFn] [handler :- IFn type :- utils/ResponseType]) Returns: IFn
A ring middleware that catches slingshot errors thrown by utils/throw-service-unavailabe!, logs the error and returns a 503 ring response.
Inputs: ([handler :- IFn] [handler :- IFn type :- utils/ResponseType]) Returns: IFn A ring middleware that catches slingshot errors thrown by utils/throw-service-unavailabe!, logs the error and returns a 503 ring response.
(wrap-uncaught-errors handler)
(wrap-uncaught-errors handler type)
Inputs: ([handler :- IFn] [handler :- IFn type :- utils/ResponseType]) Returns: IFn
A ring middleware that catches all otherwise uncaught errors and returns a 500 response with the error message
Inputs: ([handler :- IFn] [handler :- IFn type :- utils/ResponseType]) Returns: IFn A ring middleware that catches all otherwise uncaught errors and returns a 500 response with the error message
(wrap-with-certificate-cn handler)
Inputs: [handler :- IFn] Returns: IFn
Ring middleware that will annotate the request with an :ssl-client-cn key representing the CN contained in the client certificate of the request. If no client certificate is present, the key's value is set to nil.
Inputs: [handler :- IFn] Returns: IFn Ring middleware that will annotate the request with an :ssl-client-cn key representing the CN contained in the client certificate of the request. If no client certificate is present, the key's value is set to nil.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close