-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding integrity for css and js files and optional nonce for js (#30)
- Loading branch information
Showing
9 changed files
with
106 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Integrity checks for the css/js files | ||
# Generated with the following command: | ||
# openssl dgst -sha384 -binary path/to/file.min.css | openssl base64 -A | ||
|
||
|
||
INTEGRITY_JS_MODULE = ( | ||
"sha384-S0rArPSbImK+pbCuenUI94sCELE0j2TcUqSauDNeTLZxL3HBr6ilBWCzU6605Lhc" | ||
) | ||
INTEGRITY_JS_NOMODULE = ( | ||
"sha384-/Ki29nOlnayQ7/etxVpEaxmfMye/syzFZVrgkd93WGAi4/WlVvVLhLp9GMvtPP+y" | ||
) | ||
INTEGRITY_CSS = ( | ||
"sha384-C/tHGtxXFiwg9vEKg7jcH+8kQhlkUfq22JBeptJ8AqGHcArh9k/LdedUi42QQRRi" | ||
) | ||
INTEGRITY_CSS_ICONS = ( | ||
"sha384-/chTXCOZpCTu7roNmemf+/rzzYwswg3UdqDqTYmx1sxYnJjDjvUWSfu+6lk02dHh" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{% load static %} | ||
<link rel="stylesheet" href="{% static 'dsfr/dist/dsfr/dsfr.min.css' %}"> | ||
<link rel="stylesheet" href="{% static 'dsfr/dist/utility/icons/icons.min.css' %}"> | ||
<link rel="stylesheet" href="{% static 'dsfr/dist/dsfr/dsfr.min.css' %}" integrity="{{ self.INTEGRITY_CSS }}"> | ||
<link rel="stylesheet" href="{% static 'dsfr/dist/utility/icons/icons.min.css' %}" integrity="{{ self.INTEGRITY_CSS_ICONS }}"> | ||
|
||
<meta name="theme-color" content="#000091"><!-- Définit la couleur de thème du navigateur (Safari/Android) --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{% load static %} | ||
<script type="module" src="{% static 'dsfr/dist/dsfr/dsfr.module.min.js' %}"></script> | ||
<script nomodule src="{% static 'dsfr/dist/dsfr/dsfr.nomodule.min.js' %}"></script> | ||
<script type="module" src="{% static 'dsfr/dist/dsfr/dsfr.module.min.js' %}" integrity="{{ self.INTEGRITY_JS_MODULE }}"{% if self.nonce %} nonce="{{self.nonce}}"{% endif %}></script> | ||
<script nomodule src="{% static 'dsfr/dist/dsfr/dsfr.nomodule.min.js' %}" integrity="{{ self.INTEGRITY_JS_NOMODULE }}" {% if self.nonce %} nonce="{{self.nonce}}"{% endif %}></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ authors = ["Sylvain Boissel <[email protected]>"] | |
description = "Integrate the French government Design System into a Django app" | ||
license = "MIT" | ||
name = "django-dsfr" | ||
version = "0.10.1" | ||
version = "0.11.0" | ||
classifiers = [ | ||
"Development Status :: 3 - Alpha", | ||
"Environment :: Web Environment", | ||
|
@@ -45,6 +45,7 @@ pytest = "^6.2.4" | |
twine = "^4.0.1" | ||
djlint = "^1.12.0" | ||
black = "^22.6.0" | ||
django-csp = "^3.7" | ||
|
||
[build-system] | ||
build-backend = "poetry.core.masonry.api" | ||
|