Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port over external CSP3 hash support #137

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

unverbraucht
Copy link

Hi,

I needed this so I tried to port over the original PR by @sersorrel from slackhq/csp-html-webpack-plugin#87. Apart from adding the support for hashing external scripts I also changed the way jest tests are run: if they fail, jest would go into timeout since done() was never called. Instead I moved it over to Promises, so fails are fast.

All tests are green with this but I haven't tried it out in practice.

This should fix #74

Fix jest correctly asserting on webpack compilation warnings/errors
Add missing meta tag to external-scripts-styles.html
plugin.js Show resolved Hide resolved
@melloware melloware linked an issue Oct 17, 2023 that may be closed by this pull request
@melloware melloware added the enhancement New feature or request label Oct 17, 2023
@melloware melloware added this to the 6.0.5 milestone Oct 17, 2023
@melloware melloware self-assigned this Oct 17, 2023
@unverbraucht unverbraucht marked this pull request as draft October 18, 2023 07:52
@melloware
Copy link
Owner

OK let me know when its ready and I will push 6.0.5 to NPM

@unverbraucht
Copy link
Author

This is not actually working for non-online scripts. The webpack hooks when emitting JS files or other assets don't get called. I'm not sure I'll have the time to look into this because we'll probably move to using nonces instead of hashes.

@melloware
Copy link
Owner

No worries lets leave this draft open for others to see in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

External Hash Support CSP3 hash support for external scripts
2 participants