Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
3eb5e432
Unverified
Commit
3eb5e432
authored
6 years ago
by
Brian Mesick
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #18322 from edx/bmedx/remove_sessionauthenticationmiddleware
Remove SessionAuthenticationMiddleware from INSTALLED_APPS
parents
69341f80
2ca632ae
Loading
Loading
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cms/envs/common.py
+0
-3
0 additions, 3 deletions
cms/envs/common.py
lms/envs/common.py
+0
-3
0 additions, 3 deletions
lms/envs/common.py
openedx/core/djangoapps/cache_toolbox/middleware.py
+2
-6
2 additions, 6 deletions
openedx/core/djangoapps/cache_toolbox/middleware.py
with
2 additions
and
12 deletions
cms/envs/common.py
+
0
−
3
View file @
3eb5e432
...
...
@@ -482,9 +482,6 @@ MIDDLEWARE_CLASSES = [
# Instead of AuthenticationMiddleware, we use a cache-backed version
'
openedx.core.djangoapps.cache_toolbox.middleware.CacheBackedAuthenticationMiddleware
'
,
# Enable SessionAuthenticationMiddleware in order to invalidate
# user sessions after a password change.
'
django.contrib.auth.middleware.SessionAuthenticationMiddleware
'
,
'
student.middleware.UserStandingMiddleware
'
,
'
openedx.core.djangoapps.contentserver.middleware.StaticContentServer
'
,
...
...
This diff is collapsed.
Click to expand it.
lms/envs/common.py
+
0
−
3
View file @
3eb5e432
...
...
@@ -1238,9 +1238,6 @@ MIDDLEWARE_CLASSES = [
# Instead of AuthenticationMiddleware, we use a cached backed version
#'django.contrib.auth.middleware.AuthenticationMiddleware',
'
openedx.core.djangoapps.cache_toolbox.middleware.CacheBackedAuthenticationMiddleware
'
,
# Enable SessionAuthenticationMiddleware in order to invalidate
# user sessions after a password change.
'
django.contrib.auth.middleware.SessionAuthenticationMiddleware
'
,
'
student.middleware.UserStandingMiddleware
'
,
'
openedx.core.djangoapps.contentserver.middleware.StaticContentServer
'
,
...
...
This diff is collapsed.
Click to expand it.
openedx/core/djangoapps/cache_toolbox/middleware.py
+
2
−
6
View file @
3eb5e432
...
...
@@ -120,19 +120,15 @@ class CacheBackedAuthenticationMiddleware(AuthenticationMiddleware):
def
_verify_session_auth
(
self
,
request
):
"""
Ensure that the user
'
s session hash hasn
'
t changed. We check that
SessionAuthenticationMiddleware is enabled in order to match Django
'
s
behavior.
Ensure that the user
'
s session hash hasn
'
t changed.
"""
session_auth_class
=
'
django.contrib.auth.middleware.SessionAuthenticationMiddleware
'
session_auth_enabled
=
session_auth_class
in
settings
.
MIDDLEWARE_CLASSES
# Auto-auth causes issues in Bok Choy tests because it resets
# the requesting user. Since session verification is a
# security feature, we can turn it off when auto-auth is
# enabled since auto-auth is highly insecure and only for
# tests.
auto_auth_enabled
=
settings
.
FEATURES
.
get
(
'
AUTOMATIC_AUTH_FOR_TESTING
'
,
False
)
if
not
auto_auth_enabled
and
session_auth_enabled
and
hasattr
(
request
.
user
,
'
get_session_auth_hash
'
):
if
not
auto_auth_enabled
and
hasattr
(
request
.
user
,
'
get_session_auth_hash
'
):
session_hash
=
request
.
session
.
get
(
HASH_SESSION_KEY
)
if
not
(
session_hash
and
constant_time_compare
(
session_hash
,
request
.
user
.
get_session_auth_hash
())):
# The session hash has changed due to a password
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment