From 8695950c63cf832c9f8c954ff2f1cc8fe35bf854 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Fernanda=20Magallanes=20Z?= Date: Fri, 20 May 2022 18:26:13 -0400 Subject: [PATCH 1/2] feat: make mfe config api disabled by default --- lms/envs/common.py | 12 ++++++++++++ lms/urls.py | 7 ++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/lms/envs/common.py b/lms/envs/common.py index 888abbacea49..dfdc22e71eaa 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -985,6 +985,18 @@ # .. toggle_warnings: For consistency in user-experience, keep the value in sync with the setting of the same name # in the LMS and CMS. 'MARK_LIBRARY_CONTENT_BLOCK_COMPLETE_ON_VIEW': False, + + # .. toggle_name: FEATURES['ENABLE_MFE_CONFIG_API'] + # .. toggle_implementation: DjangoSetting + # .. toggle_default: False + # .. toggle_description: Set to True to enable MFE Config REST API. This is disabled by + # default. + # .. toggle_use_cases: open_edx + # .. toggle_creation_date: 2022-05-20 + # .. toggle_target_removal_date: None + # .. toggle_warnings: None + # .. toggle_tickets: None + 'ENABLE_MFE_CONFIG_API' : os.environ.get("EDXAPP_ENABLE_MFE_CONFIG_API", False), } # Specifies extra XBlock fields that should available when requested via the Course Blocks API diff --git a/lms/urls.py b/lms/urls.py index 9fa61c0e8e3f..1abb83e35c9c 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -1041,6 +1041,7 @@ path('api/ora_staff_grader/', include('lms.djangoapps.ora_staff_grader.urls', 'ora-staff-grader')), ] -urlpatterns +=[ - path('api/mfe/', include('openedx.core.djangoapps.mfe_api.urls')) -] +if settings.FEATURES.get('ENABLE_MFE_CONFIG_API'): + urlpatterns +=[ + path('api/mfe/', include('openedx.core.djangoapps.mfe_api.urls')) + ] From 03f6a38dc3be089c983c82aaeecd28e87eb1391d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Fernanda=20Magallanes=20Z?= Date: Fri, 20 May 2022 18:53:49 -0400 Subject: [PATCH 2/2] fix: simple is better than complex --- lms/envs/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lms/envs/common.py b/lms/envs/common.py index dfdc22e71eaa..67ff1d40569c 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -996,7 +996,7 @@ # .. toggle_target_removal_date: None # .. toggle_warnings: None # .. toggle_tickets: None - 'ENABLE_MFE_CONFIG_API' : os.environ.get("EDXAPP_ENABLE_MFE_CONFIG_API", False), + 'ENABLE_MFE_CONFIG_API' : False, } # Specifies extra XBlock fields that should available when requested via the Course Blocks API