Skip to content

Commit

Permalink
Merge pull request #260 from RockefellerArchiveCenter/development
Browse files Browse the repository at this point in the history
Add SCP headers
  • Loading branch information
helrond authored Dec 12, 2022
2 parents 02a7724 + 3c53f87 commit 442c17b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions request_broker/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'csp.middleware.CSPMiddleware',
]

ROOT_URLCONF = 'request_broker.urls'
Expand Down Expand Up @@ -137,6 +138,11 @@
CORS_ALLOWED_ORIGINS = config.DJANGO_CORS_ALLOWED_ORIGINS
DIMES_BASEURL = config.DIMES_BASEURL

# Content Security Policy
CSP_IMG_SRC = ("'self'")
CSP_STYLE_SRC = ("'self'", "'unsafe-inline'")
CSP_SCRIPT_SRC = ("'self'", "'unsafe-inline'")

ARCHIVESSPACE = {
"baseurl": config.AS_BASEURL,
"username": config.AS_USERNAME,
Expand Down
1 change: 1 addition & 0 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ArchivesSnake~=0.9
Django~=4.0.7
django-cors-headers~=3.12
django-csp~=3.7
djangorestframework~=3.13
inflect~=5.6
ordered-set~=4.1
Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ django==4.0.8
# via
# -r requirements.in
# django-cors-headers
# django-csp
# djangorestframework
django-cors-headers==3.13.0
# via -r requirements.in
django-csp==3.7
# via -r requirements.in
djangorestframework==3.14.0
# via -r requirements.in
idna==3.4
Expand Down

0 comments on commit 442c17b

Please sign in to comment.