diff --git a/lms/envs/aws.py b/lms/envs/aws.py index db89ea53ae..b029b97572 100644 --- a/lms/envs/aws.py +++ b/lms/envs/aws.py @@ -177,11 +177,6 @@ EDXMKTG_USER_INFO_COOKIE_NAME = ENV_TOKENS.get('EDXMKTG_USER_INFO_COOKIE_NAME', LMS_ROOT_URL = ENV_TOKENS.get('LMS_ROOT_URL') -DEFAULT_ENTERPRISE_API_URL = None -if LMS_ROOT_URL is not None: - DEFAULT_ENTERPRISE_API_URL = LMS_ROOT_URL + '/enterprise/api/v1/' -ENTERPRISE_API_URL = ENV_TOKENS.get('ENTERPRISE_API_URL', DEFAULT_ENTERPRISE_API_URL) - ENV_FEATURES = ENV_TOKENS.get('FEATURES', {}) for feature, value in ENV_FEATURES.items(): FEATURES[feature] = value @@ -902,7 +897,12 @@ AFFILIATE_COOKIE_NAME = ENV_TOKENS.get('AFFILIATE_COOKIE_NAME', AFFILIATE_COOKIE DOC_LINK_BASE_URL = ENV_TOKENS.get('DOC_LINK_BASE_URL', DOC_LINK_BASE_URL) -############## Settings for the Enterprise App ###################### + +############## OPEN EDX ENTERPRISE SERVICE CONFIGURATION ###################### +# The Open edX Enterprise service is currently hosted via the LMS container/process. +# However, for all intents and purposes this service is treated as a standalone IDA. +# These configuration settings are specific to the Enterprise service and you should +# not find references to them within the edx-platform project. # Publicly-accessible enrollment URL, for use on the client side. ENTERPRISE_PUBLIC_ENROLLMENT_API_URL = ENV_TOKENS.get( @@ -911,12 +911,35 @@ ENTERPRISE_PUBLIC_ENROLLMENT_API_URL = ENV_TOKENS.get( ) # Enrollment URL used on the server-side. -# If not overridden in ENV_TOKENS, then fallback to the value set in env/common.py ENTERPRISE_ENROLLMENT_API_URL = ENV_TOKENS.get( 'ENTERPRISE_ENROLLMENT_API_URL', ENTERPRISE_ENROLLMENT_API_URL ) -# Discovery App config +############## ENTERPRISE SERVICE API CLIENT CONFIGURATION ###################### +# The LMS communicates with the Enterprise service via the EdxRestApiClient class +# The below environmental settings are utilized by the LMS when interacting with +# the service, and override the default parameters which are defined in common.py + +DEFAULT_ENTERPRISE_API_URL = None +if LMS_ROOT_URL is not None: + DEFAULT_ENTERPRISE_API_URL = LMS_ROOT_URL + '/enterprise/api/v1/' +ENTERPRISE_API_URL = ENV_TOKENS.get('ENTERPRISE_API_URL', DEFAULT_ENTERPRISE_API_URL) + +ENTERPRISE_SERVICE_WORKER_USERNAME = ENV_TOKENS.get( + 'ENTERPRISE_SERVICE_WORKER_USERNAME', + ENTERPRISE_SERVICE_WORKER_USERNAME +) +ENTERPRISE_API_CACHE_TIMEOUT = ENV_TOKENS.get( + 'ENTERPRISE_API_CACHE_TIMEOUT', + ENTERPRISE_API_CACHE_TIMEOUT +) + + +############## CATALOG/DISCOVERY SERVICE API CLIENT CONFIGURATION ###################### +# The LMS communicates with the Catalog service via the EdxRestApiClient class +# The below environmental settings are utilized by the LMS when interacting with +# the service, and override the default parameters which are defined in common.py + COURSES_API_CACHE_TIMEOUT = ENV_TOKENS.get('COURSES_API_CACHE_TIMEOUT', COURSES_API_CACHE_TIMEOUT) diff --git a/lms/envs/common.py b/lms/envs/common.py index 8a9c2f4c78..f08ea9d214 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -60,7 +60,6 @@ DISCUSSION_SETTINGS = { } LMS_ROOT_URL = "http://localhost:8000" -ENTERPRISE_API_URL = LMS_ROOT_URL + '/enterprise/api/v1/' # Features FEATURES = { @@ -2848,7 +2847,6 @@ ECOMMERCE_PUBLIC_URL_ROOT = None ECOMMERCE_API_URL = None ECOMMERCE_API_TIMEOUT = 5 ECOMMERCE_SERVICE_WORKER_USERNAME = 'ecommerce_worker' -ENTERPRISE_SERVICE_WORKER_USERNAME = 'enterprise_worker' COURSE_CATALOG_API_URL = None @@ -3067,10 +3065,22 @@ REDIRECT_CACHE_KEY_PREFIX = 'redirects' DOC_LINK_BASE_URL = None -############## Settings for the Enterprise App ###################### +############## OPEN EDX ENTERPRISE SERVICE CONFIGURATION ###################### +# The Open edX Enterprise service is currently hosted via the LMS container/process. +# However, for all intents and purposes this service is treated as a standalone IDA. +# These configuration settings are specific to the Enterprise service and you should +# not find references to them within the edx-platform project. ENTERPRISE_ENROLLMENT_API_URL = LMS_ROOT_URL + "/api/enrollment/v1/" ENTERPRISE_PUBLIC_ENROLLMENT_API_URL = ENTERPRISE_ENROLLMENT_API_URL + +############## ENTERPRISE SERVICE API CLIENT CONFIGURATION ###################### +# The LMS communicates with the Enterprise service via the EdxRestApiClient class +# These default settings are utilized by the LMS when interacting with the service, +# and are overridden by the configuration parameter accessors defined in aws.py + +ENTERPRISE_API_URL = LMS_ROOT_URL + '/enterprise/api/v1/' +ENTERPRISE_SERVICE_WORKER_USERNAME = 'enterprise_worker' ENTERPRISE_API_CACHE_TIMEOUT = 3600 # Value is in seconds ############## Settings for Course Enrollment Modes ######################