From f08185443e804f99274a4037903d4cff27718257 Mon Sep 17 00:00:00 2001 From: Manjinder Singh <49171515+jinder1s@users.noreply.github.com> Date: Mon, 10 Feb 2020 10:17:31 -0500 Subject: [PATCH] Adding new settings to correct places (#23051) These settings are used to toggle new authentication class in discussion and bookmarks app. The auth class is in openedx/core/lib/api/authentication.py and was added to replace deprecated OAuth2Authentication class in [rest_framework_oauth library](https://github.com/jpadilla/django-rest-framework-oauth) --- lms/envs/common.py | 5 +++++ lms/envs/production.py | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/lms/envs/common.py b/lms/envs/common.py index 53d010b9fa..16b6f36024 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -130,6 +130,11 @@ FEATURES = { # Toggles OAuth2 authentication provider 'ENABLE_OAUTH2_PROVIDER': False, + # Toggles auth class in discussions djangoapps + 'DISCUSSION_USE_NEW_OAUTH2_CLASS': False, + # Toggles auth class in bookmarks djangoapps + 'BOOKMARKS_USE_NEW_OAUTH2_CLASS': False, + # Allows to enable an API endpoint to serve XBlock view, used for example by external applications. # See jquey-xblock: https://github.com/edx-solutions/jquery-xblock 'ENABLE_XBLOCK_VIEW_ENDPOINT': False, diff --git a/lms/envs/production.py b/lms/envs/production.py index b152be49f2..9eeecec3b1 100644 --- a/lms/envs/production.py +++ b/lms/envs/production.py @@ -768,6 +768,12 @@ if FEATURES.get('ENABLE_OAUTH2_PROVIDER'): OAUTH_ID_TOKEN_EXPIRATION = ENV_TOKENS.get('OAUTH_ID_TOKEN_EXPIRATION', OAUTH_ID_TOKEN_EXPIRATION) OAUTH_DELETE_EXPIRED = ENV_TOKENS.get('OAUTH_DELETE_EXPIRED', OAUTH_DELETE_EXPIRED) +##### Changing Authentication Class #### +# Toggles auth class in discussions djangoapps +DISCUSSION_USE_NEW_OAUTH2_CLASS = ENV_TOKENS.get('DISCUSSION_USE_NEW_OAUTH2_CLASS', False) +# Toggles auth class in bookmakrs djangoapps +BOOKMARKS_USE_NEW_OAUTH2_CLASS = ENV_TOKENS.get('BOOKMARKS_USE_NEW_OAUTH2_CLASS', False) + ##### GOOGLE ANALYTICS IDS ##### GOOGLE_ANALYTICS_ACCOUNT = AUTH_TOKENS.get('GOOGLE_ANALYTICS_ACCOUNT') GOOGLE_ANALYTICS_TRACKING_ID = AUTH_TOKENS.get('GOOGLE_ANALYTICS_TRACKING_ID')