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

Add subresource integrity to script tag #805

Closed
wants to merge 3 commits into from

Conversation

d9pouces
Copy link
Contributor

Allow to integrate subresource-integrity attributes to <script tags>.
Require to add the two following keys beside "output_filename" in Django's setting PIPELINE['JAVASCRIPT']["your package"]:

"crossorigin": "anonymous",
"integrity": "sha384",

Of course, "sha256" and "sha512" also works.
Hashes are computed at runtime and cached to minimize code changes.

Cf. https://infosec.mozilla.org/guidelines/web_security#subresource-integrity

Copy link

codecov bot commented Dec 29, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (14b6d2c) 82.35% compared to head (463a415) 82.68%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #805      +/-   ##
==========================================
+ Coverage   82.35%   82.68%   +0.33%     
==========================================
  Files          33       33              
  Lines        1139     1155      +16     
==========================================
+ Hits          938      955      +17     
+ Misses        201      200       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@d9pouces d9pouces closed this Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant