Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
fce30825
Commit
fce30825
authored
Feb 24, 2014
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow the prevention of the LMS/CMS from being renderable in an iframe
parent
38916f85
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
0 deletions
+36
-0
cms/envs/aws.py
+3
-0
cms/envs/common.py
+6
-0
lms/djangoapps/branding/tests.py
+19
-0
lms/envs/aws.py
+3
-0
lms/envs/common.py
+5
-0
No files found.
cms/envs/aws.py
View file @
fce30825
...
...
@@ -259,3 +259,6 @@ PASSWORD_DICTIONARY = ENV_TOKENS.get("PASSWORD_DICTIONARY", [])
### INACTIVITY SETTINGS ####
SESSION_INACTIVITY_TIMEOUT_IN_SECONDS
=
AUTH_TOKENS
.
get
(
"SESSION_INACTIVITY_TIMEOUT_IN_SECONDS"
)
##### X-Frame-Options response header settings #####
X_FRAME_OPTIONS
=
ENV_TOKENS
.
get
(
'X_FRAME_OPTIONS'
,
X_FRAME_OPTIONS
)
cms/envs/common.py
View file @
fce30825
...
...
@@ -205,8 +205,14 @@ MIDDLEWARE_CLASSES = (
# for expiring inactive sessions
'session_inactivity_timeout.middleware.SessionInactivityTimeout'
,
# use Django built in clickjacking protection
'django.middleware.clickjacking.XFrameOptionsMiddleware'
,
)
# Clickjacking protection can be enabled by setting this to 'DENY'
X_FRAME_OPTIONS
=
'ALLOW'
############# XBlock Configuration ##########
# This should be moved into an XBlock Runtime/Application object
...
...
lms/djangoapps/branding/tests.py
View file @
fce30825
...
...
@@ -53,3 +53,22 @@ class AnonymousIndexPageTest(ModuleStoreTestCase):
def
test_anon_user_no_startdate_index
(
self
):
response
=
self
.
client
.
get
(
'/'
)
self
.
assertEqual
(
response
.
status_code
,
200
)
def
test_allow_x_frame_options
(
self
):
"""
Check the x-frame-option response header
"""
# check to see that the default setting is to ALLOW iframing
resp
=
self
.
client
.
get
(
'/'
)
self
.
assertEquals
(
resp
[
'X-Frame-Options'
],
'ALLOW'
)
@override_settings
(
X_FRAME_OPTIONS
=
'DENY'
)
def
test_deny_x_frame_options
(
self
):
"""
Check the x-frame-option response header
"""
# check to see that the override value is honored
resp
=
self
.
client
.
get
(
'/'
)
self
.
assertEquals
(
resp
[
'X-Frame-Options'
],
'DENY'
)
lms/envs/aws.py
View file @
fce30825
...
...
@@ -378,3 +378,6 @@ SESSION_INACTIVITY_TIMEOUT_IN_SECONDS = AUTH_TOKENS.get("SESSION_INACTIVITY_TIME
##### LMS DEADLINE DISPLAY TIME_ZONE #######
TIME_ZONE_DISPLAYED_FOR_DEADLINES
=
ENV_TOKENS
.
get
(
"TIME_ZONE_DISPLAYED_FOR_DEADLINES"
,
TIME_ZONE_DISPLAYED_FOR_DEADLINES
)
##### X-Frame-Options response header settings #####
X_FRAME_OPTIONS
=
ENV_TOKENS
.
get
(
'X_FRAME_OPTIONS'
,
X_FRAME_OPTIONS
)
lms/envs/common.py
View file @
fce30825
...
...
@@ -740,8 +740,13 @@ MIDDLEWARE_CLASSES = (
# for expiring inactive sessions
'session_inactivity_timeout.middleware.SessionInactivityTimeout'
,
# use Django built in clickjacking protection
'django.middleware.clickjacking.XFrameOptionsMiddleware'
,
)
# Clickjacking protection can be enabled by setting this to 'DENY'
X_FRAME_OPTIONS
=
'ALLOW'
############################### Pipeline #######################################
STATICFILES_STORAGE
=
'pipeline.storage.PipelineCachedStorage'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment