Liking cljdoc? Tell your friends :D

puppetlabs.ring-middleware.core


sanitize-client-certclj

(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.
sourceraw docstring

wrap-add-cache-headersclj

(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
sourceraw docstring

wrap-add-cspclj

(wrap-add-csp handler csp-val)

Inputs: [handler :- IFn csp-val] Returns: IFn

Adds 'Content-Security-Policy: default-src 'self'' headers to request.

Inputs: [handler :- IFn csp-val]
Returns: IFn

Adds 'Content-Security-Policy: default-src 'self'' headers to request.
sourceraw docstring

wrap-add-referrer-policyclj

(wrap-add-referrer-policy policy-option handler)

Inputs: [policy-option :- schema/Str handler :- IFn] Returns: IFn

Adds referrer policy to the header as 'Referrer-Policy: no-referrer' or 'Referrer-Policy: same-origin'

Inputs: [policy-option :- schema/Str handler :- IFn]
Returns: IFn

Adds referrer policy to the header as 'Referrer-Policy: no-referrer' or 'Referrer-Policy: same-origin'
sourceraw docstring

wrap-add-x-content-nosniffclj

(wrap-add-x-content-nosniff handler)

Inputs: [handler :- IFn] Returns: IFn

Adds 'X-Content-Type-Options: nosniff' headers to request.

Inputs: [handler :- IFn]
Returns: IFn

Adds 'X-Content-Type-Options: nosniff' headers to request.
sourceraw docstring

wrap-add-x-frame-options-denyclj

(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
sourceraw docstring

wrap-bad-requestclj

(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.
sourceraw docstring

wrap-data-errorsclj

(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.
sourceraw docstring

wrap-proxyclj

(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.
sourceraw docstring

wrap-request-loggingclj

(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.
sourceraw docstring

wrap-response-loggingclj

(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.
sourceraw docstring

wrap-schema-errorsclj

(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
sourceraw docstring

wrap-service-unavailableclj

(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.
sourceraw docstring

wrap-uncaught-errorsclj

(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
sourceraw docstring

wrap-with-certificate-cnclj

(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.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close