dev-master
9999999-devContent Security Policy nonce generator
MIT
The Requires
- php ~7.0
The Development Requires
v1.0.0
1.0.0.0Content Security Policy nonce generator
MIT
The Development Requires
Content Security Policy nonce generator
This generates random nonces for Content Security Policy nonce attributes. These nonces work with CSP3 strict-dynamic
which aims to make Content Security Policy simpler to deploy for existing applications. This package is intended to be used with Nette Framework, spaze/csp-config
and spaze/sri-macros
., (*2)
This is a plug and play generator., (*3)
If installed, \Spaze\ContentSecurityPolicy\Config::addDirective()
from spaze/csp-config
will automatically add nonce-...
attribute to configured directives, and Latte macros {script ...}
and {stylesheet ...}
from spaze/sri-macros
will add nonce="..."
attribute to script
and style
attributes respectively. Also n:nonce
shortcut will use the same generated value., (*4)
With Composer:, (*5)
composer require spaze/nonce-generator
Add the extension to your configuration:, (*6)
extensions: nonceGenerator: Spaze\NonceGenerator\Bridges\Nette\GeneratorExtension
createNonce(): Nonce
Generates and returns a Nonce
object. Use Nonce::getValue()
to get the generated nonce., (*7)
Content Security Policy nonce generator
MIT
Content Security Policy nonce generator
MIT