passbolt-styleguide 3.8.4 → 3.9.0-alpha2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/css/help.min.css +3 -3
- package/build/css/public.min.css +3 -3
- package/build/css/themes/default/api_authentication.min.css +3 -3
- package/build/css/themes/default/api_cloud.min.css +3 -3
- package/build/css/themes/default/api_main.min.css +3 -3
- package/build/css/themes/default/api_reports.min.css +3 -3
- package/build/css/themes/default/api_webinstaller.min.css +3 -3
- package/build/css/themes/default/ext_app.min.css +3 -3
- package/build/css/themes/default/ext_authentication.min.css +3 -3
- package/build/css/themes/default/ext_external.min.css +2 -2
- package/build/css/themes/default/ext_in_form_cta.min.css +3 -3
- package/build/css/themes/default/ext_in_form_menu.min.css +3 -3
- package/build/css/themes/default/ext_quickaccess.min.css +3 -3
- package/build/css/themes/midgar/api_authentication.min.css +3 -3
- package/build/css/themes/midgar/api_main.min.css +3 -3
- package/build/css/themes/midgar/api_reports.min.css +3 -3
- package/build/css/themes/midgar/ext_app.min.css +3 -3
- package/build/css/themes/midgar/ext_authentication.min.css +3 -3
- package/build/css/themes/midgar/ext_in_form_cta.min.css +3 -3
- package/build/css/themes/midgar/ext_in_form_menu.min.css +3 -3
- package/build/css/themes/midgar/ext_quickaccess.min.css +3 -3
- package/build/css/themes/solarized_dark/api_authentication.min.css +1 -1
- package/build/css/themes/solarized_dark/api_main.min.css +1 -1
- package/build/css/themes/solarized_dark/api_reports.min.css +1 -1
- package/build/css/themes/solarized_dark/ext_app.min.css +1 -1
- package/build/css/themes/solarized_dark/ext_authentication.min.css +1 -1
- package/build/css/themes/solarized_dark/ext_in_form_cta.min.css +1 -1
- package/build/css/themes/solarized_dark/ext_in_form_menu.min.css +1 -1
- package/build/css/themes/solarized_dark/ext_quickaccess.min.css +1 -1
- package/build/css/themes/solarized_light/api_authentication.min.css +1 -1
- package/build/css/themes/solarized_light/api_main.min.css +1 -1
- package/build/css/themes/solarized_light/api_reports.min.css +1 -1
- package/build/css/themes/solarized_light/ext_app.min.css +1 -1
- package/build/css/themes/solarized_light/ext_authentication.min.css +1 -1
- package/build/css/themes/solarized_light/ext_in_form_cta.min.css +1 -1
- package/build/css/themes/solarized_light/ext_in_form_menu.min.css +1 -1
- package/build/css/themes/solarized_light/ext_quickaccess.min.css +1 -1
- package/build/js/dist/api-account-recovery.js +1 -1
- package/build/js/dist/api-app.js +1 -1
- package/build/js/dist/api-app.js.LICENSE.txt +75 -5
- package/build/js/dist/api-feedback.js +2 -0
- package/build/js/dist/api-feedback.js.LICENSE.txt +45 -0
- package/build/js/dist/api-recover.js +1 -1
- package/build/js/dist/api-setup.js +1 -1
- package/build/js/dist/api-triage.js +1 -1
- package/build/js/dist/api-vendors.js +1 -1
- package/build/js/dist/api-vendors.js.LICENSE.txt +19 -9
- package/build/js/dist/src/locales/de-DE/common.json +995 -0
- package/build/js/dist/src/locales/en-UK/common.json +1061 -0
- package/build/js/dist/src/locales/es-ES/common.json +995 -0
- package/build/js/dist/src/locales/fr-FR/common.json +995 -0
- package/build/js/dist/src/locales/ja-JP/common.json +980 -0
- package/build/js/dist/src/locales/lt-LT/common.json +1025 -0
- package/build/js/dist/src/locales/nl-NL/common.json +995 -0
- package/build/js/dist/src/locales/pl-PL/common.json +1025 -0
- package/build/js/dist/src/locales/sv-SE/common.json +995 -0
- package/package.json +18 -1
- package/src/img/controls/attention.svg +1 -0
- package/src/locales/en-UK/common.json +80 -16
- package/src/react-extension/ApiApp.js +17 -5
- package/src/react-extension/ApiFeedback.entry.js +24 -0
- package/src/react-extension/ExtApp.js +12 -5
- package/src/react-extension/ExtAuthenticationLogin.js +17 -15
- package/src/react-extension/ExtAuthenticationLogin.test.stories.js +59 -0
- package/src/react-extension/ExtBootstrapApp.js +1 -0
- package/src/react-extension/components/Administration/AdministrationWorkspace.js +24 -0
- package/src/react-extension/components/Administration/AdministrationWorkspace.test.data.js +3 -3
- package/src/react-extension/components/Administration/AdministrationWorkspace.test.js +13 -1
- package/src/react-extension/components/Administration/AdministrationWorkspace.test.page.js +7 -0
- package/src/react-extension/components/Administration/ConfirmDeleteSsoSettingsDialog/ConfirmDeleteSsoSettingsDialog.js +101 -0
- package/src/react-extension/components/Administration/ConfirmDeleteSsoSettingsDialog/ConfirmDeleteSsoSettingsDialog.test.data.js +23 -0
- package/src/react-extension/components/Administration/ConfirmDeleteSsoSettingsDialog/ConfirmDeleteSsoSettingsDialog.test.stories.js +27 -0
- package/src/react-extension/components/Administration/ConfirmSaveAccountRecoverySettings/ConfirmSaveAccountRecoverySettings.js +1 -1
- package/src/react-extension/components/Administration/DisplayAdministrationMenu/DisplayAdministrationMenu.js +78 -2
- package/src/react-extension/components/Administration/DisplayAdministrationMenu/DisplayAdministrationMenu.test.data.js +3 -1
- package/src/react-extension/components/Administration/DisplayAdministrationMenu/DisplayAdministrationMenu.test.js +60 -0
- package/src/react-extension/components/Administration/DisplayAdministrationMenu/DisplayAdministrationMenu.test.page.js +23 -4
- package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceActions/DisplayAdministrationInternationalisationActions/DisplayAdministrationInternationalisationActions.js +125 -0
- package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceActions/DisplayAdministrationMfaActions/DisplayAdministrationMfaActions.js +131 -0
- package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceActions/DisplayAdministrationSelfRegistrationActions/DisplayAdministrationSelfRegistrationActions.js +103 -0
- package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceActions/DisplayAdministrationSsoActions/DisplayAdministrationSsoActions.js +91 -0
- package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceActions/DisplayAdministrationSubscriptionActions/DisplayAdministrationSubscriptionActions.js +85 -0
- package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceActions/DisplayAdministrationUserDirectoryActions/DisplayAdministrationUserDirectoryActions.js +228 -0
- package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceBreadcrumb/DisplayAdministrationWorkspaceBreadcrumb.js +4 -0
- package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceBreadcrumb/DisplayAdministrationWorkspaceBreadcrumb.test.js +9 -0
- package/src/react-extension/components/Administration/DisplayEmailNotificationsAdministration/DisplayEmailNotificationsAdministration.js +3 -3
- package/src/react-extension/components/Administration/DisplayEmailNotificationsAdministration/DisplayEmailNotificationsAdministration.test.data.js +14 -0
- package/src/react-extension/components/Administration/DisplayEmailNotificationsAdministration/DisplayEmailNotificationsAdministration.test.page.js +0 -17
- package/src/react-extension/components/Administration/DisplayInternationalizationAdministration/DisplayInternationalizationAdministration.js +18 -115
- package/src/react-extension/components/Administration/DisplayInternationalizationAdministration/DisplayInternationalizationAdministration.test.data.js +11 -13
- package/src/react-extension/components/Administration/DisplayInternationalizationAdministration/DisplayInternationalizationAdministration.test.js +38 -43
- package/src/react-extension/components/Administration/DisplayInternationalizationAdministration/DisplayInternationalizationAdministration.test.page.js +47 -10
- package/src/react-extension/components/Administration/DisplayInternationalizationAdministration/DisplayInternationalizationAdministration.test.stories.js +10 -43
- package/src/react-extension/components/Administration/DisplayMfaAdministration/DisplayMfaAdministration.js +82 -367
- package/src/react-extension/components/Administration/DisplayMfaAdministration/DisplayMfaAdministration.test.data.js +128 -42
- package/src/react-extension/components/Administration/DisplayMfaAdministration/DisplayMfaAdministration.test.js +75 -121
- package/src/react-extension/components/Administration/DisplayMfaAdministration/DisplayMfaAdministration.test.page.js +46 -16
- package/src/react-extension/components/Administration/DisplayMfaAdministration/DisplayMfaAdministration.test.stories.js +18 -14
- package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/ConfirmDeletionSelfRegistrationSettings/ConfirmDeletionSelfRegistrationSettings.js +103 -0
- package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/ConfirmDeletionSelfRegistrationSettings/ConfirmDeletionSelfRegistrationSettings.test.js +53 -0
- package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/ConfirmDeletionSelfRegistrationSettings/ConfirmDeletionSelfRegistrationSettings.test.page.js +81 -0
- package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/ConfirmDeletionSelfRegistrationSettings/ConfirmDeletionSelfRegistrationSettings.test.stories.js +34 -0
- package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/ConfirmSaveSelfRegistrationSettings/ConfirmSaveSelfRegistrationSettings.js +125 -0
- package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/ConfirmSaveSelfRegistrationSettings/ConfirmSaveSelfRegistrationSettings.test.data.js +63 -0
- package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/ConfirmSaveSelfRegistrationSettings/ConfirmSaveSelfRegistrationSettings.test.js +54 -0
- package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/ConfirmSaveSelfRegistrationSettings/ConfirmSaveSelfRegistrationSettings.test.page.js +88 -0
- package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/ConfirmSaveSelfRegistrationSettings/ConfirmSaveSelfRegistrationSettings.test.stories.js +35 -0
- package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/DisplaySelfRegistrationAdministration.js +381 -0
- package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/DisplaySelfRegistrationAdministration.test.data.js +69 -0
- package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/DisplaySelfRegistrationAdministration.test.js +332 -0
- package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/DisplaySelfRegistrationAdministration.test.page.js +247 -0
- package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/DisplaySelfRegistrationAdministration.test.stories.js +72 -0
- package/src/react-extension/components/Administration/DisplaySimulateSynchronizeUserDirectoryAdministration/DisplaySimulateSynchronizeUserDirectoryAdministration.js +19 -19
- package/src/react-extension/components/Administration/DisplaySimulateSynchronizeUserDirectoryAdministration/DisplaySimulateSynchronizeUserDirectoryAdministration.test.data.js +1717 -1729
- package/src/react-extension/components/Administration/DisplaySimulateSynchronizeUserDirectoryAdministration/DisplaySimulateSynchronizeUserDirectoryAdministration.test.js +11 -3
- package/src/react-extension/components/Administration/DisplaySimulateSynchronizeUserDirectoryAdministration/DisplaySimulateSynchronizeUserDirectoryAdministration.test.page.js +4 -1
- package/src/react-extension/components/Administration/DisplaySimulateSynchronizeUserDirectoryAdministration/DisplaySimulateSynchronizeUserDirectoryAdministration.test.stories.js +11 -1784
- package/src/react-extension/components/Administration/DisplaySubscriptionKey/DisplaySubscriptionKey.js +41 -140
- package/src/react-extension/components/Administration/DisplaySubscriptionKey/DisplaySubscriptionKey.test.data.js +15 -3
- package/src/react-extension/components/Administration/DisplaySubscriptionKey/DisplaySubscriptionKey.test.js +22 -49
- package/src/react-extension/components/Administration/DisplaySubscriptionKey/DisplaySubscriptionKey.test.page.js +19 -11
- package/src/react-extension/components/Administration/DisplaySubscriptionKey/DisplaySubscriptionKey.test.stories.js +9 -3
- package/src/react-extension/components/Administration/DisplaySynchronizeUserDirectoryAdministration/DisplaySynchronizeUserDirectoryAdministration.js +5 -6
- package/src/react-extension/components/Administration/DisplaySynchronizeUserDirectoryAdministration/DisplaySynchronizeUserDirectoryAdministration.test.data.js +1717 -1728
- package/src/react-extension/components/Administration/DisplaySynchronizeUserDirectoryAdministration/DisplaySynchronizeUserDirectoryAdministration.test.js +11 -3
- package/src/react-extension/components/Administration/DisplaySynchronizeUserDirectoryAdministration/DisplaySynchronizeUserDirectoryAdministration.test.page.js +4 -1
- package/src/react-extension/components/Administration/DisplaySynchronizeUserDirectoryAdministration/DisplaySynchronizeUserDirectoryAdministration.test.stories.js +11 -1784
- package/src/react-extension/components/Administration/DisplayUserDirectoryAdministration/DisplayUserDirectoryAdministration.js +362 -835
- package/src/react-extension/components/Administration/DisplayUserDirectoryAdministration/DisplayUserDirectoryAdministration.test.data.js +427 -418
- package/src/react-extension/components/Administration/DisplayUserDirectoryAdministration/DisplayUserDirectoryAdministration.test.js +134 -175
- package/src/react-extension/components/Administration/DisplayUserDirectoryAdministration/DisplayUserDirectoryAdministration.test.page.js +108 -11
- package/src/react-extension/components/Administration/DisplayUserDirectoryAdministration/DisplayUserDirectoryAdministration.test.stories.js +17 -25
- package/src/react-extension/components/Administration/EditSubscriptionKey/EditSubscriptionKey.js +4 -2
- package/src/react-extension/components/Administration/ManageAccountRecoveryAdministrationSettings/ManageAccountRecoveryAdministrationSettings.js +3 -3
- package/src/react-extension/components/Administration/ManageAccountRecoveryAdministrationSettings/ManageAccountRecoveryAdministrationSettings.test.js +1 -1
- package/src/react-extension/components/Administration/ManageSmtpAdministrationSettings/ManageSmtpAdministrationSettings.js +32 -7
- package/src/react-extension/components/Administration/ManageSmtpAdministrationSettings/ManageSmtpAdministrationSettings.test.data.js +0 -3
- package/src/react-extension/components/Administration/ManageSmtpAdministrationSettings/ManageSmtpAdministrationSettings.test.js +145 -1
- package/src/react-extension/components/Administration/ManageSmtpAdministrationSettings/ManageSmtpAdministrationSettings.test.page.js +52 -1
- package/src/react-extension/components/Administration/ManageSmtpAdministrationSettings/ManageSmtpAdministrationSettings.test.stories.js +15 -0
- package/src/react-extension/components/Administration/ManageSsoSettings/ManageSsoSettings.js +340 -0
- package/src/react-extension/components/Administration/ManageSsoSettings/ManageSsoSettings.test.data.js +56 -0
- package/src/react-extension/components/Administration/ManageSsoSettings/ManageSsoSettings.test.js +223 -0
- package/src/react-extension/components/Administration/ManageSsoSettings/ManageSsoSettings.test.page.js +235 -0
- package/src/react-extension/components/Administration/ManageSsoSettings/ManageSsoSettings.test.stories.js +55 -0
- package/src/react-extension/components/Administration/ManageSsoSettings/SsoProviders.data.js +34 -0
- package/src/react-extension/components/Administration/SelectAccountRecoveryOrganizationKey/GenerateOrganizationKey.js +12 -3
- package/src/react-extension/components/Administration/SelectAccountRecoveryOrganizationKey/GenerateOrganizationKey.test.js +27 -0
- package/src/react-extension/components/Administration/SelectAccountRecoveryOrganizationKey/SelectAccountRecoveryOrganizationKey.test.page.js +8 -0
- package/src/react-extension/components/Administration/TestSsoSettingsDialog/TestSsoSettingsDialog.js +197 -0
- package/src/react-extension/components/Administration/TestSsoSettingsDialog/TestSsoSettingsDialog.test.data.js +37 -0
- package/src/react-extension/components/Administration/TestSsoSettingsDialog/TestSsoSettingsDialog.test.js +187 -0
- package/src/react-extension/components/Administration/TestSsoSettingsDialog/TestSsoSettingsDialog.test.page.js +120 -0
- package/src/react-extension/components/Administration/TestSsoSettingsDialog/TestSsoSettingsDialog.test.stories.js +31 -0
- package/src/react-extension/components/Authentication/CheckPassphrase/CheckPassphrase.js +9 -5
- package/src/react-extension/components/Authentication/CheckPassphrase/CheckPassphrase.test.data.js +4 -0
- package/src/react-extension/components/Authentication/CheckPassphrase/CheckPassphrase.test.js +11 -42
- package/src/react-extension/components/Authentication/CheckPassphrase/CheckPassphrase.test.page.js +1 -0
- package/src/react-extension/components/Authentication/CreateGpgKey/CreateGpgKey.js +9 -5
- package/src/react-extension/components/Authentication/CreateGpgKey/CreateGpgKey.test.data.js +4 -0
- package/src/react-extension/components/Authentication/CreateGpgKey/CreateGpgKey.test.js +16 -2
- package/src/react-extension/components/Authentication/CreateGpgKey/CreateGpgKey.test.page.js +17 -1
- package/src/react-extension/components/AuthenticationLogin/Login/Login.js +159 -61
- package/src/react-extension/components/AuthenticationLogin/Login/Login.test.data.js +14 -11
- package/src/react-extension/components/AuthenticationLogin/Login/Login.test.js +79 -0
- package/src/react-extension/components/AuthenticationLogin/Login/Login.test.page.js +16 -0
- package/src/react-extension/components/AuthenticationLogin/OrchestrateLogin/OrchestrateLoginBoxMain.js +2 -0
- package/src/react-extension/components/AuthenticationSetup/SetupAuthentication/SetupAuthentication.js +4 -0
- package/src/react-extension/components/Common/Error/ApiError/ApiError.js +119 -0
- package/src/react-extension/components/Common/Error/ApiError/ApiError.test.js +43 -0
- package/src/react-extension/components/Common/Error/ApiError/ApiError.test.page.js +108 -0
- package/src/react-extension/components/Common/Error/ApiError/ApiError.test.stories.js +39 -0
- package/src/react-extension/components/Common/Inputs/Autocomplete/Autocomplete.test.js +12 -0
- package/src/react-extension/components/Common/Inputs/Autocomplete/AutocompleteItem.js +2 -2
- package/src/react-extension/components/Common/Legacy/HandleLegacyAppjs.js +1 -1
- package/src/react-extension/components/Common/Navigation/Header/Logo.js +13 -1
- package/src/react-extension/components/Resource/CreateResource/CreateResource.js +103 -30
- package/src/react-extension/components/Resource/CreateResource/CreateResource.test.js +44 -10
- package/src/react-extension/components/Resource/CreateResource/CreateResource.test.page.js +35 -7
- package/src/react-extension/components/Resource/DisplayResourcesList/DisplayResourcesList.js +3 -3
- package/src/react-extension/components/Resource/DisplayResourcesList/DisplayResourcesListContextualMenu.js +6 -5
- package/src/react-extension/components/Resource/DisplayResourcesWorkspace/DisplayResourcesWorkspaceMenu.js +5 -4
- package/src/react-extension/components/Resource/EditResource/EditResource.js +95 -23
- package/src/react-extension/components/Resource/EditResource/EditResource.test.js +45 -13
- package/src/react-extension/components/Resource/EditResource/EditResource.test.page.js +35 -2
- package/src/react-extension/components/ResourceDetails/DisplayResourceDetails/DisplayResourceDetails.js +2 -1
- package/src/react-extension/components/ResourceDetails/DisplayResourceDetails/DisplayResourceDetailsInformation.js +3 -2
- package/src/react-extension/components/ResourceFolder/CreateResourceFolder/CreateResourceFolder.js +23 -2
- package/src/react-extension/components/ResourceFolder/CreateResourceFolder/CreateResourceFolder.test.js +8 -0
- package/src/react-extension/components/ResourceFolder/CreateResourceFolder/CreateResourceFolder.test.page.js +26 -2
- package/src/react-extension/components/ResourceFolder/RenameResourceFolder/RenameResourceFolder.js +22 -1
- package/src/react-extension/components/ResourceFolder/RenameResourceFolder/RenameResourceFolder.test.js +8 -0
- package/src/react-extension/components/ResourceFolder/RenameResourceFolder/RenameResourceFolder.test.page.js +25 -2
- package/src/react-extension/components/ResourceFolderDetails/DisplayResourceFolderDetails/DisplayResourceFolderDetails.js +2 -1
- package/src/react-extension/components/ResourcePassword/GenerateResourcePassword/GenerateResourcePassword.js +2 -1
- package/src/react-extension/components/ResourceTag/EditResourceTag/EditResourceTag.js +14 -1
- package/src/react-extension/components/ResourceTag/EditResourceTag/EditResourceTag.test.js +8 -0
- package/src/react-extension/components/ResourceTag/EditResourceTag/EditResourceTag.test.page.js +12 -0
- package/src/react-extension/components/User/CreateUser/CreateUser.js +42 -3
- package/src/react-extension/components/User/CreateUser/CreateUser.test.js +16 -0
- package/src/react-extension/components/User/CreateUser/CreateUser.test.page.js +26 -0
- package/src/react-extension/components/User/DisplayUserWorkspaceActions/DisplayUserWorkspaceActions.js +2 -1
- package/src/react-extension/components/User/DisplayUsersContextualMenu/DisplayUsersContextualMenu.js +5 -5
- package/src/react-extension/components/User/EditUser/EditUser.js +29 -2
- package/src/react-extension/components/User/EditUser/EditUser.test.js +12 -0
- package/src/react-extension/components/User/EditUser/EditUser.test.page.js +26 -0
- package/src/react-extension/components/UserDetails/DisplayUserDetails/DisplayUserDetails.js +2 -1
- package/src/react-extension/components/UserDetails/DisplayUserDetails/DisplayUserDetails.test.data.js +1332 -1331
- package/src/react-extension/components/UserDetails/DisplayUserDetailsPublicKey/DisplayUserDetailsPublicKey.js +2 -1
- package/src/react-extension/components/UserGroup/CreateUserGroup/CreateUserGroup.js +19 -1
- package/src/react-extension/components/UserGroup/CreateUserGroup/CreateUserGroup.test.js +9 -0
- package/src/react-extension/components/UserGroup/CreateUserGroup/CreateUserGroup.test.page.js +12 -0
- package/src/react-extension/components/UserGroup/DisplayUserGroupDetails/DisplayUserGroupDetails.js +2 -1
- package/src/react-extension/components/UserGroup/EditUserGroup/EditUserGroup.js +16 -1
- package/src/react-extension/components/UserGroup/EditUserGroup/EditUserGroup.test.js +8 -0
- package/src/react-extension/components/UserGroup/EditUserGroup/EditUserGroup.test.page.js +26 -1
- package/src/react-extension/components/UserSetting/ChangeUserPassphrase/ConfirmPassphrase.js +1 -1
- package/src/react-extension/components/UserSetting/ChangeUserPassphrase/EnterNewPassphrase.js +6 -4
- package/src/react-extension/components/UserSetting/ChangeUserPassphrase/EnterNewPassphrase.test.data.js +4 -1
- package/src/react-extension/components/UserSetting/ChangeUserPassphrase/EnterNewPassphrase.test.js +21 -11
- package/src/react-extension/components/UserSetting/ChangeUserPassphrase/EnterNewPassphrase.test.page.js +10 -1
- package/src/react-extension/contexts/AdminSmtpSettingsContext.js +2 -0
- package/src/react-extension/contexts/AdminSmtpSettingsContext.test.data.js +13 -0
- package/src/react-extension/contexts/AdminSmtpSettingsContext.test.js +3 -1
- package/src/react-extension/contexts/AdminSsoContext.js +558 -0
- package/src/react-extension/contexts/AdminSsoContext.test.data.js +51 -0
- package/src/react-extension/contexts/Administration/AdministrationInternationalizationContext/AdministrationInternationalizationContext.js +194 -0
- package/src/react-extension/contexts/Administration/AdministrationInternationalizationContext/AdministrationInternationalizationContext.test.js +111 -0
- package/src/react-extension/contexts/Administration/AdministrationMfa/AdministrationMfaContext.js +265 -0
- package/src/react-extension/contexts/Administration/AdministrationMfa/AdministrationMfaContext.test.js +178 -0
- package/src/react-extension/contexts/Administration/AdministrationSelfRegistration/AdministrationSelfRegistrationContext.js +453 -0
- package/src/react-extension/contexts/Administration/AdministrationSelfRegistration/AdministrationSelfRegistrationContext.test.js +218 -0
- package/src/react-extension/contexts/Administration/AdministrationSubscription/AdministrationSubscription.js +168 -0
- package/src/react-extension/contexts/Administration/AdministrationSubscription/AdministrationSubscription.test.js +73 -0
- package/src/react-extension/contexts/Administration/AdministrationUserDirectory/AdministrationUserDirectoryContext.js +353 -0
- package/src/react-extension/contexts/Administration/AdministrationUserDirectory/AdministrationUserDirectoryContext.test.js +220 -0
- package/src/react-extension/contexts/AdministrationWorkspaceContext.js +17 -178
- package/src/react-extension/contexts/AdministrationWorkspaceContext.test.js +0 -26
- package/src/react-extension/contexts/ApiAppContext.test.data.js +4 -2
- package/src/react-extension/contexts/Authentication/AuthenticationLoginContext.js +54 -4
- package/src/react-extension/contexts/Authentication/AuthenticationLoginContext.test.data.js +10 -1
- package/src/react-extension/contexts/Authentication/AuthenticationLoginContext.test.js +92 -14
- package/src/react-extension/contexts/Authentication/AuthenticationSetupContext.js +1 -0
- package/src/react-extension/contexts/NavigationContext.js +34 -0
- package/src/react-extension/contexts/SsoContext.js +151 -0
- package/src/react-extension/contexts/SsoContext.test.data.js +36 -0
- package/src/react-extension/contexts/SsoContext.test.js +104 -0
- package/src/react-extension/lib/Domain/DomainUtil.js +70 -0
- package/src/react-extension/lib/Domain/DomainUtil.test.js +129 -0
- package/src/react-extension/lib/Domain/Domains.js +6113 -0
- package/src/react-extension/lib/Error/InputValidator.js +24 -0
- package/src/react-extension/lib/Map/DynamicRef.js +49 -0
- package/src/react-extension/lib/Map/DynamicRef.test.js +56 -0
- package/src/react-extension/lib/Map/MapObject.js +48 -0
- package/src/react-extension/lib/Map/MapObject.test.js +43 -0
- package/src/react-quickaccess/ExtQuickAccess.js +7 -4
- package/src/react-quickaccess/components/GeneratePasswordPage/GeneratePasswordPage.js +3 -1
- package/src/react-quickaccess/components/GeneratePasswordPage/GeneratePasswordPage.test.data.js +4 -0
- package/src/react-quickaccess/components/LoginPage/LoginPage.js +115 -4
- package/src/react-quickaccess/components/LoginPage/LoginPage.test.data.js +10 -0
- package/src/react-quickaccess/components/LoginPage/LoginPage.test.stories.js +30 -3
- package/src/react-quickaccess/components/ResourceAutoSave/SaveResource.js +33 -1
- package/src/react-quickaccess/components/ResourceAutoSave/SaveResource.test.data.js +25 -0
- package/src/react-quickaccess/components/ResourceAutoSave/SaveResource.test.js +60 -0
- package/src/react-quickaccess/components/ResourceAutoSave/SaveResource.test.page.js +60 -0
- package/src/react-quickaccess/components/ResourceCreatePage/ResourceCreatePage.js +33 -1
- package/src/react-quickaccess/components/ResourceCreatePage/ResourceCreatePage.test.js +36 -7
- package/src/react-quickaccess/components/ResourceViewPage/ResourceViewPage.js +3 -2
- package/src/react-quickaccess/contexts/SsoContext.js +150 -0
- package/src/react-web-integration/lib/InForm/InFormFieldSelector.js +5 -0
- package/src/shared/constants/inputs.const.js +30 -0
- package/src/shared/lib/Browser/clipBoard.js +45 -0
- package/src/shared/lib/Browser/clipBoard.test.js +59 -0
- package/src/shared/models/Mfa/Duo.js +36 -0
- package/src/shared/models/Mfa/Duo.test.js +59 -0
- package/src/shared/models/Mfa/MfaDTO.js +51 -0
- package/src/shared/models/Mfa/MfaDTO.test.js +48 -0
- package/src/shared/models/Mfa/MfaEnumeration.js +17 -0
- package/src/shared/models/Mfa/MfaModel.js +48 -0
- package/src/shared/models/Mfa/MfaModel.test.js +37 -0
- package/src/shared/models/Mfa/Yubikey.js +35 -0
- package/src/shared/models/Mfa/Yubikey.test.js +47 -0
- package/src/shared/models/selfRegistration/SelfRegistrationDomainsViewModel.js +55 -0
- package/src/shared/models/selfRegistration/SelfRegistrationDomainsViewModel.test.js +37 -0
- package/src/shared/models/selfRegistration/SelfRegistrationDto.js +42 -0
- package/src/shared/models/selfRegistration/SelfRegistrationDto.test.js +48 -0
- package/src/shared/models/selfRegistration/SelfRegistrationEnumeration.js +17 -0
- package/src/shared/models/subscription/SubscriptionDto.js +34 -0
- package/src/shared/models/subscription/SubscriptionDto.test.js +31 -0
- package/src/shared/models/subscription/SubscriptionModel.js +33 -0
- package/src/shared/models/subscription/SubscriptionModel.test.js +48 -0
- package/src/shared/models/user/UserModel.js +37 -0
- package/src/shared/models/userDirectory/UserDirectoryDTO.js +57 -0
- package/src/shared/models/userDirectory/UserDirectoryDTO.test.js +40 -0
- package/src/shared/models/userDirectory/UserDirectoryEnum.js +22 -0
- package/src/shared/models/userDirectory/UserDirectoryModel.js +64 -0
- package/src/shared/models/userDirectory/UserDirectoryModel.test.js +37 -0
- package/src/shared/services/actions/subscription/SubscriptionActionService.js +69 -0
- package/src/shared/services/actions/subscription/SubscriptionActionService.test.js +73 -0
- package/src/shared/services/api/Internationalisation/InternationalisationService.js +46 -0
- package/src/shared/services/api/Mfa/MfaService.js +54 -0
- package/src/shared/services/{accountRecovery → api/accountRecovery}/ApiAppAccountRecoveryUserService.js +2 -2
- package/src/shared/services/{accountRecovery → api/accountRecovery}/ExtAppAccountRecoveryUserService.js +0 -0
- package/src/shared/services/api/secrets/pownedService.js +64 -0
- package/src/shared/services/api/secrets/pownedService.test.js +63 -0
- package/src/shared/services/api/selfRegistration/selfRegistrationService.js +64 -0
- package/src/shared/services/api/user/UserService.js +45 -0
- package/src/shared/services/api/userDirectory/UserDirectoryService.js +108 -0
- package/src/shared/services/forms/Mfa/MfaFormService.js +195 -0
- package/src/shared/services/forms/Mfa/MfaFormService.test.js +341 -0
- package/src/shared/services/forms/selfRegistration/SelfRegistrationFormService.js +92 -0
- package/src/shared/services/forms/selfRegistration/SelfRegistrationFormService.test.js +101 -0
- package/src/shared/services/forms/userDirectory/UserDirectoryFormService.js +118 -0
- package/src/shared/services/forms/userDirectory/UserDirectoryFormService.test.js +128 -0
- package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceActions/DisplayAdministrationWorkspaceActions.js +0 -205
- package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceActions/DisplayAdministrationWorkspaceActions.test.data.js +0 -37
- package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceActions/DisplayAdministrationWorkspaceActions.test.js +0 -197
- package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceActions/DisplayAdministrationWorkspaceActions.test.page.js +0 -133
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Passbolt ~ Open source password manager for teams
|
|
3
|
+
* Copyright (c) 2022 Passbolt SA (https://www.passbolt.com)
|
|
4
|
+
*
|
|
5
|
+
* Licensed under GNU Affero General Public License version 3 of the or any later version.
|
|
6
|
+
* For full copyright and license information, please see the LICENSE.txt
|
|
7
|
+
* Redistributions of files must retain the above copyright notice.
|
|
8
|
+
*
|
|
9
|
+
* @copyright Copyright (c) 2022 Passbolt SA (https://www.passbolt.com)
|
|
10
|
+
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License
|
|
11
|
+
* @link https://www.passbolt.com Passbolt(tm)
|
|
12
|
+
* @since 3.9.0
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Unit tests on TestSsoSettingsDialog in regard of specifications
|
|
17
|
+
*/
|
|
18
|
+
import SsoProviders from "../ManageSsoSettings/SsoProviders.data";
|
|
19
|
+
import {waitFor} from "@testing-library/react";
|
|
20
|
+
import {defaultProps} from "./TestSsoSettingsDialog.test.data";
|
|
21
|
+
import {v4 as uuid} from "uuid";
|
|
22
|
+
import TestSsoSettingsDialogPage from "../TestSsoSettingsDialog/TestSsoSettingsDialog.test.page";
|
|
23
|
+
import NotifyError from "../../Common/Error/NotifyError/NotifyError";
|
|
24
|
+
|
|
25
|
+
beforeEach(() => {
|
|
26
|
+
jest.resetModules();
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
describe("TestSsoSettingsDialog", () => {
|
|
30
|
+
describe("As a signed-in administrator I can save the SSO server settings", () => {
|
|
31
|
+
/*
|
|
32
|
+
* Covers as well:
|
|
33
|
+
* As AD I cannot save the SSO settings before testing them
|
|
34
|
+
*/
|
|
35
|
+
it('As AD I should see a dialog to invite me to test the SSO settings before saving them', async() => {
|
|
36
|
+
expect.assertions(4);
|
|
37
|
+
|
|
38
|
+
const props = defaultProps();
|
|
39
|
+
const page = new TestSsoSettingsDialogPage(props);
|
|
40
|
+
|
|
41
|
+
expect(page.title.textContent).toBe("Test Single Sign-On configuration");
|
|
42
|
+
expect(page.ssoLoginButton).toBeTruthy();
|
|
43
|
+
expect(page.saveButton).toBeTruthy();
|
|
44
|
+
expect(page.saveButton.classList.contains("disabled")).toBeTruthy();
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('As AD I need to successfully sign in with the new SSO settings before saving them (happy path)', async() => {
|
|
48
|
+
expect.assertions(7);
|
|
49
|
+
|
|
50
|
+
const expectedSsoToken = uuid();
|
|
51
|
+
const expectedConfigurationId = uuid();
|
|
52
|
+
|
|
53
|
+
const props = defaultProps({
|
|
54
|
+
configurationId: expectedConfigurationId,
|
|
55
|
+
provider: SsoProviders.find(provider => provider.id === "azure"),
|
|
56
|
+
onClose: jest.fn()
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
let ssoLoginResolve = null;
|
|
60
|
+
props.context.port.addRequestListener('passbolt.sso.test.azure', async configurationId => {
|
|
61
|
+
expect(configurationId).toBe(expectedConfigurationId);
|
|
62
|
+
return new Promise(resolve => {
|
|
63
|
+
ssoLoginResolve = resolve;
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
props.context.port.addRequestListener("passbolt.sso.activate-settings", async(configurationId, ssoToken) => {
|
|
68
|
+
expect(configurationId).toBe(expectedConfigurationId);
|
|
69
|
+
expect(ssoToken).toBe(expectedSsoToken);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
const page = new TestSsoSettingsDialogPage(props);
|
|
73
|
+
await waitFor(() => {});
|
|
74
|
+
|
|
75
|
+
expect(page.saveButton.classList.contains("disabled")).toBeTruthy();
|
|
76
|
+
|
|
77
|
+
await page.clickOnLogin();
|
|
78
|
+
|
|
79
|
+
await ssoLoginResolve(expectedSsoToken);
|
|
80
|
+
|
|
81
|
+
await waitFor(() => {
|
|
82
|
+
if (page.saveButton.classList.contains("disabled")) {
|
|
83
|
+
throw new Error("page is not ready yet");
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
expect(page.title.textContent).toBe("Save Single Sign-On configuration");
|
|
88
|
+
|
|
89
|
+
expect(page.saveButton.classList.contains("disabled")).toBeFalsy();
|
|
90
|
+
await page.saveSettings();
|
|
91
|
+
|
|
92
|
+
await waitFor(() => {
|
|
93
|
+
if (props.onClose.mock.calls.length === 0) {
|
|
94
|
+
throw new Error("page is not ready yet");
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
expect(props.onClose).toHaveBeenCalledTimes(1);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
it('As AD I need to successfully sign in with the new SSO settings before saving them (error from API during test)', async() => {
|
|
102
|
+
expect.assertions(2);
|
|
103
|
+
|
|
104
|
+
const expectedError = new Error("Something went wrong!");
|
|
105
|
+
|
|
106
|
+
const props = defaultProps({
|
|
107
|
+
configurationId: uuid(),
|
|
108
|
+
provider: SsoProviders.find(provider => provider.id === "azure")
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
props.context.port.addRequestListener('passbolt.sso.test.azure', async() => {
|
|
112
|
+
throw expectedError;
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
const page = new TestSsoSettingsDialogPage(props);
|
|
116
|
+
await waitFor(() => {});
|
|
117
|
+
|
|
118
|
+
expect(page.saveButton.classList.contains("disabled")).toBeTruthy();
|
|
119
|
+
|
|
120
|
+
await page.clickOnLogin();
|
|
121
|
+
|
|
122
|
+
expect(props.dialogContext.open).toHaveBeenCalledWith(NotifyError, {error: expectedError});
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
it('As AD I need to successfully sign in with the new SSO settings before saving them (error from API during activation)', async() => {
|
|
126
|
+
expect.assertions(3);
|
|
127
|
+
|
|
128
|
+
const expectedError = new Error("Something went wrong!");
|
|
129
|
+
|
|
130
|
+
const props = defaultProps({
|
|
131
|
+
configurationId: uuid(),
|
|
132
|
+
provider: SsoProviders.find(provider => provider.id === "azure")
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
props.context.port.addRequestListener('passbolt.sso.test.azure', async() => uuid());
|
|
136
|
+
props.context.port.addRequestListener("passbolt.sso.activate-settings", async() => {
|
|
137
|
+
throw expectedError;
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
const page = new TestSsoSettingsDialogPage(props);
|
|
141
|
+
await waitFor(() => {});
|
|
142
|
+
|
|
143
|
+
expect(page.saveButton.classList.contains("disabled")).toBeTruthy();
|
|
144
|
+
|
|
145
|
+
await page.clickOnLogin();
|
|
146
|
+
|
|
147
|
+
await waitFor(() => {
|
|
148
|
+
if (page.saveButton.classList.contains("disabled")) {
|
|
149
|
+
throw new Error("page is not ready yet");
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
expect(page.saveButton.classList.contains("disabled")).toBeFalsy();
|
|
154
|
+
await page.saveSettings();
|
|
155
|
+
|
|
156
|
+
await waitFor(() => {});
|
|
157
|
+
|
|
158
|
+
expect(props.dialogContext.open).toHaveBeenCalledWith(NotifyError, {error: expectedError});
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
it("As AD I can't save the SSO settings on a failed sign in test attempt", async() => {
|
|
162
|
+
expect.assertions(3);
|
|
163
|
+
|
|
164
|
+
const expectedError = new Error("User closed the popup!");
|
|
165
|
+
expectedError.name = 'UserClosedSsoPopUpError';
|
|
166
|
+
|
|
167
|
+
const props = defaultProps({
|
|
168
|
+
configurationId: uuid(),
|
|
169
|
+
provider: SsoProviders.find(provider => provider.id === "azure")
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
props.context.port.addRequestListener('passbolt.sso.test.azure', async() => {
|
|
173
|
+
throw expectedError;
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
const page = new TestSsoSettingsDialogPage(props);
|
|
177
|
+
await waitFor(() => {});
|
|
178
|
+
|
|
179
|
+
expect(page.saveButton.classList.contains("disabled")).toBeTruthy();
|
|
180
|
+
|
|
181
|
+
await page.clickOnLogin();
|
|
182
|
+
|
|
183
|
+
expect(props.dialogContext.open).not.toHaveBeenCalledWith();
|
|
184
|
+
expect(page.saveButton.classList.contains("disabled")).toBeTruthy();
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
});
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Passbolt ~ Open source password manager for teams
|
|
3
|
+
* Copyright (c) 2022 Passbolt SA (https://www.passbolt.com)
|
|
4
|
+
*
|
|
5
|
+
* Licensed under GNU Affero General Public License version 3 of the or any later version.
|
|
6
|
+
* For full copyright and license information, please see the LICENSE.txt
|
|
7
|
+
* Redistributions of files must retain the above copyright notice.
|
|
8
|
+
*
|
|
9
|
+
* @copyright Copyright (c) 2022 Passbolt SA (https://www.passbolt.com)
|
|
10
|
+
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License
|
|
11
|
+
* @link https://www.passbolt.com Passbolt(tm)
|
|
12
|
+
* @since 3.9.0
|
|
13
|
+
*/
|
|
14
|
+
import {fireEvent, render, waitFor} from "@testing-library/react";
|
|
15
|
+
import React from "react";
|
|
16
|
+
import MockTranslationProvider from "../../../test/mock/components/Internationalisation/MockTranslationProvider";
|
|
17
|
+
import AdminSsoContextProvider from "../../../contexts/AdminSsoContext";
|
|
18
|
+
import TestSsoSettingsDialog from "./TestSsoSettingsDialog";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The TestSsoSettingsDialogPage component represented as a page
|
|
22
|
+
*/
|
|
23
|
+
export default class TestSsoSettingsDialogPage {
|
|
24
|
+
/**
|
|
25
|
+
* Default constructor
|
|
26
|
+
* @param appContext An app context
|
|
27
|
+
* @param props Props to attach
|
|
28
|
+
*/
|
|
29
|
+
constructor(props) {
|
|
30
|
+
this.props = props;
|
|
31
|
+
this.render(props);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Do a rendering of the page.
|
|
36
|
+
* If the page already exists, do a rerender instead
|
|
37
|
+
* @param {object} props the props of the components
|
|
38
|
+
*/
|
|
39
|
+
render(props) {
|
|
40
|
+
this._page = render(<MockTranslationProvider>
|
|
41
|
+
<AdminSsoContextProvider {...props}>
|
|
42
|
+
<TestSsoSettingsDialog {...props}/>
|
|
43
|
+
</AdminSsoContextProvider>
|
|
44
|
+
</MockTranslationProvider>);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Shortcut method for the container querySelector.
|
|
49
|
+
* @param {string} stringSelector
|
|
50
|
+
* @returns {HTMLElement}
|
|
51
|
+
*/
|
|
52
|
+
select(stringSelector) {
|
|
53
|
+
return this._page.container.querySelector(stringSelector);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Simulates a click on the given HTML element.
|
|
58
|
+
* The clicks is consider done when the callback returns {true}.
|
|
59
|
+
* @param {HTMLElement} element The HTML element onto simulate the click
|
|
60
|
+
* @param {function} callback The callback to be used in the waitFor method to ensure the click is done (returns true when it's done)
|
|
61
|
+
* @returns {Promise<void>}
|
|
62
|
+
*/
|
|
63
|
+
async clickOn(element, callback) {
|
|
64
|
+
const leftClick = {button: 0};
|
|
65
|
+
fireEvent.click(element, leftClick);
|
|
66
|
+
await waitFor(() => {
|
|
67
|
+
if (!callback()) {
|
|
68
|
+
throw new Error("Page didn't react yet on the event.");
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Simulates a click on the login with SSO provider button
|
|
75
|
+
* @returns {Promise<void>}
|
|
76
|
+
*/
|
|
77
|
+
async clickOnLogin() {
|
|
78
|
+
await this.clickOn(this.ssoLoginButton, this.isSaveButtonProcessing.bind(this));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Simulates a click on the save button in the dialog
|
|
83
|
+
* @returns {Promise<void>}
|
|
84
|
+
*/
|
|
85
|
+
async saveSettings() {
|
|
86
|
+
await this.clickOn(this.saveButton, () => true);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Returns true if the submit button is in processing state.
|
|
91
|
+
* @returns {boolean}
|
|
92
|
+
*/
|
|
93
|
+
isSaveButtonProcessing() {
|
|
94
|
+
return Boolean(this.select(".test-sso-settings-dialog button[type='submit'] .svg-icon.spinner"));
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Returns the title page HTML element
|
|
99
|
+
* @returns {HTMLElement}
|
|
100
|
+
*/
|
|
101
|
+
get title() {
|
|
102
|
+
return this.select(".dialog-title-wrapper h2");
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Returns the SSO login button HTMLElemnt.
|
|
107
|
+
* @returns {HTMLElement}
|
|
108
|
+
*/
|
|
109
|
+
get ssoLoginButton() {
|
|
110
|
+
return this.select(".test-sso-settings-dialog a.sso-login-button");
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Returns the save button HTMLElemnt.
|
|
115
|
+
* @returns {HTMLElement}
|
|
116
|
+
*/
|
|
117
|
+
get saveButton() {
|
|
118
|
+
return this.select(".test-sso-settings-dialog button[type='submit']");
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Passbolt ~ Open source password manager for teams
|
|
3
|
+
* Copyright (c) 2022 Passbolt SA (https://www.passbolt.com)
|
|
4
|
+
*
|
|
5
|
+
* Licensed under GNU Affero General Public License version 3 of the or any later version.
|
|
6
|
+
* For full copyright and license information, please see the LICENSE.txt
|
|
7
|
+
* Redistributions of files must retain the above copyright notice.
|
|
8
|
+
*
|
|
9
|
+
* @copyright Copyright (c) 2022 Passbolt SA (https://www.passbolt.com)
|
|
10
|
+
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License
|
|
11
|
+
* @link https://www.passbolt.com Passbolt(tm)
|
|
12
|
+
* @since 3.9.0
|
|
13
|
+
*/
|
|
14
|
+
import React from "react";
|
|
15
|
+
import TestSsoSettingsDialog from "./TestSsoSettingsDialog";
|
|
16
|
+
import {defaultProps} from "./TestSsoSettingsDialog.test.data";
|
|
17
|
+
import AdminSsoContextProvider from "../../../contexts/AdminSsoContext";
|
|
18
|
+
import SsoProviders from "../ManageSsoSettings/SsoProviders.data";
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
title: 'Components/Administration/TestSsoSettingsDialog',
|
|
22
|
+
component: TestSsoSettingsDialog
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const Template = args =>
|
|
26
|
+
<AdminSsoContextProvider {...args}>
|
|
27
|
+
<TestSsoSettingsDialog {...args}/>;
|
|
28
|
+
</AdminSsoContextProvider>;
|
|
29
|
+
|
|
30
|
+
export const Default = Template.bind({});
|
|
31
|
+
Default.args = defaultProps({provider: SsoProviders.at(0)});
|
|
@@ -17,10 +17,11 @@ import debounce from "debounce-promise";
|
|
|
17
17
|
import {Trans, withTranslation} from "react-i18next";
|
|
18
18
|
import Password from "../../../../shared/components/Password/Password";
|
|
19
19
|
import PasswordComplexity from "../../../../shared/components/PasswordComplexity/PasswordComplexity";
|
|
20
|
-
import SecretComplexity from "../../../../shared/lib/Secret/SecretComplexity";
|
|
21
20
|
import {SecretGenerator} from "../../../../shared/lib/SecretGenerator/SecretGenerator";
|
|
22
21
|
import ExternalServiceError from "../../../../shared/lib/Error/ExternalServiceError";
|
|
23
22
|
import ExternalServiceUnavailableError from "../../../../shared/lib/Error/ExternalServiceUnavailableError";
|
|
23
|
+
import PownedService from "../../../../shared/services/api/secrets/pownedService";
|
|
24
|
+
import {withAppContext} from "../../../contexts/AppContext";
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
27
|
* The component display variations.
|
|
@@ -106,6 +107,7 @@ class CheckPassphrase extends Component {
|
|
|
106
107
|
* Whenever the component is mounted
|
|
107
108
|
*/
|
|
108
109
|
componentDidMount() {
|
|
110
|
+
this.pownedService = new PownedService(this.props.context.port);
|
|
109
111
|
this.focusOnPassphrase();
|
|
110
112
|
}
|
|
111
113
|
|
|
@@ -133,7 +135,6 @@ class CheckPassphrase extends Component {
|
|
|
133
135
|
event.preventDefault();
|
|
134
136
|
this.validate();
|
|
135
137
|
await this.isPwndProcessingPromise;
|
|
136
|
-
|
|
137
138
|
if (this.isValid) {
|
|
138
139
|
this.toggleProcessing();
|
|
139
140
|
await this.check();
|
|
@@ -150,12 +151,13 @@ class CheckPassphrase extends Component {
|
|
|
150
151
|
return;
|
|
151
152
|
}
|
|
152
153
|
|
|
153
|
-
const passphrase = this.state.passphrase;
|
|
154
154
|
let passphraseInDictionnary = false;
|
|
155
155
|
let passphraseEntropy = this.state.passphraseEntropy;
|
|
156
156
|
|
|
157
157
|
try {
|
|
158
|
-
|
|
158
|
+
const result = await this.pownedService.evaluateSecret(this.state.passphrase);
|
|
159
|
+
passphraseInDictionnary = result.inDictionary;
|
|
160
|
+
isPwnedServiceAvailable = result.isPwnedServiceAvailable;
|
|
159
161
|
if (passphraseInDictionnary) {
|
|
160
162
|
passphraseEntropy = 0;
|
|
161
163
|
}
|
|
@@ -183,6 +185,7 @@ class CheckPassphrase extends Component {
|
|
|
183
185
|
handleChangePassphrase(event) {
|
|
184
186
|
const passphrase = event.target.value;
|
|
185
187
|
let passphraseEntropy = null;
|
|
188
|
+
|
|
186
189
|
if (passphrase.length) {
|
|
187
190
|
passphraseEntropy = SecretGenerator.entropy(passphrase);
|
|
188
191
|
this.isPwndProcessingPromise = this.evaluatePassphraseIsInDictionaryDebounce();
|
|
@@ -345,6 +348,7 @@ CheckPassphrase.defaultProps = {
|
|
|
345
348
|
};
|
|
346
349
|
|
|
347
350
|
CheckPassphrase.propTypes = {
|
|
351
|
+
context: PropTypes.any, // The application context
|
|
348
352
|
onComplete: PropTypes.func.isRequired, // The callback to trigger when the user wants to verify its passphrase
|
|
349
353
|
displayAs: PropTypes.PropTypes.oneOf([
|
|
350
354
|
CheckPassphraseVariations.SETUP,
|
|
@@ -353,4 +357,4 @@ CheckPassphrase.propTypes = {
|
|
|
353
357
|
canRememberMe: PropTypes.bool, // True if the remember me flag must be displayed
|
|
354
358
|
onSecondaryActionClick: PropTypes.func, // Callback to trigger when the user clicks on the secondary action link.
|
|
355
359
|
};
|
|
356
|
-
export default withTranslation("common")(CheckPassphrase);
|
|
360
|
+
export default withAppContext(withTranslation("common")(CheckPassphrase));
|
package/src/react-extension/components/Authentication/CheckPassphrase/CheckPassphrase.test.data.js
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* @since 3.0.0
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
+
import {defaultAppContext} from "../../../contexts/ApiAppContext.test.data";
|
|
15
16
|
import {CheckPassphraseVariations} from "./CheckPassphrase";
|
|
16
17
|
|
|
17
18
|
/**
|
|
@@ -20,6 +21,9 @@ import {CheckPassphraseVariations} from "./CheckPassphrase";
|
|
|
20
21
|
*/
|
|
21
22
|
export function defaultProps(props) {
|
|
22
23
|
const defaultProps = {
|
|
24
|
+
context: defaultAppContext({port: {
|
|
25
|
+
request: () => Promise.resolve(0)
|
|
26
|
+
}}),
|
|
23
27
|
displayAs: CheckPassphraseVariations.SETUP,
|
|
24
28
|
canRememberMe: false,
|
|
25
29
|
onComplete: jest.fn(() => Promise.resolve()),
|
package/src/react-extension/components/Authentication/CheckPassphrase/CheckPassphrase.test.js
CHANGED
|
@@ -19,16 +19,20 @@ import {defaultProps} from "./CheckPassphrase.test.data";
|
|
|
19
19
|
import CheckPassphrasePage from "./CheckPassphrase.test.page";
|
|
20
20
|
import each from "jest-each";
|
|
21
21
|
import {CheckPassphraseVariations} from "./CheckPassphrase";
|
|
22
|
-
import PwnedPasswords from "../../../../shared/lib/Secret/PwnedPasswords";
|
|
23
22
|
import {waitFor} from "@testing-library/dom";
|
|
24
23
|
|
|
25
24
|
jest.mock("../../../../shared/lib/Secret/PwnedPasswords");
|
|
26
25
|
|
|
27
26
|
beforeEach(() => {
|
|
28
27
|
jest.resetModules();
|
|
29
|
-
|
|
28
|
+
jest.useFakeTimers();
|
|
30
29
|
});
|
|
31
30
|
|
|
31
|
+
afterEach(() => {
|
|
32
|
+
jest.clearAllTimers();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
|
|
32
36
|
describe("Check passphrase", () => {
|
|
33
37
|
let page, // The page to test against.
|
|
34
38
|
props; // The component props
|
|
@@ -42,7 +46,6 @@ describe("Check passphrase", () => {
|
|
|
42
46
|
it(`As AN I should be able to enter my secret key passphrase, scenario: ${JSON.stringify(_props)}`, async() => {
|
|
43
47
|
props = defaultProps(_props);
|
|
44
48
|
page = new CheckPassphrasePage(props);
|
|
45
|
-
|
|
46
49
|
expect.assertions(1);
|
|
47
50
|
const expectedPassphrase = "some passphrase";
|
|
48
51
|
await page.fillPassphrase(expectedPassphrase);
|
|
@@ -131,11 +134,7 @@ describe("Check passphrase", () => {
|
|
|
131
134
|
await page.toggleRememberMe();
|
|
132
135
|
expect(page.rememberMe).toBe("true");
|
|
133
136
|
await page.fillPassphrase('some passphrase');
|
|
134
|
-
await page.verify(
|
|
135
|
-
if (!props.onComplete.mock.calls.length) {
|
|
136
|
-
throw new Error("The page is still processing");
|
|
137
|
-
}
|
|
138
|
-
});
|
|
137
|
+
await page.verify();
|
|
139
138
|
expect(props.onComplete).toHaveBeenCalledWith("some passphrase", true);
|
|
140
139
|
});
|
|
141
140
|
|
|
@@ -179,59 +178,29 @@ describe("Check passphrase", () => {
|
|
|
179
178
|
|
|
180
179
|
describe("Check pwned passphrase", () => {
|
|
181
180
|
it("As AN completing the setup I should not be able to use a passphrase that is part of a data breach.", async() => {
|
|
182
|
-
let pwnedResolve;
|
|
183
|
-
const pwnedServiceImpl = () => new Promise(resolve => {
|
|
184
|
-
pwnedResolve = resolve;
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
PwnedPasswords.pwnedPasswords.mockImplementation(pwnedServiceImpl);
|
|
188
181
|
props = defaultProps({displayAs: CheckPassphraseVariations.SETUP});
|
|
189
182
|
page = new CheckPassphrasePage(props);
|
|
183
|
+
jest.spyOn(props.context.port, 'request').mockImplementationOnce(() => Promise.resolve(80));
|
|
190
184
|
|
|
191
185
|
expect.assertions(1);
|
|
192
186
|
await page.fillPassphrase('test@test.com');
|
|
193
187
|
await page.verify();
|
|
194
188
|
|
|
195
|
-
await waitFor(() => {
|
|
196
|
-
if (pwnedResolve === undefined) {
|
|
197
|
-
throw new Error("Service is not called yet!");
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
await pwnedResolve(1);
|
|
201
|
-
await waitFor(() => {
|
|
202
|
-
if (page.isProcessing) {
|
|
203
|
-
throw new Error("The page is still processing");
|
|
204
|
-
}
|
|
205
|
-
});
|
|
189
|
+
await waitFor(() => {});
|
|
206
190
|
|
|
207
191
|
expect(props.onComplete).not.toHaveBeenCalled();
|
|
208
192
|
});
|
|
209
193
|
|
|
210
194
|
it("As AN completing the recover I should be able to recover my account even if my passphrase is part of a data breach.", async() => {
|
|
211
|
-
let pwnedResolve;
|
|
212
|
-
const pwnedServiceImpl = () => new Promise(resolve => {
|
|
213
|
-
pwnedResolve = resolve;
|
|
214
|
-
});
|
|
215
|
-
|
|
216
|
-
PwnedPasswords.pwnedPasswords.mockImplementation(pwnedServiceImpl);
|
|
217
195
|
props = defaultProps({displayAs: CheckPassphraseVariations.RECOVER});
|
|
196
|
+
jest.spyOn(props.context.port, 'request').mockImplementationOnce(() => Promise.resolve(2));
|
|
218
197
|
page = new CheckPassphrasePage(props);
|
|
219
198
|
|
|
220
199
|
expect.assertions(1);
|
|
221
200
|
await page.fillPassphrase('test@test.com');
|
|
222
201
|
await page.verify();
|
|
223
202
|
|
|
224
|
-
await waitFor(() => {
|
|
225
|
-
if (pwnedResolve === undefined) {
|
|
226
|
-
throw new Error("Service is not called yet!");
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
await pwnedResolve(1);
|
|
230
|
-
await waitFor(() => {
|
|
231
|
-
if (page.isProcessing) {
|
|
232
|
-
throw new Error("The page is still processing");
|
|
233
|
-
}
|
|
234
|
-
});
|
|
203
|
+
await waitFor(() => {});
|
|
235
204
|
|
|
236
205
|
expect(props.onComplete).toHaveBeenCalledWith("test@test.com", false);
|
|
237
206
|
});
|
|
@@ -16,14 +16,14 @@ import PropTypes from "prop-types";
|
|
|
16
16
|
import debounce from "debounce-promise";
|
|
17
17
|
import {Trans, withTranslation} from "react-i18next";
|
|
18
18
|
import SecurityComplexity from "../../../../shared/lib/Secret/SecretComplexity";
|
|
19
|
-
import SecretComplexity from "../../../../shared/lib/Secret/SecretComplexity";
|
|
20
19
|
import Password from "../../../../shared/components/Password/Password";
|
|
21
20
|
import {SecretGenerator} from "../../../../shared/lib/SecretGenerator/SecretGenerator";
|
|
22
21
|
import PasswordComplexity from "../../../../shared/components/PasswordComplexity/PasswordComplexity";
|
|
23
22
|
import ExternalServiceUnavailableError from "../../../../shared/lib/Error/ExternalServiceUnavailableError";
|
|
24
23
|
import Tooltip from "../../Common/Tooltip/Tooltip";
|
|
25
24
|
import ExternalServiceError from "../../../../shared/lib/Error/ExternalServiceError";
|
|
26
|
-
|
|
25
|
+
import {withAppContext} from "../../../contexts/AppContext";
|
|
26
|
+
import PownedService from '../../../../shared/services/api/secrets/pownedService';
|
|
27
27
|
/**
|
|
28
28
|
* The component display variations.
|
|
29
29
|
* @type {Object}
|
|
@@ -36,6 +36,7 @@ export const CreateGpgKeyVariation = {
|
|
|
36
36
|
/**
|
|
37
37
|
* The component allows the user to create a Gpg key by automatic generation or by manually importing one
|
|
38
38
|
*/
|
|
39
|
+
|
|
39
40
|
class CreateGpgKey extends Component {
|
|
40
41
|
/**
|
|
41
42
|
* Default constructor
|
|
@@ -123,6 +124,7 @@ class CreateGpgKey extends Component {
|
|
|
123
124
|
* Whenever the component is mounted
|
|
124
125
|
*/
|
|
125
126
|
componentDidMount() {
|
|
127
|
+
this.pownedService = new PownedService(this.props.context.port);
|
|
126
128
|
this.focusOnPassphrase();
|
|
127
129
|
}
|
|
128
130
|
|
|
@@ -194,8 +196,9 @@ class CreateGpgKey extends Component {
|
|
|
194
196
|
notInDictionaryHint = "error";
|
|
195
197
|
} else {
|
|
196
198
|
try {
|
|
197
|
-
const
|
|
198
|
-
|
|
199
|
+
const result = await this.pownedService.evaluateSecret(passphrase);
|
|
200
|
+
isPwnedServiceAvailable = result.isPwnedServiceAvailable;
|
|
201
|
+
notInDictionaryHint = isPwnedServiceAvailable ? (result.inDictionary ? "error" : "success") : "unavailable";
|
|
199
202
|
} catch (error) {
|
|
200
203
|
// If the service is unavailable don't block the user journey.
|
|
201
204
|
if (error instanceof ExternalServiceUnavailableError || error instanceof ExternalServiceError) {
|
|
@@ -336,6 +339,7 @@ CreateGpgKey.defaultProps = {
|
|
|
336
339
|
};
|
|
337
340
|
|
|
338
341
|
CreateGpgKey.propTypes = {
|
|
342
|
+
context: PropTypes.any, // The application context
|
|
339
343
|
onComplete: PropTypes.func.isRequired, // The callback function to call when the form is submitted
|
|
340
344
|
displayAs: PropTypes.PropTypes.oneOf([
|
|
341
345
|
CreateGpgKeyVariation.SETUP,
|
|
@@ -344,4 +348,4 @@ CreateGpgKey.propTypes = {
|
|
|
344
348
|
onSecondaryActionClick: PropTypes.func, // Callback to trigger when the user clicks on the secondary action link.
|
|
345
349
|
};
|
|
346
350
|
|
|
347
|
-
export default withTranslation("common")(CreateGpgKey);
|
|
351
|
+
export default withAppContext(withTranslation("common")(CreateGpgKey));
|
package/src/react-extension/components/Authentication/CreateGpgKey/CreateGpgKey.test.data.js
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* @since 3.0.0
|
|
13
13
|
*/
|
|
14
14
|
import {CreateGpgKeyVariation} from "./CreateGpgKey";
|
|
15
|
+
import {defaultAppContext} from "../../../contexts/ApiAppContext.test.data";
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* Default props
|
|
@@ -19,6 +20,9 @@ import {CreateGpgKeyVariation} from "./CreateGpgKey";
|
|
|
19
20
|
*/
|
|
20
21
|
export function defaultProps(props) {
|
|
21
22
|
const defaultProps = {
|
|
23
|
+
context: defaultAppContext({port: {
|
|
24
|
+
request: () => Promise.resolve(0)
|
|
25
|
+
}}),
|
|
22
26
|
displayAs: CreateGpgKeyVariation.SETUP,
|
|
23
27
|
onComplete: jest.fn(() => Promise.resolve()),
|
|
24
28
|
onSecondaryActionClick: jest.fn(() => Promise.resolve()),
|
|
@@ -20,16 +20,20 @@ import each from "jest-each";
|
|
|
20
20
|
import {CreateGpgKeyVariation} from "./CreateGpgKey";
|
|
21
21
|
import {defaultProps} from "./CreateGpgKey.test.data";
|
|
22
22
|
import CreateGpgKeyPage from "./CreateGpgKey.test.page";
|
|
23
|
-
import PwnedPasswords from "../../../../shared/lib/Secret/PwnedPasswords";
|
|
24
23
|
|
|
25
24
|
jest.mock("../../../../shared/lib/Secret/PwnedPasswords");
|
|
26
25
|
|
|
27
26
|
beforeEach(() => {
|
|
28
27
|
jest.resetModules();
|
|
28
|
+
jest.useFakeTimers();
|
|
29
29
|
jest.clearAllMocks();
|
|
30
|
-
PwnedPasswords.pwnedPasswords.mockResolvedValue(false);
|
|
31
30
|
});
|
|
32
31
|
|
|
32
|
+
afterEach(() => {
|
|
33
|
+
jest.clearAllTimers();
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
|
|
33
37
|
describe("CreateGpgKey", () => {
|
|
34
38
|
each([
|
|
35
39
|
{displayAs: CreateGpgKeyVariation.SETUP}, // Create a gpg key for the setup workflow
|
|
@@ -212,5 +216,15 @@ describe("CreateGpgKey", () => {
|
|
|
212
216
|
expect.assertions(1);
|
|
213
217
|
expect(page.title).toBe("Welcome to Passbolt, please select a passphrase!");
|
|
214
218
|
});
|
|
219
|
+
|
|
220
|
+
it('As AN I should be inform about ExternalServiceUnavailableError for powned password service', async() => {
|
|
221
|
+
const props = defaultProps({displayAs: CreateGpgKeyVariation.SETUP});
|
|
222
|
+
jest.spyOn(props.context.port, "request").mockImplementationOnce(() => Promise.reject());
|
|
223
|
+
const page = new CreateGpgKeyPage(props);
|
|
224
|
+
expect.assertions(2);
|
|
225
|
+
await page.fill("Service is unavailable");
|
|
226
|
+
expect(page.notInDictionaryHint.classList.contains("unavailable")).toBeTruthy();
|
|
227
|
+
expect(page.tootltip.textContent).toBe("The pwnedpasswords service is unavailable, your passphrase might be part of an exposed data breach");
|
|
228
|
+
});
|
|
215
229
|
});
|
|
216
230
|
});
|