diff --git a/cms/envs/aws.py b/cms/envs/aws.py index ddde708396..15306a30ad 100644 --- a/cms/envs/aws.py +++ b/cms/envs/aws.py @@ -138,6 +138,9 @@ EMAIL_USE_TLS = ENV_TOKENS.get('EMAIL_USE_TLS', EMAIL_USE_TLS) LMS_BASE = ENV_TOKENS.get('LMS_BASE') LMS_ROOT_URL = ENV_TOKENS.get('LMS_ROOT_URL') +LMS_INTERNAL_ROOT_URL = ENV_TOKENS.get('LMS_INTERNAL_ROOT_URL', LMS_ROOT_URL) +ENTERPRISE_API_URL = ENV_TOKENS.get('ENTERPRISE_API_URL', LMS_INTERNAL_ROOT_URL + '/enterprise/api/v1/') +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. SITE_NAME = ENV_TOKENS['SITE_NAME'] diff --git a/cms/envs/common.py b/cms/envs/common.py index 4e80921d86..00472262e4 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -378,9 +378,10 @@ AUTHENTICATION_BACKENDS = [ LMS_BASE = None LMS_ROOT_URL = "http://localhost:8000" +LMS_INTERNAL_ROOT_URL = LMS_ROOT_URL LMS_ENROLLMENT_API_PATH = "/api/enrollment/v1/" -ENTERPRISE_API_URL = LMS_ROOT_URL + '/enterprise/api/v1/' -ENTERPRISE_CONSENT_API_URL = LMS_ROOT_URL + '/consent/api/v1/' +ENTERPRISE_API_URL = LMS_INTERNAL_ROOT_URL + '/enterprise/api/v1/' +ENTERPRISE_CONSENT_API_URL = LMS_INTERNAL_ROOT_URL + '/consent/api/v1/' # 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. diff --git a/lms/envs/aws.py b/lms/envs/aws.py index fa373d74af..878cc7f894 100644 --- a/lms/envs/aws.py +++ b/lms/envs/aws.py @@ -185,6 +185,7 @@ EDXMKTG_LOGGED_IN_COOKIE_NAME = ENV_TOKENS.get('EDXMKTG_LOGGED_IN_COOKIE_NAME', EDXMKTG_USER_INFO_COOKIE_NAME = ENV_TOKENS.get('EDXMKTG_USER_INFO_COOKIE_NAME', 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) ENV_FEATURES = ENV_TOKENS.get('FEATURES', {}) for feature, value in ENV_FEATURES.items(): @@ -958,7 +959,7 @@ ENTERPRISE_PUBLIC_ENROLLMENT_API_URL = ENV_TOKENS.get( # Enrollment URL used on the server-side. ENTERPRISE_ENROLLMENT_API_URL = ENV_TOKENS.get( 'ENTERPRISE_ENROLLMENT_API_URL', - ENTERPRISE_ENROLLMENT_API_URL + (LMS_INTERNAL_ROOT_URL or '') + LMS_ENROLLMENT_API_PATH ) # Enterprise logo image size limit in KB's @@ -994,13 +995,13 @@ ENTERPRISE_REPORTING_SECRET = AUTH_TOKENS.get( # 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/' +if LMS_INTERNAL_ROOT_URL is not None: + DEFAULT_ENTERPRISE_API_URL = LMS_INTERNAL_ROOT_URL + '/enterprise/api/v1/' ENTERPRISE_API_URL = ENV_TOKENS.get('ENTERPRISE_API_URL', DEFAULT_ENTERPRISE_API_URL) DEFAULT_ENTERPRISE_CONSENT_API_URL = None -if LMS_ROOT_URL is not None: - DEFAULT_ENTERPRISE_CONSENT_API_URL = LMS_ROOT_URL + '/consent/api/v1/' +if LMS_INTERNAL_ROOT_URL is not None: + DEFAULT_ENTERPRISE_CONSENT_API_URL = LMS_INTERNAL_ROOT_URL + '/consent/api/v1/' ENTERPRISE_CONSENT_API_URL = ENV_TOKENS.get('ENTERPRISE_CONSENT_API_URL', DEFAULT_ENTERPRISE_CONSENT_API_URL) ENTERPRISE_SERVICE_WORKER_USERNAME = ENV_TOKENS.get( diff --git a/lms/envs/common.py b/lms/envs/common.py index d3dc941338..a5ac1883ee 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -65,6 +65,7 @@ DISCUSSION_SETTINGS = { } LMS_ROOT_URL = "http://localhost:8000" +LMS_INTERNAL_ROOT_URL = LMS_ROOT_URL LMS_ENROLLMENT_API_PATH = "/api/enrollment/v1/" # Features @@ -3325,8 +3326,8 @@ derived('HELP_TOKENS_LANGUAGE_CODE', 'HELP_TOKENS_VERSION') # # Only used if FEATURES['ENABLE_ENTERPRISE_INTEGRATION'] == True. -ENTERPRISE_ENROLLMENT_API_URL = LMS_ROOT_URL + LMS_ENROLLMENT_API_PATH -ENTERPRISE_PUBLIC_ENROLLMENT_API_URL = ENTERPRISE_ENROLLMENT_API_URL +ENTERPRISE_ENROLLMENT_API_URL = LMS_INTERNAL_ROOT_URL + LMS_ENROLLMENT_API_PATH +ENTERPRISE_PUBLIC_ENROLLMENT_API_URL = LMS_ROOT_URL + LMS_ENROLLMENT_API_PATH ENTERPRISE_COURSE_ENROLLMENT_AUDIT_MODES = ['audit', 'honor'] ENTERPRISE_SUPPORT_URL = '' # The default value of this needs to be a 16 character string @@ -3337,8 +3338,8 @@ ENTERPRISE_REPORTING_SECRET = '0000000000000000' # 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_CONSENT_API_URL = LMS_ROOT_URL + '/consent/api/v1/' +ENTERPRISE_API_URL = LMS_INTERNAL_ROOT_URL + '/enterprise/api/v1/' +ENTERPRISE_CONSENT_API_URL = LMS_INTERNAL_ROOT_URL + '/consent/api/v1/' ENTERPRISE_SERVICE_WORKER_USERNAME = 'enterprise_worker' ENTERPRISE_API_CACHE_TIMEOUT = 3600 # Value is in seconds ENTERPRISE_CUSTOMER_LOGO_IMAGE_SIZE = 512 # Enterprise logo image size limit in KB's diff --git a/lms/envs/devstack.py b/lms/envs/devstack.py index 74aa6a8e64..04e187a84b 100644 --- a/lms/envs/devstack.py +++ b/lms/envs/devstack.py @@ -20,7 +20,8 @@ CELERY_ALWAYS_EAGER = True HTTPS = 'off' LMS_ROOT_URL = 'http://localhost:8000' -ENTERPRISE_API_URL = LMS_ROOT_URL + '/enterprise/api/v1/' +LMS_INTERNAL_ROOT_URL = LMS_ROOT_URL +ENTERPRISE_API_URL = LMS_INTERNAL_ROOT_URL + '/enterprise/api/v1/' ################################ LOGGERS ###################################### diff --git a/lms/envs/devstack_docker.py b/lms/envs/devstack_docker.py index 3687cd07d7..145c28b3af 100644 --- a/lms/envs/devstack_docker.py +++ b/lms/envs/devstack_docker.py @@ -13,13 +13,14 @@ LMS_BASE = 'edx.devstack.lms:18000' CMS_BASE = 'edx.devstack.studio:18010' SITE_NAME = LMS_BASE LMS_ROOT_URL = 'http://{}'.format(LMS_BASE) +LMS_INTERNAL_ROOT_URL = LMS_ROOT_URL ECOMMERCE_PUBLIC_URL_ROOT = 'http://localhost:18130' ECOMMERCE_API_URL = 'http://edx.devstack.ecommerce:18130/api/v2' COMMENTS_SERVICE_URL = 'http://edx.devstack.forum:4567' -ENTERPRISE_API_URL = '{}/enterprise/api/v1/'.format(LMS_ROOT_URL) +ENTERPRISE_API_URL = '{}/enterprise/api/v1/'.format(LMS_INTERNAL_ROOT_URL) CREDENTIALS_INTERNAL_SERVICE_URL = 'http://edx.devstack.credentials:18150' CREDENTIALS_PUBLIC_SERVICE_URL = 'http://localhost:18150' diff --git a/requirements/edx/base.txt b/requirements/edx/base.txt index aeaf47c010..912dc60076 100644 --- a/requirements/edx/base.txt +++ b/requirements/edx/base.txt @@ -47,7 +47,7 @@ edx-lint==0.4.3 astroid==1.3.8 edx-django-oauth2-provider==1.2.5 edx-django-sites-extensions==2.3.0 -edx-enterprise==0.53.15 +edx-enterprise==0.53.16 edx-oauth2-provider==1.2.2 edx-opaque-keys==0.4.0 edx-organizations==0.4.8