From 11c3588fcc56411b24f447a368af78dc172f4851 Mon Sep 17 00:00:00 2001 From: Troy Sankey Date: Wed, 13 Feb 2019 12:08:42 -0500 Subject: [PATCH] Load IDA_LOGOUT_URI_LIST in all the necessary places I missed the LMS production settings, and Studio in its entirety. --- cms/envs/aws.py | 4 ++++ cms/envs/common.py | 4 ++++ cms/envs/devstack.py | 5 +++++ cms/envs/production.py | 4 ++++ lms/envs/aws.py | 4 ++++ lms/envs/production.py | 4 ++++ 6 files changed, 25 insertions(+) diff --git a/cms/envs/aws.py b/cms/envs/aws.py index 875454baf1..14e76e83fa 100644 --- a/cms/envs/aws.py +++ b/cms/envs/aws.py @@ -144,6 +144,10 @@ ENTERPRISE_API_URL = ENV_TOKENS.get('ENTERPRISE_API_URL', LMS_INTERNAL_ROOT_URL ENTERPRISE_CONSENT_API_URL = ENV_TOKENS.get('ENTERPRISE_CONSENT_API_URL', LMS_INTERNAL_ROOT_URL + '/consent/api/v1/') # Note that FEATURES['PREVIEW_LMS_BASE'] gets read in from the environment file. +# List of logout URIs for each IDA that the learner should be logged out of when they logout of +# Studio. Only applies to IDA for which the social auth flow uses DOT (Django OAuth Toolkit). +IDA_LOGOUT_URI_LIST = ENV_TOKENS.get('IDA_LOGOUT_URI_LIST', []) + SITE_NAME = ENV_TOKENS['SITE_NAME'] ALLOWED_HOSTS = [ diff --git a/cms/envs/common.py b/cms/envs/common.py index 0fa67a98e1..6d0fd9b18d 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -443,6 +443,10 @@ LMS_ENROLLMENT_API_PATH = "/api/enrollment/v1/" ENTERPRISE_API_URL = LMS_INTERNAL_ROOT_URL + '/enterprise/api/v1/' ENTERPRISE_CONSENT_API_URL = LMS_INTERNAL_ROOT_URL + '/consent/api/v1/' +# List of logout URIs for each IDA that the learner should be logged out of when they logout of +# Studio. Only applies to IDA for which the social auth flow uses DOT (Django OAuth Toolkit). +IDA_LOGOUT_URI_LIST = [] + # These are standard regexes for pulling out info like course_ids, usage_ids, etc. # They are used so that URLs with deprecated-format strings still work. from lms.envs.common import ( diff --git a/cms/envs/devstack.py b/cms/envs/devstack.py index d9fc25b8f4..6bc302c61e 100644 --- a/cms/envs/devstack.py +++ b/cms/envs/devstack.py @@ -166,6 +166,11 @@ JWT_AUTH.update({ ), }) +IDA_LOGOUT_URI_LIST = [ + 'http://localhost:18130/logout/', # ecommerce + 'http://localhost:18150/logout/', # credentials +] + ##################################################################### from openedx.core.djangoapps.plugins import plugin_settings, constants as plugin_constants plugin_settings.add_plugins(__name__, plugin_constants.ProjectType.CMS, plugin_constants.SettingsType.DEVSTACK) diff --git a/cms/envs/production.py b/cms/envs/production.py index d47d056a98..9e8e1bce87 100644 --- a/cms/envs/production.py +++ b/cms/envs/production.py @@ -144,6 +144,10 @@ ENTERPRISE_API_URL = ENV_TOKENS.get('ENTERPRISE_API_URL', LMS_INTERNAL_ROOT_URL ENTERPRISE_CONSENT_API_URL = ENV_TOKENS.get('ENTERPRISE_CONSENT_API_URL', LMS_INTERNAL_ROOT_URL + '/consent/api/v1/') # Note that FEATURES['PREVIEW_LMS_BASE'] gets read in from the environment file. +# List of logout URIs for each IDA that the learner should be logged out of when they logout of +# Studio. Only applies to IDA for which the social auth flow uses DOT (Django OAuth Toolkit). +IDA_LOGOUT_URI_LIST = ENV_TOKENS.get('IDA_LOGOUT_URI_LIST', []) + SITE_NAME = ENV_TOKENS['SITE_NAME'] ALLOWED_HOSTS = [ diff --git a/lms/envs/aws.py b/lms/envs/aws.py index 932550d6c2..6834b13174 100644 --- a/lms/envs/aws.py +++ b/lms/envs/aws.py @@ -175,6 +175,10 @@ EDXMKTG_USER_INFO_COOKIE_NAME = ENV_TOKENS.get('EDXMKTG_USER_INFO_COOKIE_NAME', LMS_ROOT_URL = ENV_TOKENS.get('LMS_ROOT_URL') LMS_INTERNAL_ROOT_URL = ENV_TOKENS.get('LMS_INTERNAL_ROOT_URL', LMS_ROOT_URL) +# List of logout URIs for each IDA that the learner should be logged out of when they logout of the LMS. Only applies to +# IDA for which the social auth flow uses DOT (Django OAuth Toolkit). +IDA_LOGOUT_URI_LIST = ENV_TOKENS.get('IDA_LOGOUT_URI_LIST', []) + ENV_FEATURES = ENV_TOKENS.get('FEATURES', {}) for feature, value in ENV_FEATURES.items(): FEATURES[feature] = value diff --git a/lms/envs/production.py b/lms/envs/production.py index 240c57a703..afe2e8d1db 100644 --- a/lms/envs/production.py +++ b/lms/envs/production.py @@ -179,6 +179,10 @@ EDXMKTG_USER_INFO_COOKIE_NAME = ENV_TOKENS.get('EDXMKTG_USER_INFO_COOKIE_NAME', LMS_ROOT_URL = ENV_TOKENS.get('LMS_ROOT_URL') LMS_INTERNAL_ROOT_URL = ENV_TOKENS.get('LMS_INTERNAL_ROOT_URL', LMS_ROOT_URL) +# List of logout URIs for each IDA that the learner should be logged out of when they logout of the LMS. Only applies to +# IDA for which the social auth flow uses DOT (Django OAuth Toolkit). +IDA_LOGOUT_URI_LIST = ENV_TOKENS.get('IDA_LOGOUT_URI_LIST', []) + ENV_FEATURES = ENV_TOKENS.get('FEATURES', {}) for feature, value in ENV_FEATURES.items(): FEATURES[feature] = value