From 55d2a4f8976feebecd3aba09e35ef480d4d2417d Mon Sep 17 00:00:00 2001 From: adeelehsan Date: Tue, 19 Jan 2021 00:39:24 +0500 Subject: [PATCH] Logistration MFE renamed to authn VAN-300 --- common/djangoapps/student/forms.py | 4 ++-- .../student/tests/test_activate_account.py | 4 ++-- common/djangoapps/student/views/management.py | 6 +++--- common/djangoapps/third_party_auth/pipeline.py | 6 +++--- lms/envs/common.py | 10 +++++----- lms/envs/devstack.py | 4 ++-- lms/envs/devstack_decentralized.py | 2 +- lms/envs/test.py | 4 ++-- lms/templates/header/navbar-not-authenticated.html | 12 ++++++------ openedx/core/djangoapps/user_authn/api/urls.py | 2 +- openedx/core/djangoapps/user_authn/api/views.py | 2 +- openedx/core/djangoapps/user_authn/urls_common.py | 4 ++-- openedx/core/djangoapps/user_authn/utils.py | 4 ++-- openedx/core/djangoapps/user_authn/views/login.py | 10 +++++----- .../core/djangoapps/user_authn/views/login_form.py | 8 ++++---- .../djangoapps/user_authn/views/password_reset.py | 4 ++-- .../djangoapps/user_authn/views/tests/test_login.py | 2 +- .../user_authn/views/tests/test_logistration.py | 6 +++--- .../user_authn/views/tests/test_reset_password.py | 8 ++++---- .../templates/header/navbar-not-authenticated.html | 8 ++++---- 20 files changed, 55 insertions(+), 55 deletions(-) diff --git a/common/djangoapps/student/forms.py b/common/djangoapps/student/forms.py index 91957b8139..0c251d3f26 100644 --- a/common/djangoapps/student/forms.py +++ b/common/djangoapps/student/forms.py @@ -22,7 +22,7 @@ from openedx.core.djangoapps.site_configuration import helpers as configuration_ from openedx.core.djangoapps.theming.helpers import get_current_site from openedx.core.djangoapps.user_api import accounts as accounts_settings from openedx.core.djangoapps.user_api.accounts.utils import is_secondary_email_feature_enabled -from openedx.core.djangoapps.user_authn.utils import should_redirect_to_logistration_mircrofrontend +from openedx.core.djangoapps.user_authn.utils import should_redirect_to_authn_microfrontend from openedx.core.djangoapps.user_api.preferences.api import get_user_preference from common.djangoapps.student.message_types import AccountRecovery as AccountRecoveryMessage from common.djangoapps.student.models import CourseEnrollmentAllowed, email_exists_or_retired @@ -39,7 +39,7 @@ def send_account_recovery_email_for_user(user, request, email=None): """ site = get_current_site() message_context = get_base_template_context(site) - site_name = settings.LOGISTRATION_MICROFRONTEND_DOMAIN if should_redirect_to_logistration_mircrofrontend() \ + site_name = settings.AUTHN_MICROFRONTEND_DOMAIN if should_redirect_to_authn_microfrontend() \ else configuration_helpers.get_value('SITE_NAME', settings.SITE_NAME) message_context.update({ 'request': request, # Used by google_analytics_tracking_pixel diff --git a/common/djangoapps/student/tests/test_activate_account.py b/common/djangoapps/student/tests/test_activate_account.py index dbee6142e4..c6b794e88a 100644 --- a/common/djangoapps/student/tests/test_activate_account.py +++ b/common/djangoapps/student/tests/test_activate_account.py @@ -16,7 +16,7 @@ from common.djangoapps.student.tests.factories import UserFactory FEATURES_WITH_LOGIN_MFE_ENABLED = settings.FEATURES.copy() -FEATURES_WITH_LOGIN_MFE_ENABLED['ENABLE_LOGISTRATION_MICROFRONTEND'] = True +FEATURES_WITH_LOGIN_MFE_ENABLED['ENABLE_AUTHN_MICROFRONTEND'] = True @unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms') @@ -158,7 +158,7 @@ class TestActivateAccount(TestCase): login page with correct query param. """ login_page_url = "{authn_mfe}/login?account_activation_status=".format( - authn_mfe=settings.LOGISTRATION_MICROFRONTEND_URL + authn_mfe=settings.AUTHN_MICROFRONTEND_URL ) self._assert_user_active_state(expected_active_state=False) diff --git a/common/djangoapps/student/views/management.py b/common/djangoapps/student/views/management.py index d69a4a268a..a5c58b81fb 100644 --- a/common/djangoapps/student/views/management.py +++ b/common/djangoapps/student/views/management.py @@ -50,7 +50,7 @@ from openedx.core.djangoapps.programs.models import ProgramsApiConfig from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers from openedx.core.djangoapps.theming import helpers as theming_helpers from openedx.core.djangoapps.user_api.preferences import api as preferences_api -from openedx.core.djangoapps.user_authn.utils import should_redirect_to_logistration_mircrofrontend +from openedx.core.djangoapps.user_authn.utils import should_redirect_to_authn_microfrontend from openedx.core.djangolib.markup import HTML, Text from common.djangoapps.student.helpers import DISABLE_UNENROLL_CERT_STATES, cert_info, generate_activation_email_context from common.djangoapps.student.message_types import AccountActivation, EmailChange, EmailChangeConfirmation, RecoveryEmailCreate @@ -547,9 +547,9 @@ def activate_account(request, key): extra_tags='account-activation aa-icon', ) - if should_redirect_to_logistration_mircrofrontend() and not request.user.is_authenticated: + if should_redirect_to_authn_microfrontend() and not request.user.is_authenticated: url_path = '/login?account_activation_status={}'.format(activation_message_type) - return redirect(settings.LOGISTRATION_MICROFRONTEND_URL + url_path) + return redirect(settings.AUTHN_MICROFRONTEND_URL + url_path) return redirect('dashboard') diff --git a/common/djangoapps/third_party_auth/pipeline.py b/common/djangoapps/third_party_auth/pipeline.py index 1ee706be93..16dd6af771 100644 --- a/common/djangoapps/third_party_auth/pipeline.py +++ b/common/djangoapps/third_party_auth/pipeline.py @@ -88,7 +88,7 @@ from lms.djangoapps.verify_student.utils import earliest_allowed_verification_da from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers from openedx.core.djangoapps.user_api import accounts from openedx.core.djangoapps.user_authn import cookies as user_authn_cookies -from openedx.core.djangoapps.user_authn.utils import should_redirect_to_logistration_mircrofrontend +from openedx.core.djangoapps.user_authn.utils import should_redirect_to_authn_microfrontend from common.djangoapps.third_party_auth.utils import user_exists from common.djangoapps.track import segment from common.djangoapps.util.json_request import JsonResponse @@ -129,8 +129,8 @@ AUTH_ENTRY_REGISTER_API = 'register_api' # registration/login form/logic. AUTH_ENTRY_CUSTOM = getattr(settings, 'THIRD_PARTY_AUTH_CUSTOM_AUTH_FORMS', {}) -# If logistration MFE is enabled, the redirect should be to MFE instead of FE -BASE_URL = settings.LOGISTRATION_MICROFRONTEND_URL if should_redirect_to_logistration_mircrofrontend() else '' +# If authn MFE is enabled, the redirect should be to MFE instead of FE +BASE_URL = settings.AUTHN_MICROFRONTEND_URL if should_redirect_to_authn_microfrontend() else '' def is_api(auth_entry): diff --git a/lms/envs/common.py b/lms/envs/common.py index 16866bfa8f..f5a485b079 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -643,7 +643,7 @@ FEATURES = { # rollout. 'ENABLE_COURSEWARE_MICROFRONTEND': False, - # .. toggle_name: FEATURES['ENABLE_LOGISTRATION_MICROFRONTEND'] + # .. toggle_name: FEATURES['ENABLE_AUTHN_MICROFRONTEND'] # .. toggle_implementation: DjangoSetting # .. toggle_default: False # .. toggle_description: Supports staged rollout of a new micro-frontend-based implementation of the logistration. @@ -651,9 +651,9 @@ FEATURES = { # .. toggle_creation_date: 2020-09-08 # .. toggle_target_removal_date: None # .. toggle_tickets: 'https://github.com/edx/edx-platform/pull/24908' - # .. toggle_warnings: Also set settings.LOGISTRATION_MICROFRONTEND_URL for rollout. This temporary feature + # .. toggle_warnings: Also set settings.AUTHN_MICROFRONTEND_URL for rollout. This temporary feature # toggle does not have a target removal date. - 'ENABLE_LOGISTRATION_MICROFRONTEND': False, + 'ENABLE_AUTHN_MICROFRONTEND': False, ### ORA Feature Flags ### # .. toggle_name: FEATURES['ENABLE_ORA_ALL_FILE_URLS'] @@ -4090,8 +4090,8 @@ WRITABLE_GRADEBOOK_URL = None PROFILE_MICROFRONTEND_URL = None ORDER_HISTORY_MICROFRONTEND_URL = None ACCOUNT_MICROFRONTEND_URL = None -LOGISTRATION_MICROFRONTEND_URL = None -LOGISTRATION_MICROFRONTEND_DOMAIN = None +AUTHN_MICROFRONTEND_URL = None +AUTHN_MICROFRONTEND_DOMAIN = None PROGRAM_CONSOLE_MICROFRONTEND_URL = None LEARNING_MICROFRONTEND_URL = None diff --git a/lms/envs/devstack.py b/lms/envs/devstack.py index 943d76ff0e..a7bd7f0f98 100644 --- a/lms/envs/devstack.py +++ b/lms/envs/devstack.py @@ -331,8 +331,8 @@ EDXNOTES_CLIENT_NAME = 'edx_notes_api-backend-service' ############## Settings for Microfrontends ######################### LEARNING_MICROFRONTEND_URL = 'http://localhost:2000' ACCOUNT_MICROFRONTEND_URL = 'http://localhost:1997' -LOGISTRATION_MICROFRONTEND_URL = 'http://localhost:1999' -LOGISTRATION_MICROFRONTEND_DOMAIN = 'localhost:1999' +AUTHN_MICROFRONTEND_URL = 'http://localhost:1999' +AUTHN_MICROFRONTEND_DOMAIN = 'localhost:1999' ############## Docker based devstack settings ####################### diff --git a/lms/envs/devstack_decentralized.py b/lms/envs/devstack_decentralized.py index bf9dab9c5f..a622aeae7f 100644 --- a/lms/envs/devstack_decentralized.py +++ b/lms/envs/devstack_decentralized.py @@ -269,7 +269,7 @@ EDXNOTES_CLIENT_NAME = 'edx_notes_api-backend-service' ############## Settings for Microfrontends ######################### LEARNING_MICROFRONTEND_URL = 'http://localhost:2000' ACCOUNT_MICROFRONTEND_URL = 'http://localhost:1997' -LOGISTRATION_MICROFRONTEND_URL = 'http://localhost:1999' +AUTHN_MICROFRONTEND_URL = 'http://localhost:1999' ############## Docker based devstack settings ####################### diff --git a/lms/envs/test.py b/lms/envs/test.py index c22875dc02..02ba591b2e 100644 --- a/lms/envs/test.py +++ b/lms/envs/test.py @@ -569,8 +569,8 @@ PDF_RECEIPT_TAX_ID_LABEL = 'Tax ID' PROFILE_MICROFRONTEND_URL = "http://profile-mfe/abc/" ORDER_HISTORY_MICROFRONTEND_URL = "http://order-history-mfe/" ACCOUNT_MICROFRONTEND_URL = "http://account-mfe" -LOGISTRATION_MICROFRONTEND_URL = "http://logistation-mfe" -LOGISTRATION_MICROFRONTEND_DOMAIN = "logistation-mfe" +AUTHN_MICROFRONTEND_URL = "http://authn-mfe" +AUTHN_MICROFRONTEND_DOMAIN = "authn-mfe" LEARNING_MICROFRONTEND_URL = "http://learning-mfe" ########################## limiting dashboard courses ###################### diff --git a/lms/templates/header/navbar-not-authenticated.html b/lms/templates/header/navbar-not-authenticated.html index 84bcafb348..5a7daf64b3 100644 --- a/lms/templates/header/navbar-not-authenticated.html +++ b/lms/templates/header/navbar-not-authenticated.html @@ -11,7 +11,7 @@ from django.urls import reverse from django.utils.translation import ugettext as _ from six import text_type -from openedx.core.djangoapps.user_authn.utils import should_redirect_to_logistration_mircrofrontend +from openedx.core.djangoapps.user_authn.utils import should_redirect_to_authn_microfrontend %> <% @@ -20,7 +20,7 @@ from openedx.core.djangoapps.user_authn.utils import should_redirect_to_logistra allows_login = not settings.FEATURES['DISABLE_LOGIN_BUTTON'] and not combined_login_and_register can_discover_courses = settings.FEATURES.get('ENABLE_COURSE_DISCOVERY') allow_public_account_creation = static.get_value('ALLOW_PUBLIC_ACCOUNT_CREATION', settings.FEATURES.get('ALLOW_PUBLIC_ACCOUNT_CREATION')) - should_redirect_to_logistration_mfe = should_redirect_to_logistration_mircrofrontend() + should_redirect_to_authn_mfe = should_redirect_to_authn_microfrontend() %>