Liking cljdoc? Tell your friends :D

ring-middleware-csp.core


composeclj

(compose policy)
(compose policy nonce)

Make string value for CSP header from policy map

Make string value for CSP header from policy map
sourceraw docstring

parseclj

(parse policy-str)

Make policy map from CSP header string value

Make policy map from CSP header string value
sourceraw docstring

wrap-cspclj

(wrap-csp handler {:keys [report-handler report-uri use-nonce?] :as opts})

Middleware that adds Content-Security-Policy header. Accepts the following options: :policy - CSP in {directive-name directive-values} format. See README for details. :report-only? - true if Use Content-Security-Policy-Report-Only Header. :policy-generator - function that dynamically generate policy map from request. :report-handler - function that process request and return response. :report-uri - specify the path to use report-handler. :use-nonce? - boolean. if true, generate nonce and replace policy value :nonce to nonce-xxxxxxxx. default: false :nonce-generator - custom function that generate nonce string. default implementation by SecureRandom class.

Middleware that adds Content-Security-Policy header.
Accepts the following options:
:policy           - CSP in {directive-name directive-values} format. See README for details.
:report-only?     - true if Use Content-Security-Policy-Report-Only Header.
:policy-generator - function that dynamically generate policy map from request.
:report-handler   - function that process request and return response.
:report-uri       - specify the path to use report-handler.
:use-nonce?       - boolean. if true, generate nonce and replace policy value :nonce to `nonce-xxxxxxxx`.
                    default: false
:nonce-generator  - custom function that generate nonce string.
                    default implementation by SecureRandom class.
sourceraw docstring

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

× close