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,558 @@
|
|
|
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 PropTypes from "prop-types";
|
|
16
|
+
import {withAppContext} from "./AppContext";
|
|
17
|
+
import SsoProviders from "../components/Administration/ManageSsoSettings/SsoProviders.data";
|
|
18
|
+
import {withDialog} from "./DialogContext";
|
|
19
|
+
import NotifyError from "../components/Common/Error/NotifyError/NotifyError";
|
|
20
|
+
import {withTranslation} from "react-i18next";
|
|
21
|
+
import TestSsoSettingsDialog from "../components/Administration/TestSsoSettingsDialog/TestSsoSettingsDialog";
|
|
22
|
+
import ConfirmDeleteSsoSettingsDialog from "../components/Administration/ConfirmDeleteSsoSettingsDialog/ConfirmDeleteSsoSettingsDialog";
|
|
23
|
+
import {withActionFeedback} from "./ActionFeedbackContext";
|
|
24
|
+
|
|
25
|
+
// taken from Validator.isUUID()
|
|
26
|
+
const UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[0-5][a-fA-F0-9]{3}-[089aAbB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$/;
|
|
27
|
+
|
|
28
|
+
export const AdminSsoContext = React.createContext({
|
|
29
|
+
ssoConfig: null, // The current sso configuration
|
|
30
|
+
isProcessing: () => {}, // true when the form is being processed
|
|
31
|
+
loadSsoConfiguration: () => {}, // Load the current sso configuration and store it in the state
|
|
32
|
+
getSsoConfiguration: () => {}, // Return the current sso configuration from the context state
|
|
33
|
+
isSsoConfigActivated: () => {}, // Returns true if the sso settings are set to active
|
|
34
|
+
isDataReady: () => {}, // Returns true if the data has been loaded from the API already
|
|
35
|
+
save: () => {}, // Save the sso configuration changes
|
|
36
|
+
disableSso: () => {}, // Disable the SSO configuration
|
|
37
|
+
getProvidersList: () => {}, // Returns the list of providers that the API supports
|
|
38
|
+
hasFormChanged: () => {}, // Returns true if the current form changed
|
|
39
|
+
validateData: () => {}, // Validates the current data in the state
|
|
40
|
+
saveAndTestConfiguration: () => {}, // Saves the current settings as a new draft and run the test dialog
|
|
41
|
+
openTestDialog: () => {}, // Opens the test SSO settings dialog
|
|
42
|
+
handleError: () => {}, // Handles error by displaying a NotifyError dialog
|
|
43
|
+
getErrors: () => {}, // Returns the errors detected during validation
|
|
44
|
+
deleteSettings: () => {}, // Delete the current SSO settings
|
|
45
|
+
showDeleteConfirmationDialog: () => {}, // Show the delete SSO settings confirmation dialog
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The related context provider
|
|
50
|
+
*/
|
|
51
|
+
export class AdminSsoContextProvider extends React.Component {
|
|
52
|
+
/**
|
|
53
|
+
* Default constructor
|
|
54
|
+
* @param props The component props
|
|
55
|
+
*/
|
|
56
|
+
constructor(props) {
|
|
57
|
+
super(props);
|
|
58
|
+
this.providerList = [];
|
|
59
|
+
this.state = this.defaultState;
|
|
60
|
+
this.bindCallbacks();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Returns the default component state
|
|
65
|
+
*/
|
|
66
|
+
get defaultState() {
|
|
67
|
+
return {
|
|
68
|
+
ssoConfig: this.defaultSsoSettings, // The current sso configuration
|
|
69
|
+
errors: {}, // The errors detected during the data validation
|
|
70
|
+
isLoaded: false, // is the SSO settings data loading from the server finished
|
|
71
|
+
hasSettingsChanged: false, // has the current form changed
|
|
72
|
+
processing: false, // true when the form is being processed
|
|
73
|
+
getErrors: this.getErrors.bind(this), // Returns the errors detected during validation
|
|
74
|
+
hasFormChanged: this.hasFormChanged.bind(this), // Returns true if the current form changed
|
|
75
|
+
isProcessing: this.isProcessing.bind(this), // returns true if a process is running and the UI must be disabled
|
|
76
|
+
isDataReady: this.isDataReady.bind(this), // returns true if the data has been loaded from the API already
|
|
77
|
+
loadSsoConfiguration: this.loadSsoConfiguration.bind(this), // Load the current sso configuration and store it in the state
|
|
78
|
+
getSsoConfiguration: this.getSsoConfiguration.bind(this), // Return the current sso configuration from the context state
|
|
79
|
+
isSsoConfigActivated: this.isSsoConfigActivated.bind(this), // Returns true if the sso settings are set to active
|
|
80
|
+
changeProvider: this.changeProvider.bind(this), // change the provider
|
|
81
|
+
disableSso: this.disableSso.bind(this), // Disable the SSO configuration
|
|
82
|
+
setValue: this.setValue.bind(this), // Set an SSO settings value to the current config
|
|
83
|
+
getProvidersList: this.getProvidersList.bind(this), // Returns the list of providers that the API supports
|
|
84
|
+
validateData: this.validateData.bind(this), // Validates the current data in the state
|
|
85
|
+
saveAndTestConfiguration: this.saveAndTestConfiguration.bind(this), // Saves the current settings as a new draft and run the test dialog
|
|
86
|
+
handleError: this.handleError.bind(this), // Handles error by displaying a NotifyError dialog
|
|
87
|
+
deleteSettings: this.deleteSettings.bind(this), // Delete the current SSO settings
|
|
88
|
+
canDeleteSettings: this.canDeleteSettings.bind(this), // Returns true if it is possible to call for a settings deletion
|
|
89
|
+
showDeleteConfirmationDialog: this.showDeleteConfirmationDialog.bind(this), // Show the delete SSO settings confirmation dialog
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Returns a default empty SSO settings.
|
|
95
|
+
* @returns {object}
|
|
96
|
+
*/
|
|
97
|
+
get defaultSsoSettings() {
|
|
98
|
+
return {
|
|
99
|
+
provider: null,
|
|
100
|
+
data: {
|
|
101
|
+
url: "",
|
|
102
|
+
redirect_url: "",
|
|
103
|
+
client_id: "",
|
|
104
|
+
tenant_id: "",
|
|
105
|
+
client_secret: "",
|
|
106
|
+
client_secret_expiry: "",
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Bind callbacks methods
|
|
113
|
+
*/
|
|
114
|
+
bindCallbacks() {
|
|
115
|
+
this.handleTestConfigCloseDialog = this.handleTestConfigCloseDialog.bind(this); // Handles the closing of the SSO test configuration dialog
|
|
116
|
+
this.handleSettingsActivation = this.handleSettingsActivation.bind(this); // Handles the UI processing after a successful settings activation
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Find the sso configuration
|
|
121
|
+
* @return {Promise<void>}
|
|
122
|
+
*/
|
|
123
|
+
async loadSsoConfiguration() {
|
|
124
|
+
let ssoConfig = null;
|
|
125
|
+
let isSsoConfigExisting = false;
|
|
126
|
+
try {
|
|
127
|
+
ssoConfig = await this.props.context.port.request("passbolt.sso.get-current");
|
|
128
|
+
this.setProviderList(ssoConfig.providers);
|
|
129
|
+
|
|
130
|
+
if (ssoConfig?.provider) {
|
|
131
|
+
isSsoConfigExisting = true;
|
|
132
|
+
const providerData = SsoProviders.find(provider => provider.id === ssoConfig.provider);
|
|
133
|
+
ssoConfig.data.redirect_url = providerData.defaultConfig.redirect_url;
|
|
134
|
+
}
|
|
135
|
+
} catch (error) {
|
|
136
|
+
this.setDefaultProvidersList(); //avoids to have an empty and non working UI
|
|
137
|
+
this.props.dialogContext.open(NotifyError, {error});
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
this.setState({
|
|
141
|
+
ssoConfig: ssoConfig,
|
|
142
|
+
isLoaded: true,
|
|
143
|
+
isSsoConfigExisting
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Sets the list of provider compatible with the API and the browser extension.
|
|
149
|
+
*
|
|
150
|
+
* @param {Array<string>} providerIdList
|
|
151
|
+
* @private
|
|
152
|
+
*/
|
|
153
|
+
setProviderList(providerIdList) {
|
|
154
|
+
if (!providerIdList) {
|
|
155
|
+
throw new Error(this.props.t("No SSO provider available"));
|
|
156
|
+
}
|
|
157
|
+
/*
|
|
158
|
+
* providers must be known on both side (API / Bext) in order to work.
|
|
159
|
+
* Obviously, the API can't work with an unknown provider.
|
|
160
|
+
* On Bext side, we can't provide a third-party SSO provider specific form if it's is unknown
|
|
161
|
+
*/
|
|
162
|
+
providerIdList.forEach(providerId => {
|
|
163
|
+
const provider = SsoProviders.find(provider => provider.id === providerId);
|
|
164
|
+
if (provider && !provider.disabled) {
|
|
165
|
+
this.providerList.push(provider);
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Sets the list of provider from the data known by the browser extension only.
|
|
172
|
+
*
|
|
173
|
+
* @private
|
|
174
|
+
*/
|
|
175
|
+
setDefaultProvidersList() {
|
|
176
|
+
SsoProviders.forEach(provider => {
|
|
177
|
+
if (!provider.disabled) {
|
|
178
|
+
this.providerList.push(provider);
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Get the current sso config from the context's state.
|
|
185
|
+
* @returns {Object}
|
|
186
|
+
*/
|
|
187
|
+
getSsoConfiguration() {
|
|
188
|
+
return this.state.ssoConfig;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Get the current SSO configuration with data ready for the background page.
|
|
193
|
+
* @return {Object}
|
|
194
|
+
* @private
|
|
195
|
+
*/
|
|
196
|
+
getSsoConfigurationDto() {
|
|
197
|
+
const config = this.getSsoConfiguration();
|
|
198
|
+
const data = config.data;
|
|
199
|
+
return {
|
|
200
|
+
provider: config.provider,
|
|
201
|
+
data: {
|
|
202
|
+
url: data.url,
|
|
203
|
+
client_id: data.client_id,
|
|
204
|
+
tenant_id: data.tenant_id,
|
|
205
|
+
client_secret: data.client_secret,
|
|
206
|
+
client_secret_expiry: data.client_secret_expiry,
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Get the current list of third party sso provider compatible with the API.
|
|
213
|
+
* @returns {Object}
|
|
214
|
+
*/
|
|
215
|
+
getProvidersList() {
|
|
216
|
+
return this.providerList;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Returns true if the sso settings are set to active.
|
|
221
|
+
* @returns {boolean}
|
|
222
|
+
*/
|
|
223
|
+
isSsoConfigActivated() {
|
|
224
|
+
return Boolean(this.state.ssoConfig?.provider);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Returns true if the current form changed
|
|
229
|
+
* @returns {boolean}
|
|
230
|
+
*/
|
|
231
|
+
hasFormChanged() {
|
|
232
|
+
return this.state.hasSettingsChanged;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Set an SSO settings value to the current config
|
|
237
|
+
* @param {string} key
|
|
238
|
+
* @param {string} value
|
|
239
|
+
*/
|
|
240
|
+
setValue(key, value) {
|
|
241
|
+
const ssoConfig = this.getSsoConfiguration();
|
|
242
|
+
ssoConfig.data[key] = value;
|
|
243
|
+
this.setState({ssoConfig, hasSettingsChanged: true});
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Disable the Sso configuration.
|
|
248
|
+
*/
|
|
249
|
+
disableSso() {
|
|
250
|
+
const ssoConfig = Object.assign({}, this.state.ssoConfig, {provider: null, data: {}});
|
|
251
|
+
this.setState({ssoConfig});
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Returns true if the data has finished to be loaded from the server.
|
|
256
|
+
* @returns {boolean}
|
|
257
|
+
*/
|
|
258
|
+
isDataReady() {
|
|
259
|
+
return this.state.isLoaded;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Returns true when the data is under processing
|
|
264
|
+
* @returns {boolean}
|
|
265
|
+
*/
|
|
266
|
+
isProcessing() {
|
|
267
|
+
return this.state.processing;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Change the currently selected provider.
|
|
272
|
+
*/
|
|
273
|
+
changeProvider(provider) {
|
|
274
|
+
if (provider.disabled) {
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
const selectedProvider = this.providerList.find(p => p.id === provider.id);
|
|
279
|
+
|
|
280
|
+
this.setState({
|
|
281
|
+
ssoConfig: {
|
|
282
|
+
provider: selectedProvider.id,
|
|
283
|
+
data: Object.assign({}, this.state.ssoConfig.data, selectedProvider?.defaultConfig)
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Returns the errors detected during validation
|
|
290
|
+
* @returns {object}
|
|
291
|
+
*/
|
|
292
|
+
getErrors() {
|
|
293
|
+
return this.state.errors;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Returns the first field with an error (first in the given list)
|
|
298
|
+
* @param {object} errors a ref object to put the validation onto
|
|
299
|
+
* @param {Array<string>} fieldPriority the ordered list of field to check
|
|
300
|
+
* @returns {string|null}
|
|
301
|
+
*/
|
|
302
|
+
getFirstFieldInError(errors, fieldPriority) {
|
|
303
|
+
for (let i = 0; i < fieldPriority.length; i++) {
|
|
304
|
+
const fieldName = fieldPriority[i];
|
|
305
|
+
if (typeof(errors[fieldName]) !== "undefined") {
|
|
306
|
+
return fieldName;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
return null;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Validates the current data in the state
|
|
314
|
+
* @returns {boolean} true if the data is valid, false otherwise
|
|
315
|
+
*/
|
|
316
|
+
validateData() {
|
|
317
|
+
const settings = this.state.getSsoConfiguration();
|
|
318
|
+
const errors = {};
|
|
319
|
+
|
|
320
|
+
const isProviderValid = this.validate_provider(settings.provider, errors);
|
|
321
|
+
|
|
322
|
+
if (!isProviderValid) {
|
|
323
|
+
this.fieldToFocus = "provider";
|
|
324
|
+
this.setState({errors, hasSumittedForm: true});
|
|
325
|
+
return false;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
const validationCallback = `validateDataFromProvider_${settings.provider}`;
|
|
329
|
+
const isFormValid = this[validationCallback](settings.data, errors);
|
|
330
|
+
|
|
331
|
+
if (!isFormValid) {
|
|
332
|
+
this.fieldToFocus = this.getFirstFieldInError(errors, ["url", "client_id", "tenant_id", "client_secret"]);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
this.setState({errors, hasSumittedForm: true});
|
|
336
|
+
|
|
337
|
+
return isFormValid;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Validates the current data in the state.
|
|
342
|
+
* @param {string} provider the provider id to validate
|
|
343
|
+
* @param {object} errors a ref object to put the validation onto
|
|
344
|
+
*/
|
|
345
|
+
validate_provider(provider, errors) {
|
|
346
|
+
const isProviderValid = this.providerList.find(p => p.id === provider);
|
|
347
|
+
|
|
348
|
+
if (!isProviderValid) {
|
|
349
|
+
errors.provider = this.props.t("The Single Sign-On provider must be a supported provider.");
|
|
350
|
+
return false;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
return true;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Validates the current data in the state assuming the SSO provider is Azure
|
|
358
|
+
* @param {string} data the data to validate
|
|
359
|
+
* @param {object} errors a ref object to put the validation onto
|
|
360
|
+
* @returns {boolean}
|
|
361
|
+
*/
|
|
362
|
+
validateDataFromProvider_azure(data, errors) {
|
|
363
|
+
const {url, client_id, tenant_id, client_secret, client_secret_expiry} = data;
|
|
364
|
+
let isDataValid = true;
|
|
365
|
+
if (!url || !(url?.length)) { // Validation of url
|
|
366
|
+
errors.url = this.props.t("The Login URL is required");
|
|
367
|
+
isDataValid = false;
|
|
368
|
+
} else if (!this.isValidUrl(url)) {
|
|
369
|
+
errors.url = this.props.t("The Login URL must be a valid URL");
|
|
370
|
+
isDataValid = false;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
if (!client_id || !(client_id?.length)) { // Validation of client_id
|
|
374
|
+
errors.client_id = this.props.t("The Application (client) ID is required");
|
|
375
|
+
isDataValid = false;
|
|
376
|
+
} else if (!this.isValidUuid(client_id)) {
|
|
377
|
+
errors.client_id = this.props.t("The Application (client) ID must be a valid UUID");
|
|
378
|
+
isDataValid = false;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
if (!tenant_id || !(tenant_id?.length)) { // Validation of tenant_id
|
|
382
|
+
errors.tenant_id = this.props.t("The Directory (tenant) ID is required");
|
|
383
|
+
isDataValid = false;
|
|
384
|
+
} else if (!this.isValidUuid(tenant_id)) {
|
|
385
|
+
errors.tenant_id = this.props.t("The Directory (tenant) ID must be a valid UUID");
|
|
386
|
+
isDataValid = false;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
// Validation of client_secret
|
|
390
|
+
if (!client_secret || !(client_secret?.length)) {
|
|
391
|
+
errors.client_secret = this.props.t("The Secret is required");
|
|
392
|
+
isDataValid = false;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
// Validation of client_secret_expiry
|
|
396
|
+
if (!client_secret_expiry) {
|
|
397
|
+
errors.client_secret_expiry = this.props.t("The Secret expiry is required");
|
|
398
|
+
isDataValid = false;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
return isDataValid;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* Returns true if the url is valid;
|
|
406
|
+
* @param {string} stringUrl
|
|
407
|
+
*/
|
|
408
|
+
isValidUrl(stringUrl) {
|
|
409
|
+
try {
|
|
410
|
+
const url = new URL(stringUrl);
|
|
411
|
+
return url.protocol === "http:" || url.protocol === "https:";
|
|
412
|
+
} catch (_) {
|
|
413
|
+
return false;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* Returns true if the UUID is valid;
|
|
419
|
+
* @param {string} stringUuid
|
|
420
|
+
*/
|
|
421
|
+
isValidUuid(stringUuid) {
|
|
422
|
+
return UUID_REGEXP.test(stringUuid);
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* Saves the current settings as a new draft and run the test dialog
|
|
427
|
+
*/
|
|
428
|
+
async saveAndTestConfiguration() {
|
|
429
|
+
this.setState({processing: true});
|
|
430
|
+
try {
|
|
431
|
+
const ssoSettings = this.getSsoConfigurationDto();
|
|
432
|
+
const draftConfiguration = await this.props.context.port.request("passbolt.sso.save-draft", ssoSettings);
|
|
433
|
+
await this.runTestConfig(draftConfiguration);
|
|
434
|
+
const providerData = SsoProviders.find(provider => provider.id === draftConfiguration.provider);
|
|
435
|
+
const ssoConfig = Object.assign({}, this.state.ssoConfig, draftConfiguration);
|
|
436
|
+
ssoConfig.data.redirect_url = providerData.defaultConfig.redirect_url;
|
|
437
|
+
this.setState({ssoConfig});
|
|
438
|
+
} catch (e) {
|
|
439
|
+
this.handleError(e);
|
|
440
|
+
this.setState({processing: false});
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Returns true if a SSo configuration exist on the API and the user disabled the settings.
|
|
446
|
+
* @returns {boolean}
|
|
447
|
+
*/
|
|
448
|
+
canDeleteSettings() {
|
|
449
|
+
const config = this.getSsoConfiguration();
|
|
450
|
+
return this.state.isSsoConfigExisting && config.provider === null;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* Show the delete settings confirmation dialog.
|
|
455
|
+
*/
|
|
456
|
+
showDeleteConfirmationDialog() {
|
|
457
|
+
this.props.dialogContext.open(ConfirmDeleteSsoSettingsDialog);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* Delete the current SSO settings.
|
|
462
|
+
* @return {Promise<void>}
|
|
463
|
+
*/
|
|
464
|
+
async deleteSettings() {
|
|
465
|
+
this.setState({processing: true});
|
|
466
|
+
try {
|
|
467
|
+
const ssoSettings = this.getSsoConfiguration();
|
|
468
|
+
await this.props.context.port.request("passbolt.sso.delete-settings", ssoSettings.id);
|
|
469
|
+
this.props.actionFeedbackContext.displaySuccess(this.props.t("The SSO settings has been deleted successfully"));
|
|
470
|
+
this.setState({
|
|
471
|
+
ssoConfig: this.defaultSsoSettings,
|
|
472
|
+
isSsoConfigExisting: false,
|
|
473
|
+
processing: false,
|
|
474
|
+
});
|
|
475
|
+
} catch (e) {
|
|
476
|
+
this.handleError(e);
|
|
477
|
+
this.setState({processing: false});
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* Opens the test SSO settings dialog
|
|
483
|
+
*
|
|
484
|
+
* @param {SsoConfigurationDto} draftConfiguration
|
|
485
|
+
*/
|
|
486
|
+
async runTestConfig(draftConfiguration) {
|
|
487
|
+
const selectedProvider = SsoProviders.find(provider => provider.id === draftConfiguration.provider);
|
|
488
|
+
this.props.dialogContext.open(TestSsoSettingsDialog, {
|
|
489
|
+
provider: selectedProvider,
|
|
490
|
+
configurationId: draftConfiguration.id,
|
|
491
|
+
handleClose: this.handleTestConfigCloseDialog,
|
|
492
|
+
onSuccessfulSettingsActivation: this.handleSettingsActivation,
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* Handles the closing of the SSO test configuration dialog
|
|
498
|
+
*/
|
|
499
|
+
handleTestConfigCloseDialog() {
|
|
500
|
+
this.setState({processing: false});
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* Handles the UI processing after a successful settings activation
|
|
505
|
+
*/
|
|
506
|
+
handleSettingsActivation() {
|
|
507
|
+
this.setState({hasSettingsChanged: false});
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* Handle exception by displaying a pop-up containing the details of the error.
|
|
512
|
+
* @param {Error} error
|
|
513
|
+
*/
|
|
514
|
+
handleError(error) {
|
|
515
|
+
console.error(error);
|
|
516
|
+
this.props.dialogContext.open(NotifyError, {error});
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* Render the component
|
|
521
|
+
* @returns {JSX}
|
|
522
|
+
*/
|
|
523
|
+
render() {
|
|
524
|
+
return (
|
|
525
|
+
<AdminSsoContext.Provider value={this.state}>
|
|
526
|
+
{this.props.children}
|
|
527
|
+
</AdminSsoContext.Provider>
|
|
528
|
+
);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
AdminSsoContextProvider.propTypes = {
|
|
533
|
+
context: PropTypes.any, // The application context
|
|
534
|
+
children: PropTypes.any, // The children components
|
|
535
|
+
accountRecoveryContext: PropTypes.object, // The account recovery context
|
|
536
|
+
dialogContext: PropTypes.object, // The dialog context
|
|
537
|
+
actionFeedbackContext: PropTypes.object, // The action feedback context
|
|
538
|
+
t: PropTypes.func, // The translation function
|
|
539
|
+
};
|
|
540
|
+
export default withAppContext(withActionFeedback(withDialog(withTranslation('common')(AdminSsoContextProvider))));
|
|
541
|
+
|
|
542
|
+
/**
|
|
543
|
+
* Resource Workspace Context Consumer HOC
|
|
544
|
+
* @param WrappedComponent
|
|
545
|
+
*/
|
|
546
|
+
export function withAdminSso(WrappedComponent) {
|
|
547
|
+
return class WithAdminSso extends React.Component {
|
|
548
|
+
render() {
|
|
549
|
+
return (
|
|
550
|
+
<AdminSsoContext.Consumer>
|
|
551
|
+
{
|
|
552
|
+
adminSsoContext => <WrappedComponent adminSsoContext={adminSsoContext} {...this.props} />
|
|
553
|
+
}
|
|
554
|
+
</AdminSsoContext.Consumer>
|
|
555
|
+
);
|
|
556
|
+
}
|
|
557
|
+
};
|
|
558
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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 {v4 as uuid} from "uuid";
|
|
15
|
+
|
|
16
|
+
export function defaultSsoSettings(data = {}) {
|
|
17
|
+
const defaultData = {
|
|
18
|
+
provider: null,
|
|
19
|
+
data: null,
|
|
20
|
+
providers: ["azure"]
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return {
|
|
24
|
+
...defaultData,
|
|
25
|
+
...data
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function withAzureSsoSettings(data = {}) {
|
|
30
|
+
const defaultData = defaultSsoSettings({
|
|
31
|
+
id: uuid(),
|
|
32
|
+
status: "active",
|
|
33
|
+
provider: "azure",
|
|
34
|
+
data: {
|
|
35
|
+
url: "https://login.microsoftonline.com/..",
|
|
36
|
+
tenant_id: "5n6p8r9s-m5n6-6p7q-3k5n-8r9s3k4m5n7q",
|
|
37
|
+
client_id: "f2j3m5n6-c3k4-m5p7-x2j4-y2k4m5n7q8r9",
|
|
38
|
+
client_secret: "u8x!A%D*G-KaPdSgVkYp3s6v9y$B?E..",
|
|
39
|
+
client_secret_expiry: "2022-11-02",
|
|
40
|
+
},
|
|
41
|
+
created_by: "d57c10f5-639d-5160-9c81-8a0c6c4ec856",
|
|
42
|
+
modified_by: "d57c10f5-639d-5160-9c81-8a0c6c4ec856",
|
|
43
|
+
created: "2022-11-24T09:14:13+00:00",
|
|
44
|
+
modified: "2022-11-24T09:14:13+00:00",
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
...defaultData,
|
|
49
|
+
...data
|
|
50
|
+
};
|
|
51
|
+
}
|