Skip to content

Commit

Permalink
chg: update CSP to work with GTM, needs additional permissions for GT…
Browse files Browse the repository at this point in the history
…M preview and to enable full implementation
  • Loading branch information
larry6point6 committed Feb 5, 2025
1 parent 87a0b55 commit 0c92f2a
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions django_app/redbox_app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,19 +201,27 @@
"https://tagmanager.google.com/",
"https://www.googletagmanager.com/",
"ajax.googleapis.com/",
"sha256-T/1K73p+yppfXXw/AfMZXDh5VRDNaoEh3enEGFmZp8M="
"sha256-T/1K73p+yppfXXw/AfMZXDh5VRDNaoEh3enEGFmZp8M=",
)
CSP_OBJECT_SRC = ("'none'",)
CSP_TRUSTED_TYPES = ("dompurify", "default", "goog#html")
CSP_REPORT_TO = "csp-endpoint"
CSP_FONT_SRC = (
"'self'",
"s3.amazonaws.com",
)
CSP_FONT_SRC = ("'self'", "s3.amazonaws.com", "https://fonts.gstatic.com", "data:")
CSP_INCLUDE_NONCE_IN = ("script-src",)
CSP_STYLE_SRC = (
"'self'",
"https://googletagmanager.com",
"https://tagmanager.google.com/",
"https://fonts.googleapis.com",
)

CSP_IMG_SRC = (
"'self'",
"https://googletagmanager.com",
"https://ssl.gstatic.com",
"https://www.gstatic.com",
"https://*.google-analytics.com",
"https://*.googletagmanager.com",
)
CSP_FRAME_ANCESTORS = ("'none'",)

Expand Down Expand Up @@ -442,4 +450,4 @@ def filter_transactions(event):

REDBOX_API_KEY = env.str("REDBOX_API_KEY")

ENABLE_METADATA_EXTRACTION = env.str("ENABLE_METADATA_EXTRACTION")
ENABLE_METADATA_EXTRACTION = env.str("ENABLE_METADATA_EXTRACTION")

0 comments on commit 0c92f2a

Please sign in to comment.