diff --git a/cms/envs/aws.py b/cms/envs/aws.py index 5e96be8785c852dd6369a9f6e01b1f963e41ea0c..4bcf9a3f68984e8f0a4a14c9ec12edc1c6483aef 100644 --- a/cms/envs/aws.py +++ b/cms/envs/aws.py @@ -445,9 +445,6 @@ EVENT_TRACKING_BACKENDS['segmentio']['OPTIONS']['processors'][0]['OPTIONS']['whi VIRTUAL_UNIVERSITIES = ENV_TOKENS.get('VIRTUAL_UNIVERSITIES', []) -# Zendesk -ZENDESK_OAUTH_ACCESS_TOKEN = AUTH_TOKENS.get("ZENDESK_OAUTH_ACCESS_TOKEN") - ##### ACCOUNT LOCKOUT DEFAULT PARAMETERS ##### MAX_FAILED_LOGIN_ATTEMPTS_ALLOWED = ENV_TOKENS.get("MAX_FAILED_LOGIN_ATTEMPTS_ALLOWED", 5) MAX_FAILED_LOGIN_ATTEMPTS_LOCKOUT_PERIOD_SECS = ENV_TOKENS.get("MAX_FAILED_LOGIN_ATTEMPTS_LOCKOUT_PERIOD_SECS", 15 * 60) diff --git a/cms/envs/common.py b/cms/envs/common.py index fd3c7ad784eeadc529d7195e33c5edea807cc238..6fc52346cd4dec3a5eedb5cdac3797deeaac680c 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -1493,7 +1493,6 @@ VIDEO_IMAGE_ASPECT_RATIO_ERROR_MARGIN = 0.1 ZENDESK_URL = None ZENDESK_USER = None ZENDESK_API_KEY = None -ZENDESK_OAUTH_ACCESS_TOKEN = None ZENDESK_CUSTOM_FIELDS = {} diff --git a/cms/urls.py b/cms/urls.py index ecdc29a308f05e0810dea74283eb6a9a3667e1b7..4bf756f9d3e9cc8ba5cffe848b7adb03df0db0a1 100644 --- a/cms/urls.py +++ b/cms/urls.py @@ -157,7 +157,6 @@ urlpatterns = [ url(r'^api/val/v0/', include('edxval.urls')), url(r'^api/tasks/v0/', include('user_tasks.urls')), url(r'^accessibility$', contentstore.views.accessibility, name='accessibility'), - url(r'^zendesk_proxy/', include('openedx.core.djangoapps.zendesk_proxy.urls')), ] JS_INFO_DICT = { diff --git a/lms/envs/aws.py b/lms/envs/aws.py index 2d9c9a94275e730ea61f032b77bf2084c9824b1a..6039d72aa8d1824c7d3c3c83bfddd81e1cc7416a 100644 --- a/lms/envs/aws.py +++ b/lms/envs/aws.py @@ -598,7 +598,6 @@ MAILCHIMP_NEW_USER_LIST_ID = ENV_TOKENS.get("MAILCHIMP_NEW_USER_LIST_ID") # Zendesk ZENDESK_USER = AUTH_TOKENS.get("ZENDESK_USER") ZENDESK_API_KEY = AUTH_TOKENS.get("ZENDESK_API_KEY") -ZENDESK_OAUTH_ACCESS_TOKEN = AUTH_TOKENS.get("ZENDESK_OAUTH_ACCESS_TOKEN") # API Key for inbound requests from Notifier service EDX_API_KEY = AUTH_TOKENS.get("EDX_API_KEY") diff --git a/lms/envs/common.py b/lms/envs/common.py index e6b1d5bac32da6970ea0a2f5287184439c8c078f..1e2fdb0d47b9add7d9befb7083d6fffa4dec2c20 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -1143,7 +1143,6 @@ FEEDBACK_SUBMISSION_EMAIL = None ZENDESK_URL = None ZENDESK_USER = None ZENDESK_API_KEY = None -ZENDESK_OAUTH_ACCESS_TOKEN = None ZENDESK_CUSTOM_FIELDS = {} ##### EMBARGO ##### diff --git a/lms/urls.py b/lms/urls.py index 0a262dbd4f89e46fca23577df20c03c80e44e1f8..d926079540b2c779fd2d94fadbacbd1cf056b72d 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -139,9 +139,6 @@ urlpatterns = [ url(r'^dashboard/', include('learner_dashboard.urls')), url(r'^api/experiments/', include('experiments.urls', namespace='api_experiments')), - - # Zendesk API proxy endpoint - url(r'^zendesk_proxy/', include('openedx.core.djangoapps.zendesk_proxy.urls')), ] # TODO: This needs to move to a separate urls.py once the student_account and diff --git a/openedx/core/djangoapps/zendesk_proxy/apps.py b/openedx/core/djangoapps/zendesk_proxy/apps.py new file mode 100644 index 0000000000000000000000000000000000000000..fbe6da2572be430530713184272f21bbc04d5e9d --- /dev/null +++ b/openedx/core/djangoapps/zendesk_proxy/apps.py @@ -0,0 +1,40 @@ +""" +Zendesk Proxy Configuration + +""" + +from django.apps import AppConfig + +from openedx.core.djangoapps.plugins.constants import ProjectType, SettingsType, PluginURLs, PluginSettings + + +class ZendeskProxyConfig(AppConfig): + """ + AppConfig for zendesk proxy app + """ + name = 'openedx.core.djangoapps.zendesk_proxy' + + plugin_app = { + PluginURLs.CONFIG: { + ProjectType.CMS: { + PluginURLs.NAMESPACE: u'', + PluginURLs.REGEX: r'^zendesk_proxy/', + PluginURLs.RELATIVE_PATH: u'urls', + }, + ProjectType.LMS: { + PluginURLs.NAMESPACE: u'', + PluginURLs.REGEX: r'^zendesk_proxy/', + PluginURLs.RELATIVE_PATH: u'urls', + } + }, + PluginSettings.CONFIG: { + ProjectType.CMS: { + SettingsType.COMMON: {PluginSettings.RELATIVE_PATH: u'settings.common'}, + SettingsType.AWS: {PluginSettings.RELATIVE_PATH: u'settings.aws'}, + }, + ProjectType.LMS: { + SettingsType.COMMON: {PluginSettings.RELATIVE_PATH: u'settings.common'}, + SettingsType.AWS: {PluginSettings.RELATIVE_PATH: u'settings.aws'}, + } + } + } diff --git a/openedx/core/djangoapps/zendesk_proxy/settings/__init__.py b/openedx/core/djangoapps/zendesk_proxy/settings/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/openedx/core/djangoapps/zendesk_proxy/settings/aws.py b/openedx/core/djangoapps/zendesk_proxy/settings/aws.py new file mode 100644 index 0000000000000000000000000000000000000000..93635bfbe3f2ec73ae8428a9af6fe8149a6ef9a8 --- /dev/null +++ b/openedx/core/djangoapps/zendesk_proxy/settings/aws.py @@ -0,0 +1,6 @@ +""" Production settings for zendesk proxy.""" + + +def plugin_settings(settings): + settings.ZENDESK_URL = settings.ENV_TOKENS.get('ZENDESK_URL', settings.ZENDESK_URL) + settings.ZENDESK_OAUTH_ACCESS_TOKEN = settings.AUTH_TOKENS.get("ZENDESK_OAUTH_ACCESS_TOKEN") diff --git a/openedx/core/djangoapps/zendesk_proxy/settings/common.py b/openedx/core/djangoapps/zendesk_proxy/settings/common.py new file mode 100644 index 0000000000000000000000000000000000000000..76135cdb1822d5a7ec543d0c6637d3d2723c26bc --- /dev/null +++ b/openedx/core/djangoapps/zendesk_proxy/settings/common.py @@ -0,0 +1,6 @@ +""" Common settings for zendesk proxy.""" + + +def plugin_settings(settings): + settings.ZENDESK_URL = None + settings.ZENDESK_OAUTH_ACCESS_TOKEN = None diff --git a/setup.py b/setup.py index 3485a974058f5899138d215d213abf8b3ca174e8..2efb490bc59798257661920226889da11ee51313 100644 --- a/setup.py +++ b/setup.py @@ -72,6 +72,7 @@ setup( "theming = openedx.core.djangoapps.theming.apps:ThemingConfig", "instructor = lms.djangoapps.instructor.apps:InstructorConfig", "bookmarks = openedx.core.djangoapps.bookmarks.apps:BookmarksConfig", + "zendesk_proxy = openedx.core.djangoapps.zendesk_proxy.apps:ZendeskProxyConfig", ], "cms.djangoapp": [ "ace_common = openedx.core.djangoapps.ace_common.apps:AceCommonConfig", @@ -79,6 +80,7 @@ setup( "schedules = openedx.core.djangoapps.schedules.apps:SchedulesConfig", "theming = openedx.core.djangoapps.theming.apps:ThemingConfig", "bookmarks = openedx.core.djangoapps.bookmarks.apps:BookmarksConfig", + "zendesk_proxy = openedx.core.djangoapps.zendesk_proxy.apps:ZendeskProxyConfig", ], } )