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
696c4361
Commit
696c4361
authored
Feb 24, 2014
by
Chris Dodge
Committed by
Xavier Antoviaque
Mar 03, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow the prevention of the LMS/CMS from being renderable in an iframe
parent
c60fa954
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
0 deletions
+39
-0
cms/envs/aws.py
+3
-0
cms/envs/common.py
+7
-0
lms/djangoapps/branding/tests.py
+19
-0
lms/envs/aws.py
+3
-0
lms/envs/common.py
+7
-0
No files found.
cms/envs/aws.py
View file @
696c4361
...
@@ -264,3 +264,6 @@ PASSWORD_DICTIONARY = ENV_TOKENS.get("PASSWORD_DICTIONARY", [])
...
@@ -264,3 +264,6 @@ PASSWORD_DICTIONARY = ENV_TOKENS.get("PASSWORD_DICTIONARY", [])
### INACTIVITY SETTINGS ####
### INACTIVITY SETTINGS ####
SESSION_INACTIVITY_TIMEOUT_IN_SECONDS
=
AUTH_TOKENS
.
get
(
"SESSION_INACTIVITY_TIMEOUT_IN_SECONDS"
)
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 @
696c4361
...
@@ -195,8 +195,15 @@ MIDDLEWARE_CLASSES = (
...
@@ -195,8 +195,15 @@ MIDDLEWARE_CLASSES = (
# for expiring inactive sessions
# for expiring inactive sessions
'session_inactivity_timeout.middleware.SessionInactivityTimeout'
,
'session_inactivity_timeout.middleware.SessionInactivityTimeout'
,
# use Django built in clickjacking protection
'django.middleware.clickjacking.XFrameOptionsMiddleware'
,
)
)
# This can be overridden if one does not want LMS/CMS to be embeddable in
# an iframe
X_FRAME_OPTIONS
=
'ALLOW'
############# XBlock Configuration ##########
############# XBlock Configuration ##########
# This should be moved into an XBlock Runtime/Application object
# This should be moved into an XBlock Runtime/Application object
...
...
lms/djangoapps/branding/tests.py
View file @
696c4361
...
@@ -53,3 +53,22 @@ class AnonymousIndexPageTest(ModuleStoreTestCase):
...
@@ -53,3 +53,22 @@ class AnonymousIndexPageTest(ModuleStoreTestCase):
def
test_anon_user_no_startdate_index
(
self
):
def
test_anon_user_no_startdate_index
(
self
):
response
=
self
.
client
.
get
(
'/'
)
response
=
self
.
client
.
get
(
'/'
)
self
.
assertEqual
(
response
.
status_code
,
200
)
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 @
696c4361
...
@@ -383,3 +383,6 @@ if ENV_TOKENS.get('XBLOCK_SELECT_FUNCTION') == 'prefer_xmodules':
...
@@ -383,3 +383,6 @@ if ENV_TOKENS.get('XBLOCK_SELECT_FUNCTION') == 'prefer_xmodules':
##### LMS DEADLINE DISPLAY TIME_ZONE #######
##### LMS DEADLINE DISPLAY TIME_ZONE #######
TIME_ZONE_DISPLAYED_FOR_DEADLINES
=
ENV_TOKENS
.
get
(
"TIME_ZONE_DISPLAYED_FOR_DEADLINES"
,
TIME_ZONE_DISPLAYED_FOR_DEADLINES
=
ENV_TOKENS
.
get
(
"TIME_ZONE_DISPLAYED_FOR_DEADLINES"
,
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 @
696c4361
...
@@ -732,8 +732,15 @@ MIDDLEWARE_CLASSES = (
...
@@ -732,8 +732,15 @@ MIDDLEWARE_CLASSES = (
# for expiring inactive sessions
# for expiring inactive sessions
'session_inactivity_timeout.middleware.SessionInactivityTimeout'
,
'session_inactivity_timeout.middleware.SessionInactivityTimeout'
,
# use Django built in clickjacking protection
'django.middleware.clickjacking.XFrameOptionsMiddleware'
,
)
)
# This can be overridden if one does not want LMS/CMS to be embeddable in
# an iframe
X_FRAME_OPTIONS
=
'ALLOW'
############################### Pipeline #######################################
############################### Pipeline #######################################
STATICFILES_STORAGE
=
'pipeline.storage.PipelineCachedStorage'
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