blackbird/module-nonce-provider

1.0.0 2024-07-02 08:45 UTC

This package is auto-updated.

Last update: 2024-11-02 09:26:09 UTC


README

Latest Stable Version License: MIT

This module add access to the object "$nonceProvider" in all Magento 2 templates to facilitate implementation of CSP nonce security.

/**
 * @var \Blackbird\NonceProvider\ViewModel\NonceProvider $nonceProvider
 */
<script type="text/javascript" <?= $nonceProvider->renderNonceAttribute() ?> >
   console.log("I am authorized now !");
</script>

Setup

Get the package

Zip Package:

Unzip the package in app/code/Blackbird/NonceProvider, from the root of your Magento instance.

Composer Package:

composer require blackbird/module-nonce-provider

Install the module

Go to your Magento root, then run the following Magento command:

php bin/magento setup:upgrade

If you are in production mode, do not forget to recompile and redeploy the static resources, or to use the --keep-generated option.

Support

Contact

For further information, contact us:

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details.

That's all folks!