-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CHANGE] Use
django-sri
for sri hashes
- Loading branch information
Showing
19 changed files
with
238 additions
and
105 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
""" | ||
Helper functions for static integrity calculations | ||
""" | ||
|
||
# Standard Library | ||
import os | ||
from pathlib import Path | ||
|
||
# Third Party | ||
from sri import Algorithm, calculate_integrity | ||
|
||
# Alliance Auth | ||
from allianceauth.services.hooks import get_extension_logger | ||
|
||
# Alliance Auth (External Libs) | ||
from app_utils.logging import LoggerAddTag | ||
|
||
# AA Intel Tool | ||
from aa_intel_tool import __title__ | ||
from aa_intel_tool.constants import AA_INTEL_TOOL_STATIC_DIR | ||
|
||
logger = LoggerAddTag(my_logger=get_extension_logger(__name__), prefix=__title__) | ||
|
||
|
||
def calculate_integrity_hash(relative_file_path: str) -> str: | ||
""" | ||
Calculates the integrity hash for a given static file | ||
:param self: | ||
:type self: | ||
:param relative_file_path: The file path relative to the `aa-intel-tool/aa_intel_tool/static/aa_intel_tool` folder | ||
:type relative_file_path: str | ||
:return: The integrity hash | ||
:rtype: str | ||
""" | ||
|
||
file_path = os.path.join(AA_INTEL_TOOL_STATIC_DIR, relative_file_path) | ||
integrity_hash = calculate_integrity( | ||
path=Path(file_path), algorithm=Algorithm.SHA512 | ||
) | ||
|
||
return integrity_hash |
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 |
---|---|---|
|
@@ -8,7 +8,7 @@ msgid "" | |
msgstr "" | ||
"Project-Id-Version: AA Intel Tool 2.5.3\n" | ||
"Report-Msgid-Bugs-To: https://github.com/ppfeufer/aa-intel-tool/issues\n" | ||
"POT-Creation-Date: 2025-01-13 15:19+0100\n" | ||
"POT-Creation-Date: 2025-01-31 11:24+0100\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language-Team: LANGUAGE <[email protected]>\n" | ||
|
@@ -46,16 +46,16 @@ msgstr "" | |
msgid "Intel Parser v{__version__}" | ||
msgstr "" | ||
|
||
#: aa_intel_tool/constants.py:60 aa_intel_tool/models.py:24 | ||
#: aa_intel_tool/constants.py:61 aa_intel_tool/models.py:24 | ||
msgid "Chat list" | ||
msgstr "" | ||
|
||
#: aa_intel_tool/constants.py:66 aa_intel_tool/models.py:22 | ||
#: aa_intel_tool/constants.py:67 aa_intel_tool/models.py:22 | ||
#: aa_intel_tool/templates/aa_intel_tool/partials/index/form.html:28 | ||
msgid "D-Scan" | ||
msgstr "" | ||
|
||
#: aa_intel_tool/constants.py:72 aa_intel_tool/models.py:23 | ||
#: aa_intel_tool/constants.py:73 aa_intel_tool/models.py:23 | ||
#: aa_intel_tool/models.py:123 | ||
#: aa_intel_tool/templates/aa_intel_tool/partials/index/form.html:33 | ||
msgid "Fleet composition" | ||
|
6 changes: 1 addition & 5 deletions
6
aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-chatscan-highlight-js.html
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,7 +1,3 @@ | ||
{% load aa_intel_tool %} | ||
|
||
<script | ||
src="{% aa_intel_tool_static 'aa_intel_tool/javascript/aa-intel-tool-chatscan-highlight.min.js' %}" | ||
integrity="sha512-YzcjTrdeTHKUjG7l1ZGvlNPG5avThGCbGX6GrqfCmWzgNt+fRLfA3DcESh+POA9ikPzuPCk9apcU4RTvcyZCPA==" | ||
crossorigin="anonymous" | ||
></script> | ||
{% aa_intel_tool_static "javascript/aa-intel-tool-chatscan-highlight.min.js" %} |
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
7 changes: 1 addition & 6 deletions
7
aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-css.html
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,8 +1,3 @@ | ||
{% load aa_intel_tool %} | ||
|
||
<link | ||
rel="stylesheet" | ||
href="{% aa_intel_tool_static 'aa_intel_tool/css/aa-intel-tool.min.css' %}" | ||
integrity="sha512-RSNyeAUaR9ZA59om8JlmtMbVW3wYBcqRc+UFpVbdsS1QHvSLUYWPvMRbN2bpSJ25OoKeK1QVVuPWgzzbKsb/Lw==" | ||
crossorigin="anonymous" | ||
> | ||
{% aa_intel_tool_static "css/aa-intel-tool.min.css" %} |
6 changes: 1 addition & 5 deletions
6
aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-dscan-highlight-js.html
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,7 +1,3 @@ | ||
{% load aa_intel_tool %} | ||
|
||
<script | ||
src="{% aa_intel_tool_static 'aa_intel_tool/javascript/aa-intel-tool-dscan-highlight.min.js' %}" | ||
integrity="sha512-YJVl7QxRc/s/zl/pzv0cFKKqK0lUa/Xd2L7huOu+/AeARYMB6IQQjYksr5wfGwsIbo52tm4StpZZZ4ouNX0ftQ==" | ||
crossorigin="anonymous" | ||
></script> | ||
{% aa_intel_tool_static "javascript/aa-intel-tool-dscan-highlight.min.js" %} |
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
6 changes: 1 addition & 5 deletions
6
...tel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-fleetcomposition-highlight-js.html
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,7 +1,3 @@ | ||
{% load aa_intel_tool %} | ||
|
||
<script | ||
src="{% aa_intel_tool_static 'aa_intel_tool/javascript/aa-intel-tool-fleetcomposition-highlight.min.js' %}" | ||
integrity="sha512-hxoSE4QX1nKsx17hbZezLAXnUsD6CcXcNNrSCeh0yFSoGN7rrAgYJbIPgP/o93wFCmn3r8rGBELrdFSjzvxP7w==" | ||
crossorigin="anonymous" | ||
></script> | ||
{% aa_intel_tool_static "javascript/aa-intel-tool-fleetcomposition-highlight.min.js" %} |
6 changes: 1 addition & 5 deletions
6
aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-js.html
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,7 +1,3 @@ | ||
{% load aa_intel_tool %} | ||
|
||
<script | ||
src="{% aa_intel_tool_static 'aa_intel_tool/javascript/aa-intel-tool.min.js' %}" | ||
integrity="sha512-BlayqocQIdp4NgQC1sXiDBs/NgOkrqby7mJgIk74i77S/yFrOeY6rHwlF55wCT4jM72aTBwgnad8ypkbkElxoA==" | ||
crossorigin="anonymous" | ||
></script> | ||
{% aa_intel_tool_static "javascript/aa-intel-tool.min.js" %} |
6 changes: 1 addition & 5 deletions
6
aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-scan-result-common-js.html
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,7 +1,3 @@ | ||
{% load aa_intel_tool %} | ||
|
||
<script | ||
src="{% aa_intel_tool_static 'aa_intel_tool/javascript/aa-intel-tool-scan-result-common.min.js' %}" | ||
integrity="sha512-drBg9SRxkGYfVnPCgylJ291qgNyTYJ0rBkJcCAnoRgry0gm7j7APAFv7KvIoxjB5ms0EoBBrWiCnYZJ83BSCGQ==" | ||
crossorigin="anonymous" | ||
></script> | ||
{% aa_intel_tool_static "javascript/aa-intel-tool-scan-result-common.min.js" %} |
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
Oops, something went wrong.