-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: First CSP config draft * Remove redundant lines * Install other CSP branches * Add autoconfig to codecov ignore list * Fix tests * Allow socket connection for servers (generic) * Allow web sockets too * Merge branch 'development' into csp_header * Reorder and remove report only line * Add setup.py to codecov ignore * Clean ignore list, remove redundant linters and custom installations * Merge branch 'development' into csp_header # Conflicts: # Pipfile.lock * Refactor config * Black * Fix local config * Compact
- Loading branch information
1 parent
c52f0ec
commit 9253113
Showing
7 changed files
with
66 additions
and
60 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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,28 @@ | ||
"""CSP config""" | ||
|
||
from common.app_settings import domain, MODULE_NAME | ||
|
||
CSP_CONFIG = { | ||
"CSP_DEFAULT_SRC": ("'self'",), | ||
"CSP_IMG_SRC": ( | ||
f"{domain()}/static/", | ||
"https://p.typekit.net/", | ||
), | ||
"CSP_FONT_SRC": ("https://use.typekit.net/",), | ||
"CSP_SCRIPT_SRC": ( | ||
"https://use.typekit.net/mrl4ieu.js", | ||
"https://pyodide-cdn2.iodide.io/v0.15.0/full/", | ||
), | ||
"CSP_CONNECT_SRC": ( | ||
"https://pyodide-cdn2.iodide.io/v0.15.0/full/", | ||
f"wss://{MODULE_NAME}-aimmo.codeforlife.education/", | ||
f"https://{MODULE_NAME}-aimmo.codeforlife.education/", | ||
), | ||
} | ||
|
||
if MODULE_NAME == "local": | ||
CSP_CONFIG["CSP_CONNECT_SRC"] += ( | ||
"ws://localhost:*/", | ||
"ws://*:*/socket.io/", | ||
"http://*:*/socket.io/", | ||
) |
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