Skip to content

Conversation

@AnujRNair
Copy link
Contributor

Summary

This PR adds functionality to allow the dev to specify individual CSPs on different HtmlWebpackPlugin instances. Full details on how to do so have been added to the readme.

Note: This change introduces a breaking change into the plugin, changing disableCspPlugin to cspPlugin.enabled - because of this, we will need a major version bump when this is published

Requirements (place an x in each [ ])

AnujRNair and others added 5 commits December 20, 2018 14:17
* Starting the new Jest tests * Moving all tests to jest * Updating npm run scripts to use jest instead of individual modules * Upgrading all packages * Adding back codecov which was unintentionally removed
@codecov
Copy link

codecov bot commented Dec 21, 2018

Codecov Report

Merging #26 into master-v3 will decrease coverage by 5.75%.
The diff coverage is 94.59%.

Impacted file tree graph

@@ Coverage Diff @@ ## master-v3 #26 +/- ## ============================================= - Coverage 97.32% 91.56% -5.76%  ============================================= Files 2 2 Lines 187 83 -104 Branches 14 11 -3 ============================================= - Hits 182 76 -106  - Misses 5 6 +1  - Partials 0 1 +1
Impacted Files Coverage Δ
test-utils/webpack-helpers.js 100% <100%> (ø)
plugin.js 88.7% <87.5%> (-4.35%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 77da922...94473fd. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 21, 2018

Codecov Report

Merging #26 into master-v3 will decrease coverage by 3.81%.
The diff coverage is 100%.

Impacted file tree graph

@@ Coverage Diff @@ ## master-v3 #26 +/- ## ============================================ - Coverage 97.32% 93.5% -3.82%  ============================================ Files 2 2 Lines 187 77 -110 Branches 14 11 -3 ============================================ - Hits 182 72 -110  + Misses 5 4 -1  - Partials 0 1 +1
Impacted Files Coverage Δ
plugin.js 91.07% <100%> (-1.99%) ⬇️
test-utils/webpack-helpers.js 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 77da922...94473fd. Read the comment docs.

@AnujRNair AnujRNair merged commit 6b75121 into master-v3 Dec 21, 2018
@AnujRNair AnujRNair deleted the an-policy-on-individual-html-plugins branch December 21, 2018 00:09
AnujRNair added a commit that referenced this pull request Jan 30, 2019
* Allow different policies on individual HtmlWebpackPlugin instances (#26) * renaming disableCspPlugin to cspPlugin.enabled to be more inline with the main enabled setting * Adding the option to allow individual policies on a specific html webpack plugin instance * Updating README to reflect the new changes * Adding nonce attrs to external scripts where their host hasnt been defined in the CSP already (#27) * Adding nonce attrs to external scripts where their host hasnt been defined in the CSP already * Making sure that nonces are included when strict-dynamic is set, even if the domain has been whitelisted. Also validating static sources * If plugin is disabled, we should not modify the html at all (#28) * If plugin is disabled, we should not modify the html at all * Updating readme to reflect new recommendation of not including a blank meta tag - it will be added for us * 3.0.0-beta.1 * Fine Grain control for hashes and nonces (#29) * Changing devAllowUnsafe to be more fine-grain by allowing the dev to decide when to allow hashes and nonces * Updating readme to reflect new options * 3.0.0-beta.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants