Liking cljdoc? Tell your friends :D

puppetlabs.ring-middleware.core


acceptable-content-typeclj

(acceptable-content-type candidate header)

Returns a boolean indicating whether the candidate mime type matches any of those listed in header, an Accept header.

Returns a boolean indicating whether the `candidate` mime type
matches any of those listed in `header`, an Accept header.
sourceraw docstring

BadRequestclj

source

InternalServiceErrorclj

source

json-encoding-typeclj

source

NotAcceptableclj

source

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

ServiceUnavailableclj

source

superwildcardclj

source

UnsupportedMediaTypeclj

source

wrap-accepts-content-typeclj

(wrap-accepts-content-type handler content-type)

Ring middleware that requires a request for the wrapped handler to accept the provided content-type. If the content type isn't acceptable, a 406 Not Acceptable status is returned, with a message informing the client it must accept the content type.

Ring middleware that requires a request for the wrapped `handler` to accept the
provided `content-type`. If the content type isn't acceptable, a 406 Not
Acceptable status is returned, with a message informing the client it must
accept the content type.
sourceraw docstring

wrap-accepts-jsonclj

Ring middleware which requires a request for handler to accept application/json as a content type. If the request doesn't accept application/json, a 406 Not Acceptable status is returned with an error message indicating the problem.

Ring middleware which requires a request for `handler` to accept
application/json as a content type. If the request doesn't accept
application/json, a 406 Not Acceptable status is returned with an error
message indicating the problem.
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 BadRequest 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 BadRequest ring
response.
sourceraw docstring

wrap-content-typeclj

(wrap-content-type handler content-types)

Verification for the specified list of content-types.

Verification for the specified list of content-types.
sourceraw docstring

wrap-content-type-jsonclj

Ring middleware which requires a request for handler to accept application/json as a content-type. If the request doesn't specify a content-type of application/json a 415 Unsupported Type status is returned.

Ring middleware which requires a request for `handler` to accept
application/json as a content-type.  If the request doesn't specify
a content-type of application/json a 415 Unsupported Type status is returned.
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 BadRequest 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 BadRequest ring response.
sourceraw docstring

wrap-json-parse-exception-handlerclj

Ring middleware which catches JsonParseExceptions and returns a predictable result

Ring middleware which catches JsonParseExceptions and returns a predictable result
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 InternalServiceError response with the details

Inputs: ([handler :- IFn] [handler :- IFn type :- utils/ResponseType])
Returns: IFn

A ring middleware that catches schema errors and returns a InternalServiceError
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 ServiceUnavailable 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 ServiceUnavailable 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 InternalServiceError 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 InternalServiceError 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