passbolt-browser-extension 3.0.6 → 4.6.2
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/.eslintrc.json +34 -18
- package/.github/workflows/release.yaml +17 -0
- package/.github/workflows/release_candidate.yaml +17 -0
- package/.gitlab-ci/jobs/build.yml +42 -0
- package/.gitlab-ci/jobs/publish.yml +38 -0
- package/.gitlab-ci/jobs/release.yml +21 -0
- package/.gitlab-ci/jobs/review.yml +25 -0
- package/.gitlab-ci/jobs/test.yml +32 -0
- package/.gitlab-ci/scripts/bin/publish.sh +63 -0
- package/.gitlab-ci/scripts/bin/review.sh +52 -0
- package/.gitlab-ci/scripts/bin/slack-status-messages.sh +33 -0
- package/.gitlab-ci/scripts/lib/git-helpers.sh +29 -0
- package/.gitlab-ci/scripts/lib/set-env.sh +25 -0
- package/.gitlab-ci/scripts/lib/version-check.sh +25 -0
- package/.gitlab-ci.yml +15 -16
- package/.jpmignore +5 -1
- package/CHANGELOG.md +993 -6
- package/Gruntfile.js +239 -149
- package/README.md +18 -1
- package/RELEASE_NOTES.md +23 -0
- package/crowdin.yml +21 -0
- package/i18next-parser.config.js +22 -0
- package/jest.config.json +29 -0
- package/package.json +95 -55
- package/src/all/_locales/de/messages.json +10 -0
- package/src/all/_locales/en/messages.json +10 -0
- package/src/all/_locales/es/messages.json +10 -0
- package/src/all/_locales/fr/messages.json +10 -0
- package/src/all/_locales/it/messages.json +10 -0
- package/src/all/_locales/ja/messages.json +10 -0
- package/src/all/_locales/ko/messages.json +10 -0
- package/src/all/_locales/locales.test.js +43 -0
- package/src/all/_locales/lt/messages.json +10 -0
- package/src/all/_locales/nl/messages.json +10 -0
- package/src/all/_locales/pl/messages.json +10 -0
- package/src/all/_locales/pt/messages.json +10 -0
- package/src/all/_locales/ro/messages.json +10 -0
- package/src/all/_locales/ru/messages.json +10 -0
- package/src/all/_locales/sv/messages.json +10 -0
- package/src/all/background_page/controller/InformMenuController/InformMenuController.js +147 -0
- package/src/all/background_page/controller/account/getAccountController.js +55 -0
- package/src/all/background_page/controller/account/getAccountController.test.js +91 -0
- package/src/all/background_page/controller/account/getAndInitializeAccountLocaleController.js +70 -0
- package/src/all/background_page/controller/account/getAndInitializeAccountLocaleController.test.js +75 -0
- package/src/all/background_page/controller/account/updatePrivateKeyController.js +127 -0
- package/src/all/background_page/controller/account/updatePrivateKeyController.test.js +317 -0
- package/src/all/background_page/controller/account/verifyAccountPassphraseController.js +68 -0
- package/src/all/background_page/controller/account/verifyAccountPassphraseController.test.js +59 -0
- package/src/all/background_page/controller/accountRecovery/abortAndInitiateNewAccountRecoveryController.js +61 -0
- package/src/all/background_page/controller/accountRecovery/abortAndInitiateNewAccountRecoveryControllerr.test.js +46 -0
- package/src/all/background_page/controller/accountRecovery/accountRecoveryGenerateOrganizationKeyController.js +73 -0
- package/src/all/background_page/controller/accountRecovery/accountRecoveryGenerateOrganizationKeyController.test.js +48 -0
- package/src/all/background_page/controller/accountRecovery/accountRecoveryGetRequestController.js +69 -0
- package/src/all/background_page/controller/accountRecovery/accountRecoveryGetRequestController.test.js +57 -0
- package/src/all/background_page/controller/accountRecovery/accountRecoveryGetUserRequestsController.js +64 -0
- package/src/all/background_page/controller/accountRecovery/accountRecoveryGetUserRequestsController.test.js +78 -0
- package/src/all/background_page/controller/accountRecovery/accountRecoverySaveOrganizationPolicyController.js +210 -0
- package/src/all/background_page/controller/accountRecovery/accountRecoverySaveOrganizationPolicyController.test.js +304 -0
- package/src/all/background_page/controller/accountRecovery/accountRecoverySaveUserSettingController.js +104 -0
- package/src/all/background_page/controller/accountRecovery/accountRecoverySaveUserSettingController.test.js +110 -0
- package/src/all/background_page/controller/accountRecovery/accountRecoveryValidateOrganizationPrivateKeyController.js +64 -0
- package/src/all/background_page/controller/accountRecovery/accountRecoveryValidateOrganizationPrivateKeyController.test.js +113 -0
- package/src/all/background_page/controller/accountRecovery/accountRecoveryValidatePublicKeyController.js +53 -0
- package/src/all/background_page/controller/accountRecovery/accountRecoveryValidatePublicKeyController.test.js +89 -0
- package/src/all/background_page/controller/accountRecovery/continueAccountRecoveryController.js +68 -0
- package/src/all/background_page/controller/accountRecovery/continueAccountRecoveryController.test.js +66 -0
- package/src/all/background_page/controller/accountRecovery/getOrganizationPolicyController.js +56 -0
- package/src/all/background_page/controller/accountRecovery/getOrganizationPolicyController.test.js +41 -0
- package/src/all/background_page/controller/accountRecovery/hasUserPostponedUserSettingInvitationController.js +50 -0
- package/src/all/background_page/controller/accountRecovery/hasUserPostponedUserSettingInvitationController.test.js +32 -0
- package/src/all/background_page/controller/accountRecovery/isLostPassphraseCaseController.js +53 -0
- package/src/all/background_page/controller/accountRecovery/isLostPassphraseCaseController.test.js +58 -0
- package/src/all/background_page/controller/accountRecovery/postponeUserSettingInvitationController.js +50 -0
- package/src/all/background_page/controller/accountRecovery/postponeUserSettingInvitationController.test.js +28 -0
- package/src/all/background_page/controller/accountRecovery/recoverAccountController.js +199 -0
- package/src/all/background_page/controller/accountRecovery/recoverAccountController.test.js +204 -0
- package/src/all/background_page/controller/accountRecovery/reviewRequestController.js +236 -0
- package/src/all/background_page/controller/accountRecovery/reviewRequestController.test.js +306 -0
- package/src/all/background_page/controller/app/appInitController.js +39 -10
- package/src/all/background_page/controller/app/appInitController.test.js +98 -0
- package/src/all/background_page/controller/auth/authCheckStatusController.js +3 -4
- package/src/all/background_page/controller/auth/authIsAuthenticatedController.js +2 -3
- package/src/all/background_page/controller/auth/authIsMfaRequiredController.js +2 -4
- package/src/all/background_page/controller/auth/authLoginController.js +130 -0
- package/src/all/background_page/controller/auth/authLoginController.test.js +164 -0
- package/src/all/background_page/controller/auth/authLogoutController.js +62 -0
- package/src/all/background_page/controller/auth/authLogoutController.test.js +55 -0
- package/src/all/background_page/controller/auth/authVerifyServerKeyController.js +120 -0
- package/src/all/background_page/controller/auth/authVerifyServerKeyController.test.js +61 -0
- package/src/all/background_page/controller/auth/authenticationEventController.js +67 -0
- package/src/all/background_page/controller/auth/generateSsoKitController.js +80 -0
- package/src/all/background_page/controller/auth/generateSsoKitController.test.js +100 -0
- package/src/all/background_page/controller/auth/requestHelpCredentialsLostController.js +54 -0
- package/src/all/background_page/controller/auth/requestHelpCredentialsLostController.test.js +42 -0
- package/src/all/background_page/controller/autofill/AutofillController.js +134 -0
- package/src/all/background_page/controller/autofill/AutofillController.test.js +149 -0
- package/src/all/background_page/controller/clipboard/clipboardController.js +53 -0
- package/src/all/background_page/controller/clipboard/clipboardController.test.js +68 -0
- package/src/all/background_page/controller/comment/createCommentController.js +57 -0
- package/src/all/background_page/controller/comment/createCommentController.test.js +105 -0
- package/src/all/background_page/controller/comment/deleteCommentController.js +66 -0
- package/src/all/background_page/controller/comment/deleteCommentController.test.js +105 -0
- package/src/all/background_page/controller/comment/getCommentsByRessourceIdController.js +68 -0
- package/src/all/background_page/controller/comment/getCommentsByRessourceidController.test.js +99 -0
- package/src/all/background_page/controller/crypto/checkPassphraseController.js +61 -0
- package/src/all/background_page/controller/crypto/checkPassphraseController.test.js +47 -0
- package/src/all/background_page/controller/crypto/downloadUserPrivateKeyController.js +70 -0
- package/src/all/background_page/controller/crypto/downloadUserPrivateKeyController.test.js +70 -0
- package/src/all/background_page/controller/crypto/downloadUserPublicKeyController.js +67 -0
- package/src/all/background_page/controller/crypto/downloadUserPublicKeyController.test.js +64 -0
- package/src/all/background_page/controller/crypto/getKeyInfoController.js +63 -0
- package/src/all/background_page/controller/crypto/getKeyInfoController.test.js +39 -0
- package/src/all/background_page/controller/crypto/getUserKeyInfoController.js +71 -0
- package/src/all/background_page/controller/crypto/getUserKeyInfoController.test.js +61 -0
- package/src/all/background_page/controller/crypto/getUserPrivateKeyController.js +63 -0
- package/src/all/background_page/controller/crypto/getUserPrivateKeyController.test.js +64 -0
- package/src/all/background_page/controller/crypto/validatePrivateGpgKeyRecoverController.js +74 -0
- package/src/all/background_page/controller/crypto/validatePrivateGpgKeyRecoverController.test.js +70 -0
- package/src/all/background_page/controller/crypto/validatePrivateGpgKeySetupController.js +114 -0
- package/src/all/background_page/controller/crypto/validatePrivateGpgKeySetupController.test.js +142 -0
- package/src/all/background_page/controller/export/exportResourcesFileController.js +50 -70
- package/src/all/background_page/controller/exportAccount/exportDesktopAccountController.js +75 -0
- package/src/all/background_page/controller/exportAccount/exportDesktopAccountController.test.data.js +25 -0
- package/src/all/background_page/controller/exportAccount/exportDesktopAccountController.test.js +104 -0
- package/src/all/background_page/controller/extension/getExtensionVersionController.js +51 -0
- package/src/all/background_page/controller/extension/getExtensionVersionController.test.js +28 -0
- package/src/all/background_page/controller/extension/isExtensionFirstInstallController.js +51 -0
- package/src/all/background_page/controller/extension/isExtensionFirstInstallController.test.js +45 -0
- package/src/all/background_page/controller/extension/onExtensionInstalledController.js +107 -0
- package/src/all/background_page/controller/extension/onExtensionInstalledController.test.js +109 -0
- package/src/all/background_page/controller/extension/onExtensionUpdateAvailableController.js +56 -0
- package/src/all/background_page/controller/extension/onExtensionUpdateAvailableController.test.js +76 -0
- package/src/all/background_page/controller/folder/folderCreateController.js +24 -21
- package/src/all/background_page/controller/group/groupUpdateController.js +53 -43
- package/src/all/background_page/controller/group/groupUpdateController.test.data.js +70 -0
- package/src/all/background_page/controller/group/groupUpdateController.test.js +169 -0
- package/src/all/background_page/controller/import/importResourcesFileController.js +75 -76
- package/src/all/background_page/controller/informCallToActionController/informCallToActionController.js +99 -0
- package/src/all/background_page/controller/locale/getLocaleController.js +58 -0
- package/src/all/background_page/controller/mfaPolicy/hasUserPostponedUserSettingInvitationController.js +50 -0
- package/src/all/background_page/controller/mfaPolicy/hasUserPostponedUserSettingInvitationController.test.js +32 -0
- package/src/all/background_page/controller/mfaPolicy/mfaGetMfaSettingsController.js +51 -0
- package/src/all/background_page/controller/mfaPolicy/mfaGetMfaSettingsController.test.data.js +21 -0
- package/src/all/background_page/controller/mfaPolicy/mfaGetMfaSettingsController.test.js +37 -0
- package/src/all/background_page/controller/mfaPolicy/mfaGetPolicyController.js +51 -0
- package/src/all/background_page/controller/mfaPolicy/mfaGetPolicyController.test.js +38 -0
- package/src/all/background_page/controller/mfaPolicy/postponeUserSettingMfaInvitationController.js +49 -0
- package/src/all/background_page/controller/mfaPolicy/postponeUserSettingMfaInvitationController.test.js +28 -0
- package/src/all/background_page/controller/mfaSetup/MfaSetupGetTotpCodeController.js +54 -0
- package/src/all/background_page/controller/mfaSetup/MfaSetupGetTotpCodeController.test.js +44 -0
- package/src/all/background_page/controller/mfaSetup/MfaSetupRemoveProviderController.js +58 -0
- package/src/all/background_page/controller/mfaSetup/MfaSetupRemoveProviderController.test.js +56 -0
- package/src/all/background_page/controller/mfaSetup/MfaSetupVerifyOtpCodeController.js +56 -0
- package/src/all/background_page/controller/mfaSetup/MfaSetupVerifyOtpCodeController.test.js +57 -0
- package/src/all/background_page/controller/mfaSetup/MfaSetupVerifyProviderController.js +58 -0
- package/src/all/background_page/controller/mfaSetup/MfaSetupVerifyProviderController.test.js +59 -0
- package/src/all/background_page/controller/mfaSetup/MfaSetupVerifyTotpCodeController.js +56 -0
- package/src/all/background_page/controller/mfaSetup/MfaSetupVerifyTotpCodeController.test.js +57 -0
- package/src/all/background_page/controller/mfaSetup/MfaSetupVerifyYubikeyCodeController.js +59 -0
- package/src/all/background_page/controller/mfaSetup/MfaSetupVerifyYubikeyCodeController.test.js +56 -0
- package/src/all/background_page/controller/move/moveController.js +17 -15
- package/src/all/background_page/controller/move/moveFolderController.js +80 -71
- package/src/all/background_page/controller/move/moveResourcesController.js +83 -62
- package/src/all/background_page/controller/move/moveResourcesController.test.js +117 -0
- package/src/all/background_page/controller/organizationSettings/getOrganizationSettingsController.js +55 -0
- package/src/all/background_page/controller/organizationSettings/getOrganizationSettingsController.test.js +45 -0
- package/src/all/background_page/controller/passwordExpiry/deletePasswordExpirySettingsController.js +55 -0
- package/src/all/background_page/controller/passwordExpiry/deletePasswordExpirySettingsController.test.js +66 -0
- package/src/all/background_page/controller/passwordExpiry/getOrFindPasswordExpirySettingsController.js +56 -0
- package/src/all/background_page/controller/passwordExpiry/getOrFindPasswordExpirySettingsController.test.js +113 -0
- package/src/all/background_page/controller/passwordExpiry/savePasswordExpirySettingsController.js +62 -0
- package/src/all/background_page/controller/passwordExpiry/savePasswordExpirySettingsController.test.js +108 -0
- package/src/all/background_page/controller/passwordPolicies/findPasswordPoliciesController.js +58 -0
- package/src/all/background_page/controller/passwordPolicies/findPasswordPoliciesController.test.js +90 -0
- package/src/all/background_page/controller/passwordPolicies/getOrFindPasswordPoliciesController.js +88 -0
- package/src/all/background_page/controller/passwordPolicies/getOrFindPasswordPoliciesController.test.js +177 -0
- package/src/all/background_page/controller/passwordPolicies/savePasswordPoliciesController.js +54 -0
- package/src/all/background_page/controller/passwordPolicies/savePasswordPoliciesController.test.js +87 -0
- package/src/all/background_page/controller/port/generatePortIdController.js +91 -0
- package/src/all/background_page/controller/port/generatePortIdController.test.js +123 -0
- package/src/all/background_page/controller/port/removePortController.js +105 -0
- package/src/all/background_page/controller/port/removePortController.test.js +162 -0
- package/src/all/background_page/controller/publicWebsiteSignIn/publicWebsiteSignInController.js +50 -0
- package/src/all/background_page/controller/publicWebsiteSignIn/publicWebsiteSignInController.test.js +45 -0
- package/src/all/background_page/controller/rbac/findMeController.js +55 -0
- package/src/all/background_page/controller/rbac/findMeController.test.js +49 -0
- package/src/all/background_page/controller/recover/abortAndRequestHelpController.js +55 -0
- package/src/all/background_page/controller/recover/abortAndRequestHelpController.test.js +42 -0
- package/src/all/background_page/controller/recover/completeRecoverController.js +64 -0
- package/src/all/background_page/controller/recover/completeRecoverController.test.js +77 -0
- package/src/all/background_page/controller/recover/generateRecoverAccountRecoveryRequestKeyController.js +74 -0
- package/src/all/background_page/controller/recover/generateRecoverAccountRecoveryRequestKeyController.test.js +52 -0
- package/src/all/background_page/controller/recover/hasRecoverUserEnabledAccountRecoveryController.js +51 -0
- package/src/all/background_page/controller/recover/hasRecoverUserEnabledAccountRecoveryController.test.js +42 -0
- package/src/all/background_page/controller/recover/importRecoverPrivateKeyController.js +86 -0
- package/src/all/background_page/controller/recover/importRecoverPrivateKeyController.test.js +148 -0
- package/src/all/background_page/controller/recover/requestAccountRecoveryController.js +74 -0
- package/src/all/background_page/controller/recover/requestAccountRecoveryController.test.js +66 -0
- package/src/all/background_page/controller/recover/startRecoverController.js +114 -0
- package/src/all/background_page/controller/recover/startRecoverController.test.js +137 -0
- package/src/all/background_page/controller/rememberMe/getUserRememberMeLatestChoiceController.js +55 -0
- package/src/all/background_page/controller/rememberMe/getUserRememberMeLatestChoiceController.test.js +50 -0
- package/src/all/background_page/controller/resource/resourceCreateController.js +53 -47
- package/src/all/background_page/controller/resource/resourceUpdateController.js +44 -39
- package/src/all/background_page/controller/resource/setResourcesExpiryDateController.js +74 -0
- package/src/all/background_page/controller/resource/setResourcesExpiryDateController.test.js +94 -0
- package/src/all/background_page/controller/resourceGridSetting/getResourceGridUserSettingController.js +53 -0
- package/src/all/background_page/controller/resourceGridSetting/getResourceGridUserSettingController.test.js +60 -0
- package/src/all/background_page/controller/resourceGridSetting/setResourceGridUserSettingController.js +56 -0
- package/src/all/background_page/controller/resourceGridSetting/setResourceGridUserSettingController.test.js +51 -0
- package/src/all/background_page/controller/secret/pownedPasswordController.js +54 -0
- package/src/all/background_page/controller/secret/pownedPasswordController.test.js +61 -0
- package/src/all/background_page/controller/secret/secretDecryptController.js +39 -46
- package/src/all/background_page/controller/secret/secretDecryptController.test.js +180 -0
- package/src/all/background_page/controller/setup/completeSetupController.js +63 -0
- package/src/all/background_page/controller/setup/completeSetupController.test.js +77 -0
- package/src/all/background_page/controller/setup/downloadRecoverKitController.js +59 -0
- package/src/all/background_page/controller/setup/downloadRecoverKitController.test.js +57 -0
- package/src/all/background_page/controller/setup/generateSetupKeyPairController.js +93 -0
- package/src/all/background_page/controller/setup/generateSetupKeyPairController.test.js +98 -0
- package/src/all/background_page/controller/setup/getAccountRecoveryOrganizationPolicyController.js +51 -0
- package/src/all/background_page/controller/setup/getAccountRecoveryOrganizationPolicyController.test.js +41 -0
- package/src/all/background_page/controller/setup/getAndInitSetupLocaleController.js +76 -0
- package/src/all/background_page/controller/setup/getAndInitSetupLocaleController.test.js +107 -0
- package/src/all/background_page/controller/setup/getUserPassphrasePoliciesController.js +54 -0
- package/src/all/background_page/controller/setup/getUserPassphrasePoliciesController.test.js +40 -0
- package/src/all/background_page/controller/setup/importSetupPrivateKeyController.js +94 -0
- package/src/all/background_page/controller/setup/importSetupPrivateKeyController.test.js +153 -0
- package/src/all/background_page/controller/setup/setSetupAccountRecoveryUserSettingController.js +98 -0
- package/src/all/background_page/controller/setup/setSetupAccountRecoveryUserSettingController.test.js +71 -0
- package/src/all/background_page/controller/setup/setSetupLocaleController.js +63 -0
- package/src/all/background_page/controller/setup/setSetupLocaleController.test.js +57 -0
- package/src/all/background_page/controller/setup/setSetupSecurityTokenController.js +55 -0
- package/src/all/background_page/controller/setup/setSetupSecurityTokenController.test.js +32 -0
- package/src/all/background_page/controller/setup/signInSetupController.js +85 -0
- package/src/all/background_page/controller/setup/signInSetupController.test.js +104 -0
- package/src/all/background_page/controller/setup/startSetupController.js +120 -0
- package/src/all/background_page/controller/setup/startSetupController.test.js +168 -0
- package/src/all/background_page/controller/setup/verifyImportedKeyPassphraseController.js +72 -0
- package/src/all/background_page/controller/setup/verifyImportedKeyPassphraseController.test.js +63 -0
- package/src/all/background_page/controller/share/shareFoldersController.js +62 -53
- package/src/all/background_page/controller/share/shareFoldersController.test.data.js +113 -0
- package/src/all/background_page/controller/share/shareFoldersController.test.js +242 -0
- package/src/all/background_page/controller/share/shareResourcesController.js +32 -32
- package/src/all/background_page/controller/share/shareResourcesController.test.data.js +129 -0
- package/src/all/background_page/controller/share/shareResourcesController.test.js +255 -0
- package/src/all/background_page/controller/sso/activateSsoSettingsController.js +61 -0
- package/src/all/background_page/controller/sso/activateSsoSettingsController.test.js +72 -0
- package/src/all/background_page/controller/sso/deleteLocalSsoKitController.js +52 -0
- package/src/all/background_page/controller/sso/deleteLocalSsoKitController.test.js +29 -0
- package/src/all/background_page/controller/sso/deleteSsoSettingsController.js +59 -0
- package/src/all/background_page/controller/sso/deleteSsoSettingsController.test.js +52 -0
- package/src/all/background_page/controller/sso/getCurrentSsoSettingsController.js +56 -0
- package/src/all/background_page/controller/sso/getCurrentSsoSettingsController.test.data.js +51 -0
- package/src/all/background_page/controller/sso/getCurrentSsoSettingsController.test.js +38 -0
- package/src/all/background_page/controller/sso/getLocalSsoProviderConfiguredController.js +62 -0
- package/src/all/background_page/controller/sso/getLocalSsoProviderConfiguredController.test.js +51 -0
- package/src/all/background_page/controller/sso/getQualifiedSsoLoginErrorController.js +56 -0
- package/src/all/background_page/controller/sso/getQualifiedSsoLoginErrorController.test.js +75 -0
- package/src/all/background_page/controller/sso/hasSsoLoginErrorController.js +53 -0
- package/src/all/background_page/controller/sso/hasSsoLoginErrorController.test.js +46 -0
- package/src/all/background_page/controller/sso/saveSsoSettingsAsDraftController.js +58 -0
- package/src/all/background_page/controller/sso/saveSsoSettingsAsDraftController.test.data.js +35 -0
- package/src/all/background_page/controller/sso/saveSsoSettingsAsDraftController.test.js +67 -0
- package/src/all/background_page/controller/sso/ssoAuthenticationController.js +159 -0
- package/src/all/background_page/controller/sso/ssoAuthenticationController.test.js +342 -0
- package/src/all/background_page/controller/sso/testSsoAuthenticationController.js +72 -0
- package/src/all/background_page/controller/sso/testSsoAuthenticationController.test.js +109 -0
- package/src/all/background_page/controller/sso/updateLocalSsoProviderController.js +56 -0
- package/src/all/background_page/controller/sso/updateLocalSsoProviderController.test.js +53 -0
- package/src/all/background_page/controller/subscription/subscriptionController.js +53 -0
- package/src/all/background_page/controller/tabsController.js +15 -14
- package/src/all/background_page/controller/tag/tagController.js +115 -0
- package/src/all/background_page/controller/toolbarController.js +228 -39
- package/src/all/background_page/controller/toolbarController.test.js +210 -0
- package/src/all/background_page/controller/user/getOrFindLoggedInUserController.js +56 -0
- package/src/all/background_page/controller/user/getOrFindLoggedInUserController.test.js +92 -0
- package/src/all/background_page/controller/user/updateUserController.js +57 -0
- package/src/all/background_page/controller/user/updateUserController.test.js +88 -0
- package/src/all/background_page/controller/user/updateUserLocalStorageController.js +56 -0
- package/src/all/background_page/controller/user/updateUserLocalStorageController.test.js +62 -0
- package/src/all/background_page/controller/userPassphrasePolicies/findUserPassphrasePoliciesController.js +52 -0
- package/src/all/background_page/controller/userPassphrasePolicies/findUserPassphrasePoliciesController.test.js +70 -0
- package/src/all/background_page/controller/userPassphrasePolicies/saveUserPassphrasePoliciesController.js +55 -0
- package/src/all/background_page/controller/userPassphrasePolicies/saveUserPassphrasePoliciesController.test.js +76 -0
- package/src/all/background_page/controller/webIntegration/webIntegrationController.js +54 -0
- package/src/all/background_page/error/GpgKeyError.js +1 -1
- package/src/all/background_page/error/badSignatureMessageGpgKeyError.js +22 -0
- package/src/all/background_page/error/deleteDryRunError.js +10 -8
- package/src/all/background_page/error/error.js +14 -6
- package/src/all/background_page/error/externalServiceError.js +17 -0
- package/src/all/background_page/error/externalServiceUnavailableError.js +17 -0
- package/src/all/background_page/error/fileFormatError.js +1 -1
- package/src/all/background_page/error/fileTypeError.js +1 -1
- package/src/all/background_page/error/importError.js +2 -2
- package/src/all/background_page/error/invalidMasterPasswordError.js +4 -4
- package/src/all/background_page/error/keyIsExpiredError.js +1 -1
- package/src/all/background_page/error/mfaAuthenticationRequiredError.js +10 -4
- package/src/all/background_page/error/notFoundError.js +3 -4
- package/src/all/background_page/error/outdatedSsoKitError.js +22 -0
- package/src/all/background_page/error/passboltBadResponseError.js +7 -3
- package/src/all/background_page/error/passboltServiceUnavailableError.js +4 -3
- package/src/all/background_page/error/passboltSubscriptionError.js +19 -0
- package/src/all/background_page/error/serverKeyChangedError.js +1 -1
- package/src/all/background_page/error/ssoDisabledError.js +21 -0
- package/src/all/background_page/error/ssoProviderMismatchError.js +22 -0
- package/src/all/background_page/error/ssoSettingsChangedError.js +21 -0
- package/src/all/background_page/error/userAbortsOperationError.js +2 -2
- package/src/all/background_page/error/userAlreadyLoggedInError.js +21 -0
- package/src/all/background_page/error/wrongOrganizationRecoveryKeyError.js +23 -0
- package/src/all/background_page/event/accountRecoveryEvents.js +89 -0
- package/src/all/background_page/event/actionLogEvents.js +11 -8
- package/src/all/background_page/event/appBootstrapEvents.js +6 -6
- package/src/all/background_page/event/appEvents.js +250 -5
- package/src/all/background_page/event/authEvents.js +125 -74
- package/src/all/background_page/event/clipboardEvents.js +21 -17
- package/src/all/background_page/event/commentEvents.js +25 -38
- package/src/all/background_page/event/configEvents.js +31 -24
- package/src/all/background_page/event/exportResourcesEvents.js +13 -30
- package/src/all/background_page/event/favoriteEvents.js +8 -12
- package/src/all/background_page/event/folderEvents.js +25 -25
- package/src/all/background_page/event/groupEvents.js +32 -31
- package/src/all/background_page/event/importResourcesEvents.js +12 -7
- package/src/all/background_page/event/informCallToActionEvents.js +60 -0
- package/src/all/background_page/event/informMenuEvents.js +99 -0
- package/src/all/background_page/event/keyringEvents.js +56 -95
- package/src/all/background_page/event/localeEvents.js +61 -0
- package/src/all/background_page/event/mfaEvents.js +77 -0
- package/src/all/background_page/event/mobileEvents.js +77 -0
- package/src/all/background_page/event/multiFactorAuthenticationEvents.js +11 -8
- package/src/all/background_page/event/organizationSettingsEvents.js +38 -0
- package/src/all/background_page/event/passwordPoliciesEvents.js +41 -0
- package/src/all/background_page/event/portEvents.js +30 -0
- package/src/all/background_page/event/pownedPasswordEvents.js +30 -0
- package/src/all/background_page/event/publicWebsiteSignInEvents.js +30 -0
- package/src/all/background_page/event/quickAccessEvents.js +110 -30
- package/src/all/background_page/event/recoverEvents.js +114 -102
- package/src/all/background_page/event/rememberMeEvents.js +29 -0
- package/src/all/background_page/event/resourceEvents.js +59 -27
- package/src/all/background_page/event/resourceTypeEvents.js +10 -7
- package/src/all/background_page/event/roleEvents.js +15 -13
- package/src/all/background_page/event/secretEvents.js +25 -17
- package/src/all/background_page/event/setupEvents.js +98 -131
- package/src/all/background_page/event/shareEvents.js +23 -46
- package/src/all/background_page/event/subscriptionEvents.js +57 -0
- package/src/all/background_page/event/tabEvents.js +13 -29
- package/src/all/background_page/event/tagEvents.js +32 -18
- package/src/all/background_page/event/themeEvents.js +15 -13
- package/src/all/background_page/event/userEvents.js +95 -74
- package/src/all/background_page/event/webIntegrationEvents.js +38 -0
- package/src/all/background_page/index.html +0 -1
- package/src/all/background_page/index.js +68 -88
- package/src/all/background_page/model/account/accountModel.js +46 -10
- package/src/all/background_page/model/accountRecovery/accountRecoveryModel.js +181 -0
- package/src/all/background_page/model/actionLog/actionLogModel.js +9 -7
- package/src/all/background_page/model/auth/authModel.js +33 -29
- package/src/all/background_page/model/auth/authModel.test.js +40 -0
- package/src/all/background_page/model/comment/commentModel.js +4 -4
- package/src/all/background_page/model/config.js +33 -28
- package/src/all/background_page/model/desktopTransfer/desktopTransferModel.js +34 -0
- package/src/all/background_page/model/desktopTransfer/desktopTransferModel.test.js +50 -0
- package/src/all/background_page/model/entity/account/abstractAccountEntity.js +312 -0
- package/src/all/background_page/model/entity/account/accountAccountRecoveryEntity.js +268 -0
- package/src/all/background_page/model/entity/account/accountAccountRecoveryEntity.test.data.js +51 -0
- package/src/all/background_page/model/entity/account/accountAccountRecoveryEntity.test.js +123 -0
- package/src/all/background_page/model/entity/account/accountEntity.js +112 -112
- package/src/all/background_page/model/entity/account/accountEntity.test.data.js +60 -0
- package/src/all/background_page/model/entity/account/accountEntity.test.js +126 -0
- package/src/all/background_page/model/entity/account/accountKitEntity.js +118 -0
- package/src/all/background_page/model/entity/account/accountKitEntity.test.data.js +25 -0
- package/src/all/background_page/model/entity/account/accountKitEntity.test.js +101 -0
- package/src/all/background_page/model/entity/account/accountRecoverEntity.js +260 -0
- package/src/all/background_page/model/entity/account/accountRecoverEntity.test.data.js +72 -0
- package/src/all/background_page/model/entity/account/accountSetupEntity.js +242 -0
- package/src/all/background_page/model/entity/account/accountSetupEntity.test.data.js +65 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryOrganizationPolicyChangeEntity.js +159 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryOrganizationPolicyChangeEntity.test.data.js +50 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryOrganizationPolicyChangeEntity.test.js +62 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryOrganizationPolicyEntity.js +375 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryOrganizationPolicyEntity.test.data.js +170 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryOrganizationPolicyEntity.test.js +179 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryOrganizationPublicKeyEntity.js +175 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryOrganizationPublicKeyEntity.test.data.js +85 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryOrganizationPublicKeyEntity.test.js +117 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryPrivateKeyEntity.js +177 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryPrivateKeyEntity.test.data.js +76 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryPrivateKeyEntity.test.js +41 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryPrivateKeyPasswordDecryptedDataEntity.js +166 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryPrivateKeyPasswordDecryptedDataEntity.test.data.js +29 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryPrivateKeyPasswordEntity.js +172 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryPrivateKeyPasswordEntity.test.data.js +75 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryPrivateKeyPasswordEntity.test.js +87 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryPrivateKeyPasswordsCollection.js +205 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryPrivateKeyPasswordsCollection.test.js +160 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryRequestCreateEntity.js +126 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryRequestEntity.js +232 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryRequestEntity.test.data.js +102 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryRequestEntity.test.fixtures.js +38 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryRequestEntity.test.js +101 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryRequestsCollection.js +196 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryRequestsCollection.test.js +165 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryResponseEntity.js +189 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryResponseEntity.test.data.js +92 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryResponseEntity.test.js +65 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryResponsesCollection.js +196 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryUserSettingEntity.js +193 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryUserSettingEntity.test.data.js +45 -0
- package/src/all/background_page/model/entity/accountRecovery/accountRecoveryUserSettingEntity.test.js +125 -0
- package/src/all/background_page/model/entity/accountRecovery/pendingAccountRecoveryRequestEntity.js +106 -0
- package/src/all/background_page/model/entity/accountRecovery/pendingAccountRecoveryRequestEntity.test.js +72 -0
- package/src/all/background_page/model/entity/actionLog/abstractActionLogEntity.js +31 -24
- package/src/all/background_page/model/entity/actionLog/actionLogsCollection.js +39 -32
- package/src/all/background_page/model/entity/actionLog/defaultActionLog.test.js +9 -16
- package/src/all/background_page/model/entity/actionLog/defaultActionLogEntity.js +11 -13
- package/src/all/background_page/model/entity/actionLog/permissionsUpdatedActionLogEntity.js +28 -26
- package/src/all/background_page/model/entity/auth/auth.test.data.js +23 -0
- package/src/all/background_page/model/entity/authenticationToken/authenticationTokenEntity.js +94 -20
- package/src/all/background_page/model/entity/authenticationToken/authenticationTokenEntity.test.js +99 -0
- package/src/all/background_page/model/entity/avatar/avatarEntity.js +17 -44
- package/src/all/background_page/model/entity/avatar/avatarEntity.test.js +126 -49
- package/src/all/background_page/model/entity/avatar/update/avatarUpdateEntity.js +22 -18
- package/src/all/background_page/model/entity/comment/commentEntity.js +32 -27
- package/src/all/background_page/model/entity/comment/commentEntity.test.js +18 -25
- package/src/all/background_page/model/entity/comment/comments.test.data.js +45 -0
- package/src/all/background_page/model/entity/comment/commentsCollection.js +34 -27
- package/src/all/background_page/model/entity/comment/commentsCollection.test.js +5 -12
- package/src/all/background_page/model/entity/export/exportResourcesFileEntity.js +130 -42
- package/src/all/background_page/model/entity/favorite/favoriteEntity.js +18 -42
- package/src/all/background_page/model/entity/favorite/favoriteEntity.test.js +113 -59
- package/src/all/background_page/model/entity/folder/external/externalFolderEntity.js +87 -41
- package/src/all/background_page/model/entity/folder/external/externalFolderEntity.test.js +85 -20
- package/src/all/background_page/model/entity/folder/external/externalFoldersCollection.js +73 -31
- package/src/all/background_page/model/entity/folder/external/externalFoldersCollection.test.js +16 -15
- package/src/all/background_page/model/entity/folder/folderEntity.js +55 -46
- package/src/all/background_page/model/entity/folder/folderEntity.test.js +364 -205
- package/src/all/background_page/model/entity/folder/foldersCollection.js +53 -41
- package/src/all/background_page/model/entity/folder/foldersCollection.test.js +21 -26
- package/src/all/background_page/model/entity/gpgkey/external/externalGpgKeyCollection.js +88 -0
- package/src/all/background_page/model/entity/gpgkey/external/externalGpgKeyCollection.test.js +40 -0
- package/src/all/background_page/model/entity/gpgkey/external/externalGpgKeyEntity.js +309 -0
- package/src/all/background_page/model/entity/gpgkey/external/externalGpgKeyEntity.test.data.js +33 -0
- package/src/all/background_page/model/entity/gpgkey/external/externalGpgKeyEntity.test.fixtures.js +111 -0
- package/src/all/background_page/model/entity/gpgkey/external/externalGpgKeyEntity.test.js +89 -0
- package/src/all/background_page/model/entity/gpgkey/external/externalGpgKeyPairEntity.js +140 -0
- package/src/all/background_page/model/entity/gpgkey/external/externalGpgKeyPairEntity.test.js +57 -0
- package/src/all/background_page/model/entity/gpgkey/generate/generateGpgKeyPairOptionsEntity.js +215 -0
- package/src/all/background_page/model/entity/gpgkey/generate/generateGpgKeyPairOptionsEntity.test.data.js +33 -0
- package/src/all/background_page/model/entity/gpgkey/generate/generateGpgKeyPairOptionsEntity.test.js +87 -0
- package/src/all/background_page/model/entity/gpgkey/gpgkeyEntity.js +22 -20
- package/src/all/background_page/model/entity/gpgkey/gpgkeyEntity.test.fixtures.js +17 -2
- package/src/all/background_page/model/entity/gpgkey/gpgkeyEntity.test.js +4 -12
- package/src/all/background_page/model/entity/gpgkey/privateGpgkeyEntity.js +83 -0
- package/src/all/background_page/model/entity/gpgkey/privateGpgkeyEntity.test.js +49 -0
- package/src/all/background_page/model/entity/group/groupEntity.js +37 -31
- package/src/all/background_page/model/entity/group/groupEntity.test.data.js +42 -0
- package/src/all/background_page/model/entity/group/groupEntity.test.fixtures.js +1 -1
- package/src/all/background_page/model/entity/group/groupEntity.test.js +2 -9
- package/src/all/background_page/model/entity/group/groupsCollection.js +44 -34
- package/src/all/background_page/model/entity/group/groupsCollection.test.js +5 -12
- package/src/all/background_page/model/entity/group/transfer/groupDeleteTransfer.js +29 -24
- package/src/all/background_page/model/entity/group/transfer/groupDeleteTransfer.test.js +6 -15
- package/src/all/background_page/model/entity/group/update/groupUpdateDryRunResultEntity.js +27 -24
- package/src/all/background_page/model/entity/group/update/groupUpdateDryRunResultEntity.test.data.js +24 -0
- package/src/all/background_page/model/entity/group/update/groupUpdateDryRunResultEntity.test.js +1 -8
- package/src/all/background_page/model/entity/group/update/groupUpdateEntity.js +35 -30
- package/src/all/background_page/model/entity/group/update/groupUpdateEntity.test.js +6 -13
- package/src/all/background_page/model/entity/groupUser/change/groupUserChangeEntity.js +19 -18
- package/src/all/background_page/model/entity/groupUser/change/groupUserChangeEntity.test.js +2 -9
- package/src/all/background_page/model/entity/groupUser/change/groupUserChangesCollection.js +25 -22
- package/src/all/background_page/model/entity/groupUser/groupUserEntity.js +28 -22
- package/src/all/background_page/model/entity/groupUser/groupUserEntity.test.fixtures.js +1 -1
- package/src/all/background_page/model/entity/groupUser/groupUserEntity.test.js +2 -9
- package/src/all/background_page/model/entity/groupUser/groupUsersEntity.test.data.js +38 -0
- package/src/all/background_page/model/entity/groupUser/groupsUsersCollection.js +36 -28
- package/src/all/background_page/model/entity/groupUser/groupsUsersCollection.test.fixtures.js +1 -1
- package/src/all/background_page/model/entity/groupUser/groupsUsersCollection.test.js +2 -9
- package/src/all/background_page/model/entity/groupUser/transfer/groupUserTransfer.test.js +9 -16
- package/src/all/background_page/model/entity/groupUser/transfer/groupUserTransferEntity.js +17 -17
- package/src/all/background_page/model/entity/groupUser/transfer/groupUserTransfersCollection.js +19 -17
- package/src/all/background_page/model/entity/groupUser/transfer/groupUserTransfersCollection.test.js +3 -10
- package/src/all/background_page/model/entity/import/importResourcesFileEntity.js +39 -32
- package/src/all/background_page/model/entity/import/importResourcesFileEntity.test.js +10 -15
- package/src/all/background_page/model/entity/locale/localeEntity.js +91 -0
- package/src/all/background_page/model/entity/locale/localeEntity.test.js +55 -0
- package/src/all/background_page/model/entity/locale/localesCollection.js +96 -0
- package/src/all/background_page/model/entity/mfa/mfaCombinedEnabledProvidersEntity.data.js +42 -0
- package/src/all/background_page/model/entity/mfa/mfaCombinedEnabledProvidersEntity.js +142 -0
- package/src/all/background_page/model/entity/mfa/mfaCombinedEnabledProvidersEntity.test.js +66 -0
- package/src/all/background_page/model/entity/mfa/mfaEnabledProviderEntity.js +104 -0
- package/src/all/background_page/model/entity/mfa/mfaEnabledProviderEntity.test.js +45 -0
- package/src/all/background_page/model/entity/mfa/mfaPolicyEntity.data.js +24 -0
- package/src/all/background_page/model/entity/mfa/mfaPolicyEntity.js +120 -0
- package/src/all/background_page/model/entity/mfa/mfaProviderEntity.js +86 -0
- package/src/all/background_page/model/entity/mfa/mfaProviderEntity.test.data.js +21 -0
- package/src/all/background_page/model/entity/mfa/mfaProviderEntity.test.js +49 -0
- package/src/all/background_page/model/entity/mfa/mfaSetupTotpEntity.js +70 -0
- package/src/all/background_page/model/entity/mfa/mfaSetupTotpEntity.test.data.js +29 -0
- package/src/all/background_page/model/entity/mfa/mfaSetupTotpEntity.test.js +51 -0
- package/src/all/background_page/model/entity/mfa/mfaSetupYubikeyEntity.js +66 -0
- package/src/all/background_page/model/entity/mfa/mfaSetupYubikeyEntity.test.data.js +21 -0
- package/src/all/background_page/model/entity/mfa/mfaSetupYubikeyEntity.test.js +54 -0
- package/src/all/background_page/model/entity/mfa/mfaTotpSetupInfoEntity.js +67 -0
- package/src/all/background_page/model/entity/mfa/mfaTotpSetupInfoEntity.test.data.js +20 -0
- package/src/all/background_page/model/entity/mfa/mfaTotpSetupInfoEntity.test.js +67 -0
- package/src/all/background_page/model/entity/mfa/mfaVerifyProviderEntity.js +66 -0
- package/src/all/background_page/model/entity/mfa/mfaVerifyProviderEntity.test.data.js +21 -0
- package/src/all/background_page/model/entity/mfa/mfaVerifyProviderEntity.test.js +49 -0
- package/src/all/background_page/model/entity/organizationSettings/organizationSettingsEntity.js +256 -0
- package/src/all/background_page/model/entity/organizationSettings/organizationSettingsEntity.test.data.js +254 -0
- package/src/all/background_page/model/entity/organizationSettings/organizationSettingsEntity.test.js +53 -0
- package/src/all/background_page/model/entity/passwordExpiry/passwordExpiryResourceCollection.test.data.js +22 -0
- package/src/all/background_page/model/entity/passwordExpiry/passwordExpiryResourceCollection.test.js +46 -0
- package/src/all/background_page/model/entity/passwordExpiry/passwordExpiryResourceEntity.js +110 -0
- package/src/all/background_page/model/entity/passwordExpiry/passwordExpiryResourceEntity.test.data.js +36 -0
- package/src/all/background_page/model/entity/passwordExpiry/passwordExpiryResourceEntity.test.js +104 -0
- package/src/all/background_page/model/entity/passwordExpiry/passwordExpiryResourcesCollection.js +147 -0
- package/src/all/background_page/model/entity/passwordExpiry/passwordExpiryResourcesCollection.test.js +69 -0
- package/src/all/background_page/model/entity/passwordPolicies/passphraseGeneratorSettingsEntity.js +110 -0
- package/src/all/background_page/model/entity/passwordPolicies/passphraseGeneratorSettingsEntity.test.data.js +24 -0
- package/src/all/background_page/model/entity/passwordPolicies/passphraseGeneratorSettingsEntity.test.js +80 -0
- package/src/all/background_page/model/entity/passwordPolicies/passwordGeneratorSettingsEntity.js +145 -0
- package/src/all/background_page/model/entity/passwordPolicies/passwordGeneratorSettingsEntity.test.data.js +33 -0
- package/src/all/background_page/model/entity/passwordPolicies/passwordGeneratorSettingsEntity.test.js +88 -0
- package/src/all/background_page/model/entity/passwordPolicies/passwordPoliciesEntity.js +204 -0
- package/src/all/background_page/model/entity/passwordPolicies/passwordPoliciesEntity.test.data.js +26 -0
- package/src/all/background_page/model/entity/passwordPolicies/passwordPoliciesEntity.test.js +106 -0
- package/src/all/background_page/model/entity/permission/actionLog/updatedPermissionEntity.js +28 -26
- package/src/all/background_page/model/entity/permission/actionLog/updatedPermissionEntity.test.js +6 -13
- package/src/all/background_page/model/entity/permission/actionLog/updatedPermissionsCollection.js +33 -27
- package/src/all/background_page/model/entity/permission/change/permissionChangeEntity.js +26 -22
- package/src/all/background_page/model/entity/permission/change/permissionChangesCollection.js +37 -32
- package/src/all/background_page/model/entity/permission/change/permissionChangesCollection.test.js +88 -105
- package/src/all/background_page/model/entity/permission/permissionEntity.js +53 -39
- package/src/all/background_page/model/entity/permission/permissionEntity.test.js +9 -16
- package/src/all/background_page/model/entity/permission/permissionsCollection.js +89 -70
- package/src/all/background_page/model/entity/permission/permissionsCollection.test.js +49 -55
- package/src/all/background_page/model/entity/permission/transfer/permissionTransfer.test.js +9 -16
- package/src/all/background_page/model/entity/permission/transfer/permissionTransferEntity.js +17 -17
- package/src/all/background_page/model/entity/permission/transfer/permissionTransfersCollection.js +19 -17
- package/src/all/background_page/model/entity/permission/transfer/permissionTransfersCollection.test.js +3 -10
- package/src/all/background_page/model/entity/plaintext/plaintextEntity.js +50 -8
- package/src/all/background_page/model/entity/profile/profileEntity.js +36 -30
- package/src/all/background_page/model/entity/profile/profileEntity.test.js +198 -114
- package/src/all/background_page/model/entity/rememberMe/userRememberMeLatestChoiceEntity.js +81 -0
- package/src/all/background_page/model/entity/rememberMe/userRememberMeLatestChoiceEntity.test.data.js +20 -0
- package/src/all/background_page/model/entity/rememberMe/userRememberMeLatestChoiceEntity.test.js +44 -0
- package/src/all/background_page/model/entity/resource/external/externalResourceEntity.js +70 -36
- package/src/all/background_page/model/entity/resource/external/externalResourceEntity.test.js +50 -16
- package/src/all/background_page/model/entity/resource/external/externalResourcesCollection.js +32 -28
- package/src/all/background_page/model/entity/resource/external/externalResourcesCollection.test.js +4 -11
- package/src/all/background_page/model/entity/resource/resourceEntity.js +115 -57
- package/src/all/background_page/model/entity/resource/resourceEntity.test.js +8 -15
- package/src/all/background_page/model/entity/resource/resourcesCollection.js +148 -39
- package/src/all/background_page/model/entity/resource/resourcesCollection.test.data.js +66 -0
- package/src/all/background_page/model/entity/resource/resourcesCollection.test.js +135 -26
- package/src/all/background_page/model/entity/resourceType/resourceTypeEntity.js +23 -17
- package/src/all/background_page/model/entity/resourceType/resourceTypeEntity.test.js +9 -16
- package/src/all/background_page/model/entity/resourceType/resourceTypesCollection.js +95 -30
- package/src/all/background_page/model/entity/resourceType/resourceTypesCollection.test.js +158 -0
- package/src/all/background_page/model/entity/secret/needed/neededSecretEntity.js +20 -18
- package/src/all/background_page/model/entity/secret/needed/neededSecretsCollection.js +23 -20
- package/src/all/background_page/model/entity/secret/resource/resourceSecretsCollection.js +37 -28
- package/src/all/background_page/model/entity/secret/secretEntity.js +20 -19
- package/src/all/background_page/model/entity/secret/secretEntity.test.data.js +27 -0
- package/src/all/background_page/model/entity/secret/secretEntity.test.js +13 -20
- package/src/all/background_page/model/entity/secret/secretsCollection.js +37 -28
- package/src/all/background_page/model/entity/securityToken/SecurityTokenEntity.test.data.js +23 -0
- package/src/all/background_page/model/entity/securityToken/securityTokenEntity.js +17 -16
- package/src/all/background_page/model/entity/securityToken/securityTokenEntity.test.js +7 -14
- package/src/all/background_page/model/entity/sso/ssoKitClientPart.test.data.js +31 -0
- package/src/all/background_page/model/entity/sso/ssoKitClientPartEntity.js +274 -0
- package/src/all/background_page/model/entity/sso/ssoKitClientPartEntity.test.js +131 -0
- package/src/all/background_page/model/entity/sso/ssoKitServerPart.test.data.js +18 -0
- package/src/all/background_page/model/entity/sso/ssoKitServerPartEntity.js +169 -0
- package/src/all/background_page/model/entity/sso/ssoKitServerPartEntity.test.js +87 -0
- package/src/all/background_page/model/entity/sso/ssoLoginUrlEntity.js +127 -0
- package/src/all/background_page/model/entity/sso/ssoLoginUrlEntity.test.js +89 -0
- package/src/all/background_page/model/entity/subscription/subscriptionEntity.js +113 -0
- package/src/all/background_page/model/entity/subscription/subscriptionEntity.test.js +75 -0
- package/src/all/background_page/model/entity/subscription/update/updateSubscriptionEntity.js +108 -0
- package/src/all/background_page/model/entity/subscription/update/updateSubscriptionEntity.test.js +55 -0
- package/src/all/background_page/model/entity/tag/tagEntity.js +20 -17
- package/src/all/background_page/model/entity/tag/tagEntity.test.data.js +31 -0
- package/src/all/background_page/model/entity/tag/tagEntity.test.js +16 -23
- package/src/all/background_page/model/entity/tag/tagsCollection.js +87 -46
- package/src/all/background_page/model/entity/tag/tagsCollection.test.js +199 -133
- package/src/all/background_page/model/entity/theme/change/ChangeThemeEntity.js +18 -18
- package/src/all/background_page/model/entity/theme/themeEntity.js +18 -17
- package/src/all/background_page/model/entity/theme/themeEntity.test.js +18 -17
- package/src/all/background_page/model/entity/theme/themesCollection.js +37 -28
- package/src/all/background_page/model/entity/totp/totpDto.test.data.js +29 -0
- package/src/all/background_page/model/entity/totp/totpEntity.js +202 -0
- package/src/all/background_page/model/entity/totp/totpEntity.test.js +111 -0
- package/src/all/background_page/model/entity/transfer/transferEntity.js +218 -0
- package/src/all/background_page/model/entity/transfer/transferEntity.test.js +111 -0
- package/src/all/background_page/model/entity/user/actionLog/loggedUserEntity.js +27 -24
- package/src/all/background_page/model/entity/user/actionLog/loggedUserEntity.test.js +6 -13
- package/src/all/background_page/model/entity/user/transfer/userDeleteTransfer.js +28 -25
- package/src/all/background_page/model/entity/user/transfer/userDeleteTransfer.test.js +9 -18
- package/src/all/background_page/model/entity/user/userEntity.js +113 -40
- package/src/all/background_page/model/entity/user/userEntity.test.fixtures.js +40 -5
- package/src/all/background_page/model/entity/user/userEntity.test.js +49 -20
- package/src/all/background_page/model/entity/user/usersCollection.js +41 -34
- package/src/all/background_page/model/entity/user/usersCollection.test.fixtures.js +18 -2
- package/src/all/background_page/model/entity/user/usersCollection.test.js +7 -14
- package/src/all/background_page/model/entity/worker/workerEntity.js +194 -0
- package/src/all/background_page/model/entity/worker/workerEntity.test.data.js +26 -0
- package/src/all/background_page/model/entity/worker/workerEntity.test.js +97 -0
- package/src/all/background_page/model/export/resources/argon2.test-lib.js +50 -0
- package/src/all/background_page/model/export/resources/csvRowComposer/abstractRowComposer.js +3 -1
- package/src/all/background_page/model/export/resources/csvRowComposer/csv1PasswordRowComposer.test.js +3 -10
- package/src/all/background_page/model/export/resources/csvRowComposer/csv1passwordRowComposer.js +4 -5
- package/src/all/background_page/model/export/resources/csvRowComposer/csvBitWardenRowComposer.js +52 -0
- package/src/all/background_page/model/export/resources/csvRowComposer/csvBitWardenRowComposer.test.js +36 -0
- package/src/all/background_page/model/export/resources/csvRowComposer/csvChromiumRowComposer.js +52 -0
- package/src/all/background_page/model/export/resources/csvRowComposer/csvChromiumRowComposer.test.js +34 -0
- package/src/all/background_page/model/export/resources/csvRowComposer/csvDashlaneRowComposer.js +52 -0
- package/src/all/background_page/model/export/resources/csvRowComposer/csvDashlaneRowComposer.test.js +35 -0
- package/src/all/background_page/model/export/resources/csvRowComposer/csvKdbxRowComposer.js +12 -6
- package/src/all/background_page/model/export/resources/csvRowComposer/csvKdbxRowComposer.test.js +30 -10
- package/src/all/background_page/model/export/resources/csvRowComposer/csvLastPassRowComposer.js +4 -5
- package/src/all/background_page/model/export/resources/csvRowComposer/csvLastPassRowComposer.test.js +2 -9
- package/src/all/background_page/model/export/resources/csvRowComposer/csvLogMeOnceRowComposer.js +52 -0
- package/src/all/background_page/model/export/resources/csvRowComposer/csvLogMeOnceRowComposer.test.js +36 -0
- package/src/all/background_page/model/export/resources/csvRowComposer/csvMozillaPlatformRowComposer.js +61 -0
- package/src/all/background_page/model/export/resources/csvRowComposer/csvMozillaPlatformRowComposer.test.js +39 -0
- package/src/all/background_page/model/export/resources/csvRowComposer/csvNordpassRowComposer.js +52 -0
- package/src/all/background_page/model/export/resources/csvRowComposer/csvNordpassRowComposer.test.js +36 -0
- package/src/all/background_page/model/export/resources/csvRowComposer/csvSafariRowComposer.js +52 -0
- package/src/all/background_page/model/export/resources/csvRowComposer/csvSafariRowComposer.test.js +35 -0
- package/src/all/background_page/model/export/resources/resourcesCsvExporter.js +22 -7
- package/src/all/background_page/model/export/resources/resourcesCsvExporter.test.js +24 -21
- package/src/all/background_page/model/export/resources/resourcesKdbxExporter.js +55 -11
- package/src/all/background_page/model/export/resources/resourcesKdbxExporter.test.js +127 -29
- package/src/all/background_page/model/export/resourcesExporter.js +4 -4
- package/src/all/background_page/model/favorite/favoriteModel.js +8 -6
- package/src/all/background_page/model/folder/folderModel.js +73 -55
- package/src/all/background_page/model/folder/folderModel.test.js +25 -29
- package/src/all/background_page/model/gpgAuthHeader.js +31 -34
- package/src/all/background_page/model/gpgAuthToken.js +13 -12
- package/src/all/background_page/model/gpgauth.js +72 -133
- package/src/all/background_page/model/group/groupModel.js +11 -13
- package/src/all/background_page/model/import/resources/csvRowParser/abstractCsvRowParser.js +4 -2
- package/src/all/background_page/model/import/resources/csvRowParser/csv1PasswordRowParser.js +6 -6
- package/src/all/background_page/model/import/resources/csvRowParser/csv1PasswordRowParser.test.js +7 -14
- package/src/all/background_page/model/import/resources/csvRowParser/csvBitWardenRowParser.js +65 -0
- package/src/all/background_page/model/import/resources/csvRowParser/csvBitWardenRowParser.test.js +74 -0
- package/src/all/background_page/model/import/resources/csvRowParser/csvChromiumRowParser.js +63 -0
- package/src/all/background_page/model/import/resources/csvRowParser/csvChromiumRowParser.test.js +69 -0
- package/src/all/background_page/model/import/resources/csvRowParser/csvDashlaneRowParser.js +68 -0
- package/src/all/background_page/model/import/resources/csvRowParser/csvDashlaneRowParser.test.js +71 -0
- package/src/all/background_page/model/import/resources/csvRowParser/csvKdbxRowParser.js +39 -15
- package/src/all/background_page/model/import/resources/csvRowParser/csvKdbxRowParser.test.js +53 -10
- package/src/all/background_page/model/import/resources/csvRowParser/csvLastPassRowParser.js +10 -8
- package/src/all/background_page/model/import/resources/csvRowParser/csvLastPassRowParser.test.js +2 -9
- package/src/all/background_page/model/import/resources/csvRowParser/csvLogMeOnceRowParser.js +66 -0
- package/src/all/background_page/model/import/resources/csvRowParser/csvLogMeOnceRowParser.test.js +74 -0
- package/src/all/background_page/model/import/resources/csvRowParser/csvMozillaPlatformRowParser.js +63 -0
- package/src/all/background_page/model/import/resources/csvRowParser/csvMozillaPlatformRowParser.test.js +67 -0
- package/src/all/background_page/model/import/resources/csvRowParser/csvNordpassRowParser.js +79 -0
- package/src/all/background_page/model/import/resources/csvRowParser/csvNordpassRowParser.test.js +74 -0
- package/src/all/background_page/model/import/resources/csvRowParser/csvSafariRowParser.js +65 -0
- package/src/all/background_page/model/import/resources/csvRowParser/csvSafariRowParser.test.js +71 -0
- package/src/all/background_page/model/import/resources/kdbx/kdbx-content-error-not-protected.kdbx +0 -0
- package/src/all/background_page/model/import/resources/kdbx/kdbx-protected-password.kdbx +0 -0
- package/src/all/background_page/model/import/resources/kdbx/kdbx-windows-with-totp-protected-password.kdbx +0 -0
- package/src/all/background_page/model/import/resources/kdbx/kdbx-with-totp-protected-password.kdbx +0 -0
- package/src/all/background_page/model/import/resources/resourcesCsvImportParser.js +36 -20
- package/src/all/background_page/model/import/resources/resourcesCsvImportParser.test.js +46 -40
- package/src/all/background_page/model/import/resources/resourcesKdbxImportParser.js +64 -35
- package/src/all/background_page/model/import/resources/resourcesKdbxImportParser.test.js +125 -35
- package/src/all/background_page/model/import/resourcesImportParser.js +6 -6
- package/src/all/background_page/model/import/resourcesImportParser.test.js +6 -16
- package/src/all/background_page/model/keyring.js +90 -214
- package/src/all/background_page/model/locale/localeModel.js +137 -0
- package/src/all/background_page/model/log.js +14 -35
- package/src/all/background_page/model/mobileTransfer/mobileTransferModel.js +63 -0
- package/src/all/background_page/model/multiFactorAuthentication/multiFactorAuthenticationModel.js +84 -4
- package/src/all/background_page/model/multiFactorAuthentication/multiFactorAuthenticationModel.test.js +84 -0
- package/src/all/background_page/model/organizationSettings/organizationSettingsModel.js +94 -0
- package/src/all/background_page/model/passwordExpiry/passwordExpiryResourceModel.js +49 -0
- package/src/all/background_page/model/passwordExpiry/passwordExpiryResourceModel.test.js +62 -0
- package/src/all/background_page/model/passwordExpiry/passwordExpirySettingsModel.js +110 -0
- package/src/all/background_page/model/passwordExpiry/passwordExpirySettingsModel.test.js +243 -0
- package/src/all/background_page/model/passwordPolicies/passwordPoliciesModel.js +86 -0
- package/src/all/background_page/model/passwordPolicies/passwordPoliciesModel.test.js +231 -0
- package/src/all/background_page/model/rbac/RbacModel.js +75 -0
- package/src/all/background_page/model/request.js +3 -3
- package/src/all/background_page/model/resource/resourceModel.js +186 -138
- package/src/all/background_page/model/resourceType/resourceTypeModel.js +20 -9
- package/src/all/background_page/model/role/roleModel.js +6 -6
- package/src/all/background_page/model/setup/setupModel.js +94 -41
- package/src/all/background_page/model/share/shareModel.js +165 -0
- package/src/all/background_page/model/sso/ssoDryRunModel.js +53 -0
- package/src/all/background_page/model/sso/ssoKitServerPartModel.js +71 -0
- package/src/all/background_page/model/sso/ssoLoginModel.js +46 -0
- package/src/all/background_page/model/sso/ssoSettingsModel.js +88 -0
- package/src/all/background_page/model/subscription/subscriptionModel.js +81 -0
- package/src/all/background_page/model/tag/tagModel.js +21 -17
- package/src/all/background_page/model/theme/themeModel.js +16 -11
- package/src/all/background_page/model/toolbar.js +8 -16
- package/src/all/background_page/model/user/userModel.js +88 -29
- package/src/all/background_page/model/user.js +78 -191
- package/src/all/background_page/model/userPassphrasePolicies/userPassphrasePoliciesModel.js +57 -0
- package/src/all/background_page/model/userPassphrasePolicies/userPassphrasePoliciesModel.test.js +136 -0
- package/src/all/background_page/model/userSettings/userSettings.js +80 -34
- package/src/all/background_page/model/userSettings/userSettings.test.js +26 -25
- package/src/all/background_page/pagemod/accountRecoveryBootstrapPagemod.js +79 -0
- package/src/all/background_page/pagemod/accountRecoveryBootstrapPagemod.test.js +96 -0
- package/src/all/background_page/pagemod/accountRecoveryPagemod.js +61 -0
- package/src/all/background_page/pagemod/accountRecoveryPagemod.test.js +87 -0
- package/src/all/background_page/pagemod/appBootstrapPagemod.js +104 -0
- package/src/all/background_page/pagemod/appBootstrapPagemod.test.js +124 -0
- package/src/all/background_page/pagemod/appPagemod.js +111 -56
- package/src/all/background_page/pagemod/appPagemod.test.js +184 -0
- package/src/all/background_page/pagemod/authBootstrapPagemod.js +77 -51
- package/src/all/background_page/pagemod/authBootstrapPagemod.test.js +110 -0
- package/src/all/background_page/pagemod/authPagemod.js +61 -35
- package/src/all/background_page/pagemod/authPagemod.test.js +86 -0
- package/src/all/background_page/pagemod/filePagemod.js +24 -31
- package/src/all/background_page/pagemod/filePagemod.test.js +53 -0
- package/src/all/background_page/pagemod/informCallToActionPagemod.js +59 -0
- package/src/all/background_page/pagemod/informCallToActionPagemod.test.js +67 -0
- package/src/all/background_page/pagemod/informMenuPagemod.js +59 -0
- package/src/all/background_page/pagemod/informMenuPagemod.test.js +69 -0
- package/src/all/background_page/pagemod/pagemod.js +127 -0
- package/src/all/background_page/pagemod/pagemod.test.js +58 -0
- package/src/all/background_page/pagemod/pagemodManager.js +110 -0
- package/src/all/background_page/pagemod/pagemodManager.test.js +197 -0
- package/src/all/background_page/pagemod/publicWebsiteSignInPagemod.js +100 -0
- package/src/all/background_page/pagemod/publicWebsiteSignInPagemod.test.js +111 -0
- package/src/all/background_page/pagemod/quickAccessPagemod.js +74 -38
- package/src/all/background_page/pagemod/quickAccessPagemod.test.js +104 -0
- package/src/all/background_page/pagemod/recoverBootstrapPagemod.js +75 -41
- package/src/all/background_page/pagemod/recoverBootstrapPagemod.test.js +98 -0
- package/src/all/background_page/pagemod/recoverPagemod.js +48 -35
- package/src/all/background_page/pagemod/recoverPagemod.test.js +73 -0
- package/src/all/background_page/pagemod/setupBootstrapPagemod.js +75 -41
- package/src/all/background_page/pagemod/setupBootstrapPagemod.test.js +98 -0
- package/src/all/background_page/pagemod/setupPagemod.js +46 -35
- package/src/all/background_page/pagemod/setupPagemod.test.js +73 -0
- package/src/all/background_page/pagemod/webIntegrationPagemod.js +82 -35
- package/src/all/background_page/pagemod/webIntegrationPagemod.test.js +119 -0
- package/src/all/background_page/sdk/i18n.js +68 -0
- package/src/all/background_page/sdk/port/portManager.js +187 -0
- package/src/all/background_page/sdk/port/portManager.test.data.js +32 -0
- package/src/all/background_page/sdk/port/portManager.test.js +160 -0
- package/src/all/background_page/sdk/port.js +154 -74
- package/src/all/background_page/sdk/port.test.js +158 -0
- package/src/all/background_page/sdk/scriptExecution.js +125 -94
- package/src/all/background_page/sdk/scriptExecution.test.js +143 -0
- package/src/all/background_page/sdk/storage.js +16 -16
- package/src/all/background_page/service/account/buildApiClientOptionsService.js +37 -0
- package/src/all/background_page/service/account/buildApiClientOptionsService.test.js +83 -0
- package/src/all/background_page/service/account/getDecryptedUserPrivateKeyService.js +38 -0
- package/src/all/background_page/service/account/getDecryptedUserPrivateKeyService.test.js +44 -0
- package/src/all/background_page/service/account/getLegacyAccountService.js +67 -0
- package/src/all/background_page/service/account/updateSsoCredentialsService.js +88 -0
- package/src/all/background_page/service/accountRecovery/buildApprovedAccountRecoveryUserSettingEntityService.js +115 -0
- package/src/all/background_page/service/accountRecovery/buildApprovedAccountRecoveryUserSettingEntityService.service.test.js +83 -0
- package/src/all/background_page/service/accountRecovery/decryptPrivateKeyPasswordDataService.js +74 -0
- package/src/all/background_page/service/accountRecovery/decryptPrivateKeyPasswordDataService.test.js +125 -0
- package/src/all/background_page/service/accountRecovery/decryptResponseDataService.js +66 -0
- package/src/all/background_page/service/accountRecovery/decryptResponseDataService.test.js +112 -0
- package/src/all/background_page/service/accountRecovery/getRequestLocalAccountService.js +52 -0
- package/src/all/background_page/service/accountRecovery/getRequestLocalAccountService.test.js +77 -0
- package/src/all/background_page/service/accountRecovery/parseAccountRecoveryUrlService.js +61 -0
- package/src/all/background_page/service/accountRecovery/parseAccountRecoveryUrlService.test.js +60 -0
- package/src/all/background_page/service/api/abstract/abstractService.js +13 -10
- package/src/all/background_page/service/api/abstract/abstractService.test.js +8 -16
- package/src/all/background_page/service/api/accountRecovery/accountRecoveryContinueService.js +52 -0
- package/src/all/background_page/service/api/accountRecovery/accountRecoveryOrganizationPolicyService.js +155 -0
- package/src/all/background_page/service/api/accountRecovery/accountRecoveryOrganizationPolicyService.test.data.js +25 -0
- package/src/all/background_page/service/api/accountRecovery/accountRecoveryOrganizationPolicyService.test.js +59 -0
- package/src/all/background_page/service/api/accountRecovery/accountRecoveryPrivateKeyPasswordService.js +52 -0
- package/src/all/background_page/service/api/accountRecovery/accountRecoveryRequestService.js +122 -0
- package/src/all/background_page/service/api/accountRecovery/accountRecoveryResponseService.js +50 -0
- package/src/all/background_page/service/api/accountRecovery/accountRecoveryUserService.js +54 -0
- package/src/all/background_page/service/api/accountRecovery/validateAccountRecoveryOrganizationPrivateKeyService.js +47 -0
- package/src/all/background_page/service/api/accountRecovery/validateAccountRecoveryOrganizationPrivateKeyService.test.data.js +69 -0
- package/src/all/background_page/service/api/accountRecovery/validateAccountRecoveryOrganizationPrivateKeyService.test.js +52 -0
- package/src/all/background_page/service/api/accountSettings/accountSettingsService.js +31 -4
- package/src/all/background_page/service/api/actionLog/actionLogService.js +3 -3
- package/src/all/background_page/service/api/auth/authService.js +47 -13
- package/src/all/background_page/service/api/auth/authService.test.js +103 -0
- package/src/all/background_page/service/api/comment/commentService.js +4 -3
- package/src/all/background_page/service/api/favorite/favoriteService.js +4 -4
- package/src/all/background_page/service/api/folder/folderService.js +8 -9
- package/src/all/background_page/service/api/group/groupService.js +16 -12
- package/src/all/background_page/service/api/group/groupService.test.js +6 -11
- package/src/all/background_page/service/api/mobileTransferService/mobileTransferService.js +84 -0
- package/src/all/background_page/service/api/move/moveService.js +5 -5
- package/src/all/background_page/service/api/multiFactorAuthentication/multiFactorAuthenticationPolicyService.js +53 -0
- package/src/all/background_page/service/api/multiFactorAuthentication/multiFactorAuthenticationService.js +82 -2
- package/src/all/background_page/service/api/organizationSettings/organizationSettingsService.js +58 -0
- package/src/all/background_page/service/api/passwordExpiry/passwordExpiryResourceService.js +52 -0
- package/src/all/background_page/service/api/passwordExpiry/passwordExpiryResourceService.test.js +82 -0
- package/src/all/background_page/service/api/passwordExpiry/passwordExpirySettingsService.js +72 -0
- package/src/all/background_page/service/api/passwordExpiry/passwordExpirySettingsService.test.js +157 -0
- package/src/all/background_page/service/api/passwordPolicies/passwordPoliciesService.js +92 -0
- package/src/all/background_page/service/api/passwordPolicies/passwordPoliciesService.test.js +127 -0
- package/src/all/background_page/service/api/resource/resourceLocalStorageUpdateService.js +112 -0
- package/src/all/background_page/service/api/resource/resourceLocalStorageUpdateService.test.js +109 -0
- package/src/all/background_page/service/api/resource/resourceService.js +6 -6
- package/src/all/background_page/service/api/resourceType/resourceTypeService.js +2 -2
- package/src/all/background_page/service/api/role/roleService.js +2 -2
- package/src/all/background_page/service/api/setup/setupService.js +51 -22
- package/src/all/background_page/service/api/share/shareService.js +35 -3
- package/src/all/background_page/service/api/sso/ssoDryRunService.js +68 -0
- package/src/all/background_page/service/api/sso/ssoKitServerPartService.js +81 -0
- package/src/all/background_page/service/api/sso/ssoLoginService.js +67 -0
- package/src/all/background_page/service/api/sso/ssoSettingsService.js +105 -0
- package/src/all/background_page/service/api/subscription/subscriptionService.js +63 -0
- package/src/all/background_page/service/api/tag/tagService.js +3 -3
- package/src/all/background_page/service/api/user/userService.js +21 -58
- package/src/all/background_page/service/api/userPassphrasePolicies/userPassphrasePoliciesService.js +63 -0
- package/src/all/background_page/service/api/userPassphrasePolicies/userPassphrasePoliciesService.test.js +121 -0
- package/src/all/background_page/service/app/parseAppUrlService.js +66 -0
- package/src/all/background_page/service/app/parseAppUrlService.test.js +155 -0
- package/src/all/background_page/service/auth/parseAuthUrlService.js +37 -0
- package/src/all/background_page/service/auth/parseAuthUrlService.test.js +56 -0
- package/src/all/background_page/service/auth/startLoopAuthSessionCheckService.js +76 -0
- package/src/all/background_page/service/auth/startLoopAuthSessionCheckService.test.js +91 -0
- package/src/all/background_page/service/auth.js +20 -106
- package/src/all/background_page/service/cache/resourceInProgressCache.service.js +117 -0
- package/src/all/background_page/service/cache/resourceInProgressCache.service.test.js +102 -0
- package/src/all/background_page/service/crypto/checkPassphraseService.js +52 -0
- package/src/all/background_page/service/crypto/compareGpgKeyService.js +40 -0
- package/src/all/background_page/service/crypto/compareGpgKeyService.test.js +51 -0
- package/src/all/background_page/service/crypto/cryptoRandomValuesService.js +30 -0
- package/src/all/background_page/service/crypto/cryptoRandomValuesService.test.js +26 -0
- package/src/all/background_page/service/crypto/decryptMessageService.js +97 -0
- package/src/all/background_page/service/crypto/decryptMessageService.test.js +189 -0
- package/src/all/background_page/service/crypto/decryptPrivateKeyService.js +45 -0
- package/src/all/background_page/service/crypto/decryptPrivateKeyService.test.js +41 -0
- package/src/all/background_page/service/crypto/decryptSsoPassphraseService.js +77 -0
- package/src/all/background_page/service/crypto/decryptSsoPassphraseService.test.js +105 -0
- package/src/all/background_page/service/crypto/encryptMessageService.js +63 -0
- package/src/all/background_page/service/crypto/encryptMessageService.test.js +149 -0
- package/src/all/background_page/service/crypto/encryptPrivateKeyService.js +40 -0
- package/src/all/background_page/service/crypto/encryptPrivateKeyService.test.js +61 -0
- package/src/all/background_page/service/crypto/encryptSsoPassphraseService.js +52 -0
- package/src/all/background_page/service/crypto/encryptSsoPassphraseService.test.js +63 -0
- package/src/all/background_page/service/crypto/generateGpgKeyPairService.js +85 -0
- package/src/all/background_page/service/crypto/generateGpgKeyPairService.test.js +112 -0
- package/src/all/background_page/service/crypto/generateSsoIvService.js +27 -0
- package/src/all/background_page/service/crypto/generateSsoIvService.test.js +41 -0
- package/src/all/background_page/service/crypto/generateSsoKeyService.js +32 -0
- package/src/all/background_page/service/crypto/generateSsoKeyService.test.js +43 -0
- package/src/all/background_page/service/crypto/getGpgKeyCreationDateService.js +41 -0
- package/src/all/background_page/service/crypto/getGpgKeyCreationDateService.test.js +59 -0
- package/src/all/background_page/service/crypto/getGpgKeyInfoService.js +152 -0
- package/src/all/background_page/service/crypto/getGpgKeyInfoService.test.data.js +100 -0
- package/src/all/background_page/service/crypto/getGpgKeyInfoService.test.js +155 -0
- package/src/all/background_page/service/crypto/revokeGpgKeyService.js +35 -0
- package/src/all/background_page/service/crypto/revokeGpgKeyService.test.js +35 -0
- package/src/all/background_page/service/crypto/signGpgKeyService.js +31 -0
- package/src/all/background_page/service/crypto/signGpgKeyService.test.js +41 -0
- package/src/all/background_page/service/crypto/signMessageService.js +55 -0
- package/src/all/background_page/service/crypto/signMessageService.test.js +94 -0
- package/src/all/background_page/service/crypto/verifyGpgKeyService.js +34 -0
- package/src/all/background_page/service/crypto/verifyGpgKeyService.test.js +99 -0
- package/src/all/background_page/service/crypto/verifyMessageSign.js +56 -0
- package/src/all/background_page/service/crypto/verifyMessageSign.test.data.js +44 -0
- package/src/all/background_page/service/crypto/verifyMessageSign.test.js +116 -0
- package/src/all/background_page/service/file/fileService.js +67 -0
- package/src/all/background_page/service/file/fileService.test.js +66 -0
- package/src/all/background_page/service/indexedDB_storage/ssoDataStorage.js +290 -0
- package/src/all/background_page/service/invitation/postponeUserSettingInvitationService.js +60 -0
- package/src/all/background_page/service/invitation/postponeUserSettingInvitationService.test.js +52 -0
- package/src/all/background_page/service/localStorage/localStorageService.js +73 -0
- package/src/all/background_page/service/localStorage/localStorageService.test.js +102 -0
- package/src/all/background_page/service/local_storage/AccountLocalStorage.test.js +216 -0
- package/src/all/background_page/service/local_storage/accountLocalStorage.js +118 -0
- package/src/all/background_page/service/local_storage/authStatusLocalStorage.js +8 -21
- package/src/all/background_page/service/local_storage/folderLocalStorage.js +20 -34
- package/src/all/background_page/service/local_storage/groupLocalStorage.js +17 -31
- package/src/all/background_page/service/local_storage/passwordExpirySettingsLocalStorage.js +73 -0
- package/src/all/background_page/service/local_storage/passwordExpirySettingsLocalStorage.test.js +72 -0
- package/src/all/background_page/service/local_storage/passwordGeneratorLocalStorage.js +36 -0
- package/src/all/background_page/service/local_storage/passwordPoliciesLocalStorage.js +98 -0
- package/src/all/background_page/service/local_storage/rbacLocalStorage.js +109 -0
- package/src/all/background_page/service/local_storage/rbacLocalStorage.test.js +68 -0
- package/src/all/background_page/service/local_storage/resourceLocalStorage.js +89 -44
- package/src/all/background_page/service/local_storage/resourceTypeLocalStorage.js +17 -29
- package/src/all/background_page/service/local_storage/ressourceGridSettingLocalStorage.js +70 -0
- package/src/all/background_page/service/local_storage/rolesLocalStorage.js +17 -29
- package/src/all/background_page/service/local_storage/userLocalStorage.js +25 -36
- package/src/all/background_page/service/local_storage/userRememberMeLatestChoiceLocalStorage.js +82 -0
- package/src/all/background_page/service/local_storage/userRememberMeLatestChoiceLocalStorage.test.js +74 -0
- package/src/all/background_page/service/passphrase/getPassphraseService.js +152 -0
- package/src/all/background_page/service/passphrase/getPassphraseService.test.js +258 -0
- package/src/all/background_page/service/passwordExpirySettings/passwordExpirySettingsGetOrFindService.js +49 -0
- package/src/all/background_page/service/passwordExpirySettings/passwordExpirySettingsGetOrFindService.test.js +45 -0
- package/src/all/background_page/service/progress/progressService.js +120 -0
- package/src/all/background_page/service/progress/progressService.test.js +69 -0
- package/src/all/background_page/service/publicWebsite/parsePublicWebsiteUrlService.js +35 -0
- package/src/all/background_page/service/publicWebsite/parsePublicWebsiteUrlService.test.js +48 -0
- package/src/all/background_page/service/recover/buildAccountRecoverService.js +33 -0
- package/src/all/background_page/service/recover/buildAccountRecoverService.test.js +43 -0
- package/src/all/background_page/service/recover/parseRecoverUrlService.js +69 -0
- package/src/all/background_page/service/recover/parseRecoverUrlService.test.js +94 -0
- package/src/all/background_page/service/secret/decryptAndParseResourceSecretService.js +60 -0
- package/src/all/background_page/service/secret/decryptAndParseResourceSecretService.test.js +83 -0
- package/src/all/background_page/service/secret/pownedService.js +63 -0
- package/src/all/background_page/service/secret/pownedService.test.js +77 -0
- package/src/all/background_page/service/sessionStorage/userMeSessionStorageService.js +94 -0
- package/src/all/background_page/service/sessionStorage/userMeSessionStorageService.test.js +146 -0
- package/src/all/background_page/service/sessionStorage/workersSessionStorage.js +205 -0
- package/src/all/background_page/service/sessionStorage/workersSessionStorage.test.js +138 -0
- package/src/all/background_page/service/session_storage/passphraseStorageService.js +176 -0
- package/src/all/background_page/service/session_storage/passphraseStorageService.test.js +252 -0
- package/src/all/background_page/service/session_storage/ssoKitTemporaryStorageService.js +82 -0
- package/src/all/background_page/service/setup/buildAccountSetupService.js +32 -0
- package/src/all/background_page/service/setup/buildAccountSetupService.test.js +43 -0
- package/src/all/background_page/service/setup/parseSetupUrlService.js +62 -0
- package/src/all/background_page/service/setup/parseSetupUrlService.test.js +61 -0
- package/src/all/background_page/service/sso/generateSsoKitService.js +73 -0
- package/src/all/background_page/service/sso/generateSsoKitService.test.js +72 -0
- package/src/all/background_page/service/sso/popupHandlerService.js +164 -0
- package/src/all/background_page/service/sso/popupHandlerService.test.js +230 -0
- package/src/all/background_page/service/sso/qualifySsoLoginErrorService.js +49 -0
- package/src/all/background_page/service/systemRequirementService/systemRequirementService.js +30 -0
- package/src/all/background_page/service/systemRequirementService/systemRequirementService.test.js +37 -0
- package/src/all/background_page/service/tab/tabService.js +99 -0
- package/src/all/background_page/service/tab/tabService.test.js +239 -0
- package/src/all/background_page/service/ui/browserExtensionIcon.service.js +66 -0
- package/src/all/background_page/service/ui/browserTab.service.js +46 -0
- package/src/all/background_page/service/ui/browserTab.service.test.js +81 -0
- package/src/all/background_page/service/ui/quickAccess.service.js +94 -0
- package/src/all/background_page/service/validator/appEmailValidatorService.js +67 -0
- package/src/all/background_page/service/validator/appEmailValidatorService.test.js +61 -0
- package/src/all/background_page/service/webIntegration/parseWebIntegrationUrlService.js +44 -0
- package/src/all/background_page/service/webIntegration/parseWebIntegrationUrlService.test.js +56 -0
- package/src/all/background_page/service/webNavigation/webNavigationService.js +33 -0
- package/src/all/background_page/service/webNavigation/webNavigationService.test.js +58 -0
- package/src/all/background_page/service/worker/workerService.js +146 -0
- package/src/all/background_page/service/worker/workerService.test.js +191 -0
- package/src/all/background_page/utils/array/deduplicateObjects.js +8 -8
- package/src/all/background_page/utils/array/deduplicateObjects.test.js +13 -13
- package/src/all/background_page/utils/array/splitBySize.js +2 -2
- package/src/all/background_page/utils/assertions.js +161 -0
- package/src/all/background_page/utils/assertions.test.data.js +19 -0
- package/src/all/background_page/utils/assertions.test.js +238 -0
- package/src/all/background_page/utils/format/base64.js +10 -9
- package/src/all/background_page/utils/format/binaryConvert.js +47 -0
- package/src/all/background_page/utils/format/emailaddress.js +61 -50
- package/src/all/background_page/utils/format/string.js +202 -158
- package/src/all/background_page/utils/lock.js +33 -28
- package/src/all/background_page/utils/openpgp/openpgpAssertions.js +314 -0
- package/src/all/background_page/utils/openpgp/openpgpAssertions.test.js +576 -0
- package/src/all/background_page/utils/promise/promiseTimeoutService.js +71 -0
- package/src/all/background_page/utils/promise/promiseTimeoutService.test.js +105 -0
- package/src/all/{data/js/quickaccess/popup/components/HomePage → background_page/utils/url}/canSuggestUrl.js +57 -24
- package/src/all/{data/js/quickaccess/popup/components/HomePage → background_page/utils/url}/canSuggestUrl.test.js +14 -3
- package/src/all/background_page/utils/url/hasSameOriginUrl.js +27 -0
- package/src/all/background_page/utils/uuid.js +12 -11
- package/src/all/background_page/utils/validatorRules.js +4 -4
- package/src/all/common/polyfill/browserPolyfill.js +31 -0
- package/src/all/common/polyfill/scriptingPolyfill.js +115 -0
- package/src/all/common/polyfill/scriptingPolyfill.test.js +125 -0
- package/src/all/common/polyfill/sessionStoragePolyfill.js +78 -0
- package/src/all/common/polyfill/sessionStoragePolyfill.test.js +203 -0
- package/src/all/contentScripts/js/app/AccountRecovery.js +40 -0
- package/src/all/{content_scripts → contentScripts}/js/app/App.js +14 -23
- package/src/all/contentScripts/js/app/BrowserIntegration.js +26 -0
- package/src/all/{content_scripts → contentScripts}/js/app/Login.js +14 -22
- package/src/all/contentScripts/js/app/PublicWebsiteSignIn.js +26 -0
- package/src/all/{content_scripts → contentScripts}/js/app/Recover.js +14 -22
- package/src/all/{content_scripts → contentScripts}/js/app/Setup.js +15 -23
- package/src/all/contentScripts/js/controller/connectPortController.js +37 -0
- package/src/all/contentScripts/js/controller/connectPortController.test.js +51 -0
- package/src/all/contentScripts/js/message/messageEventHandler.js +63 -0
- package/src/all/contentScripts/js/message/messageEventHandler.test.data.js +30 -0
- package/src/all/contentScripts/js/message/messageEventHandler.test.js +154 -0
- package/src/all/contentScripts/js/message/messageEventHandlerConstructorMock.test.data.js +18 -0
- package/src/all/contentScripts/js/service/messageService.js +76 -0
- package/src/all/contentScripts/js/service/messageService.test.js +54 -0
- package/src/all/locales/de-DE/common.json +94 -0
- package/src/all/locales/en-UK/common.json +94 -0
- package/src/all/locales/es-ES/common.json +94 -0
- package/src/all/locales/fr-FR/common.json +94 -0
- package/src/all/locales/it-IT/common.json +94 -0
- package/src/all/locales/ja-JP/common.json +94 -0
- package/src/all/locales/ko-KR/common.json +94 -0
- package/src/all/locales/lt-LT/common.json +94 -0
- package/src/all/locales/nl-NL/common.json +94 -0
- package/src/all/locales/pl-PL/common.json +94 -0
- package/src/all/locales/pt-BR/common.json +94 -0
- package/src/all/locales/ro-RO/common.json +94 -0
- package/src/all/locales/ru-RU/common.json +94 -0
- package/src/all/locales/sv-SE/common.json +94 -0
- package/src/all/webAccessibleResources/js/app/AccountRecovery.js +30 -0
- package/src/all/{data → webAccessibleResources}/js/app/App.js +5 -25
- package/src/all/webAccessibleResources/js/app/Download.js +33 -0
- package/src/all/webAccessibleResources/js/app/InFormCallToAction.js +29 -0
- package/src/all/webAccessibleResources/js/app/InFormMenu.js +29 -0
- package/src/all/{data → webAccessibleResources}/js/app/Login.js +5 -24
- package/src/all/webAccessibleResources/js/app/QuickAccess.js +37 -0
- package/src/all/{data → webAccessibleResources}/js/app/Recover.js +4 -21
- package/src/all/{data → webAccessibleResources}/js/app/Setup.js +4 -21
- package/src/all/webAccessibleResources/js/lib/port.js +187 -0
- package/src/all/webAccessibleResources/js/lib/port.test.js +152 -0
- package/src/all/{data → webAccessibleResources}/js/themes/stylesheet.js +49 -34
- package/src/all/webAccessibleResources/passbolt-iframe-account-recovery.html +24 -0
- package/src/all/webAccessibleResources/passbolt-iframe-app.html +67 -0
- package/src/all/webAccessibleResources/passbolt-iframe-file.html +10 -0
- package/src/all/webAccessibleResources/passbolt-iframe-in-form-call-to-action.html +12 -0
- package/src/all/webAccessibleResources/passbolt-iframe-in-form-menu.html +12 -0
- package/src/all/{data → webAccessibleResources}/passbolt-iframe-login.html +2 -2
- package/src/all/{data → webAccessibleResources}/passbolt-iframe-recover.html +2 -2
- package/src/all/{data → webAccessibleResources}/passbolt-iframe-setup.html +2 -2
- package/src/all/webAccessibleResources/quickaccess.html +16 -0
- package/src/chrome/manifest.json +18 -14
- package/src/chrome-mv3/index.js +60 -0
- package/src/chrome-mv3/manifest.json +60 -0
- package/src/chrome-mv3/serviceWorker.js +14 -0
- package/src/firefox/manifest.json +21 -16
- package/src/safari/manifest.json +50 -0
- package/test/fixtures/pgpKeys/keys.js +419 -0
- package/test/jest-webextension-force-runtime-id-setup-files.js +5 -0
- package/{.jest.custom-kdbx-environment.js → test/jest.custom-kdbx-environment.js} +3 -15
- package/test/jest.setup.js +60 -0
- package/test/matchers/extendExpect.js +31 -0
- package/test/matchers/toBeEqualToOpenpgpKey.js +46 -0
- package/test/matchers/toBeOpenpgpKeySignedBy.js +42 -0
- package/test/matchers/toBeOpenpgpPrivateKey.js +34 -0
- package/test/matchers/toBeOpenpgpPublicKey.js +34 -0
- package/test/matchers/toBeOpenpgpRevokedKey.js +34 -0
- package/test/matchers/toThrowEntityValidationErrorOnProperties.js +41 -0
- package/test/mocks/mockAlarms.js +101 -0
- package/test/mocks/mockApiResponse.js +31 -0
- package/test/mocks/mockCryptoKey.js +62 -0
- package/test/mocks/mockEventListener.js +40 -0
- package/test/mocks/mockExtension.js +60 -0
- package/test/mocks/mockNavigatorLocks.js +30 -0
- package/test/mocks/mockSsoDataStorage.js +86 -0
- package/test/mocks/mockStorage.js +74 -0
- package/test/mocks/mockTextEncoder.js +18 -0
- package/test/mocks/mockWebExtensionPolyfill.js +77 -0
- package/webpack-content-scripts.browser-integration.config.js +57 -0
- package/webpack-content-scripts.config.js +16 -5
- package/webpack-content-scripts.public-website-sign-in.config.js +57 -0
- package/webpack-data.config.js +24 -7
- package/webpack-data.download.config.js +59 -0
- package/webpack-data.in-form-call-to-action.config.js +63 -0
- package/webpack-data.in-form-menu.config.js +63 -0
- package/webpack.background-page.config.js +62 -0
- package/webpack.service-worker.config.js +62 -0
- package/.jest.config.json +0 -5
- package/.jest.transform.js +0 -7
- package/dist/chrome/empty +0 -0
- package/dist/chrome/passbolt-3.0.6-debug.crx +0 -0
- package/dist/chrome/passbolt-3.0.6.crx +0 -0
- package/dist/chrome/passbolt-3.0.6.zip +0 -0
- package/dist/firefox/empty +0 -0
- package/dist/firefox/passbolt-3.0.6-debug.zip +0 -0
- package/dist/firefox/passbolt-3.0.6.zip +0 -0
- package/src/all/background_page/app.js +0 -162
- package/src/all/background_page/controller/authController.js +0 -92
- package/src/all/background_page/controller/browserSettingsController.js +0 -47
- package/src/all/background_page/controller/fileController.js +0 -134
- package/src/all/background_page/controller/passphrase/passphraseController.js +0 -82
- package/src/all/background_page/controller/progress/progressController.js +0 -65
- package/src/all/background_page/controller/recover/recoverController.js +0 -167
- package/src/all/background_page/controller/setup/setupController.js +0 -199
- package/src/all/background_page/error/passboltApiFetchError.js +0 -16
- package/src/all/background_page/event/debugEvents.js +0 -169
- package/src/all/background_page/event/pagmodEvents.js +0 -23
- package/src/all/background_page/event/siteSettingsEvents.js +0 -61
- package/src/all/background_page/model/crypto.js +0 -179
- package/src/all/background_page/model/entity/abstract/entity.js +0 -99
- package/src/all/background_page/model/entity/abstract/entity.test.js +0 -86
- package/src/all/background_page/model/entity/abstract/entityCollection.js +0 -144
- package/src/all/background_page/model/entity/abstract/entityCollection.test.js +0 -107
- package/src/all/background_page/model/entity/abstract/entityCollectionError.js +0 -40
- package/src/all/background_page/model/entity/abstract/entityCollectionError.test.js +0 -55
- package/src/all/background_page/model/entity/abstract/entitySchema.js +0 -412
- package/src/all/background_page/model/entity/abstract/entitySchema.test.js +0 -266
- package/src/all/background_page/model/entity/abstract/entityValidationError.js +0 -81
- package/src/all/background_page/model/entity/abstract/entityValidationError.test.js +0 -64
- package/src/all/background_page/model/entity/gpgkey/generate/generateGpgkeyEntity.js +0 -128
- package/src/all/background_page/model/entity/role/roleEntity.js +0 -162
- package/src/all/background_page/model/entity/role/roleEntity.test.js +0 -84
- package/src/all/background_page/model/entity/role/rolesCollection.js +0 -140
- package/src/all/background_page/model/entity/setup/setupEntity.js +0 -360
- package/src/all/background_page/model/entity/setup/setupEntity.test.js +0 -87
- package/src/all/background_page/model/entity/user/account/userAcountEntity.js +0 -131
- package/src/all/background_page/model/group.js +0 -165
- package/src/all/background_page/model/groupForm.js +0 -331
- package/src/all/background_page/model/key.js +0 -337
- package/src/all/background_page/model/openpgp/OpenpgpModel.js +0 -73
- package/src/all/background_page/model/share.js +0 -171
- package/src/all/background_page/model/siteSettings.js +0 -80
- package/src/all/background_page/model/tabStorage.js +0 -82
- package/src/all/background_page/model/worker.js +0 -124
- package/src/all/background_page/pagemod/appBoostrapPagemod.js +0 -100
- package/src/all/background_page/pagemod/clipboardPagemod.js +0 -37
- package/src/all/background_page/pagemod/debugPagemod.js +0 -45
- package/src/all/background_page/sdk/jsonQ.js +0 -66
- package/src/all/background_page/sdk/l10n.js +0 -17
- package/src/all/background_page/sdk/page-mod.js +0 -337
- package/src/all/background_page/sdk/random.js +0 -11
- package/src/all/background_page/sdk/self.js +0 -10
- package/src/all/background_page/sdk/tab.js +0 -77
- package/src/all/background_page/sdk/worker.js +0 -84
- package/src/all/background_page/service/api/apiClient/apiClient.js +0 -351
- package/src/all/background_page/service/api/apiClient/apiClient.test.js +0 -92
- package/src/all/background_page/service/api/apiClient/apiClientOptions.js +0 -111
- package/src/all/background_page/service/api/apiClient/apiClientOptions.test.js +0 -48
- package/src/all/background_page/service/group.js +0 -72
- package/src/all/background_page/service/share.js +0 -216
- package/src/all/background_page/utils/csrfToken/csrfToken.js +0 -61
- package/src/all/background_page/vendors.js +0 -32
- package/src/all/content_scripts/js/bootstrap.js +0 -81
- package/src/all/data/config-debug.html +0 -308
- package/src/all/data/js/clipboard/clipboard.js +0 -29
- package/src/all/data/js/debug/common.js +0 -76
- package/src/all/data/js/debug/debug.js +0 -387
- package/src/all/data/js/debug/file.js +0 -82
- package/src/all/data/js/debug/profiles.js +0 -820
- package/src/all/data/js/file/fileIframe.js +0 -29
- package/src/all/data/js/include/config-debug.js +0 -20
- package/src/all/data/js/lib/loadscript.js +0 -38
- package/src/all/data/js/lib/message.js +0 -120
- package/src/all/data/js/lib/port.js +0 -231
- package/src/all/data/js/lib/pwnedpasswords.js +0 -34
- package/src/all/data/js/lib/request.js +0 -151
- package/src/all/data/js/lib/secretComplexity.js +0 -209
- package/src/all/data/js/quickaccess/popup/Popup.js +0 -215
- package/src/all/data/js/quickaccess/popup/components/AnimatedSwitch/AnimatedSwitch.js +0 -189
- package/src/all/data/js/quickaccess/popup/components/FilterResourcesByFavoritePage/FilterResourcesByFavoritePage.js +0 -210
- package/src/all/data/js/quickaccess/popup/components/FilterResourcesByGroupPage/FilterResourcesByGroupPage.js +0 -329
- package/src/all/data/js/quickaccess/popup/components/FilterResourcesByItemsIOwnPage/FilterResourcesByItemsIOwnPage.js +0 -210
- package/src/all/data/js/quickaccess/popup/components/FilterResourcesByRecentlyModifiedPage/FilterResourcesByRecentlyModifiedPage.js +0 -204
- package/src/all/data/js/quickaccess/popup/components/FilterResourcesBySharedWithMePage/FilterResourcesBySharedWithMePage.js +0 -210
- package/src/all/data/js/quickaccess/popup/components/FilterResourcesByTagPage/FilterResourcesByTagPage.js +0 -329
- package/src/all/data/js/quickaccess/popup/components/Header/Header.js +0 -50
- package/src/all/data/js/quickaccess/popup/components/HomePage/HomePage.js +0 -296
- package/src/all/data/js/quickaccess/popup/components/LoginPage/LoginPage.js +0 -142
- package/src/all/data/js/quickaccess/popup/components/MoreFiltersPage/MoreFiltersPage.js +0 -84
- package/src/all/data/js/quickaccess/popup/components/PassphraseDialog/PassphraseDialog.js +0 -181
- package/src/all/data/js/quickaccess/popup/components/PassphraseDialog/PassphraseDialog.test.js +0 -49
- package/src/all/data/js/quickaccess/popup/components/PrivateRoute/PrivateRoute.js +0 -37
- package/src/all/data/js/quickaccess/popup/components/ResourceCreatePage/ResourceCreatePage.js +0 -274
- package/src/all/data/js/quickaccess/popup/components/ResourceCreatePage/ResourceCreatePage.test.js +0 -186
- package/src/all/data/js/quickaccess/popup/components/ResourceViewPage/ResourceViewPage.js +0 -296
- package/src/all/data/js/quickaccess/popup/components/Search/Search.js +0 -41
- package/src/all/data/js/quickaccess/popup/components/Search/Search.test.js +0 -44
- package/src/all/data/js/quickaccess/popup/components/SimpleBar/SimpleBar.js +0 -35
- package/src/all/data/js/quickaccess/popup/contexts/AppContext.js +0 -6
- package/src/all/data/js/quickaccess/quickaccess.js +0 -335
- package/src/all/data/js/themes/stylesheet_legacy.js +0 -86
- package/src/all/data/passbolt-iframe-app.html +0 -52
- package/src/all/data/passbolt-iframe-clipboard.html +0 -14
- package/src/all/data/passbolt-iframe-file.html +0 -14
- package/src/all/data/quickaccess.html +0 -15
- package/src/all/data/vendors/browser-polyfill.js +0 -1187
- package/src/all/data/vendors/dom-testing-library-event.js +0 -363
- package/src/all/data/vendors/download.js +0 -167
- package/src/all/data/vendors/farbtastic.js +0 -345
- package/src/all/data/vendors/jquery-filestyle.js +0 -387
- package/src/all/data/vendors/jquery.js +0 -10872
- package/src/all/data/vendors/react-dom.production.min.js +0 -239
- package/src/all/data/vendors/react.production.min.js +0 -32
- package/src/all/data/vendors/sha.js +0 -45
- package/src/all/data/vendors/validator.js +0 -817
- package/src/all/data/vendors/xregexp-all.js +0 -4487
|
@@ -0,0 +1,67 @@
|
|
|
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.6.0
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import Keyring from "../../model/keyring";
|
|
16
|
+
import {Uuid} from "../../utils/uuid";
|
|
17
|
+
import AccountEntity from "../../model/entity/account/accountEntity";
|
|
18
|
+
import User from "../../model/user";
|
|
19
|
+
import BuildApiClientOptionsService from "./buildApiClientOptionsService";
|
|
20
|
+
import UserModel from "../../model/user/userModel";
|
|
21
|
+
|
|
22
|
+
class GetLegacyAccountService {
|
|
23
|
+
/**
|
|
24
|
+
* Get the account associated with this extension.
|
|
25
|
+
* @param {Object} option The option to add more data in the account
|
|
26
|
+
* @return {Promise<AccountEntity>}
|
|
27
|
+
* @throw {Error} if no account yet associated with this extension.
|
|
28
|
+
*/
|
|
29
|
+
static async get(option = {}) {
|
|
30
|
+
const keyring = new Keyring();
|
|
31
|
+
const user = await User.getInstance().get();
|
|
32
|
+
const serverPublicKeyInfo = keyring.findPublic(Uuid.get(user.settings.domain));
|
|
33
|
+
const userPublicKeyInfo = keyring.findPublic(user.id);
|
|
34
|
+
const userPrivateKeyInfo = keyring.findPrivate();
|
|
35
|
+
|
|
36
|
+
// Add in the account the role name if the option object have role (only for authenticated user)
|
|
37
|
+
let userEntity;
|
|
38
|
+
if (option?.role) {
|
|
39
|
+
// Load the application settings, necessary to validate the account username.
|
|
40
|
+
const apiClientOptions = await BuildApiClientOptionsService.buildFromDomain(user.settings.domain);
|
|
41
|
+
userEntity = await (new UserModel(apiClientOptions)).findOne(user.id, {role: true});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const accountDto = {
|
|
45
|
+
domain: user.settings.domain,
|
|
46
|
+
user_id: user.id,
|
|
47
|
+
username: user.username,
|
|
48
|
+
first_name: user.firstname,
|
|
49
|
+
last_name: user.lastname,
|
|
50
|
+
server_public_armored_key: serverPublicKeyInfo.armoredKey,
|
|
51
|
+
user_key_fingerprint: userPublicKeyInfo.fingerprint.toUpperCase(),
|
|
52
|
+
user_public_armored_key: userPublicKeyInfo.armoredKey,
|
|
53
|
+
user_private_armored_key: userPrivateKeyInfo.armoredKey,
|
|
54
|
+
security_token: user.settings.securityToken,
|
|
55
|
+
role_name: userEntity?.role?.name || null
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/*
|
|
59
|
+
* Do not validate the username. This validation can happen only when the application settings are loaded as the
|
|
60
|
+
* username validation can be customized. The application settings are not retrieved at this stage to not add a time
|
|
61
|
+
* penalty on all the flows that require the account.
|
|
62
|
+
*/
|
|
63
|
+
return new AccountEntity(accountDto, {validateUsername: false});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export default GetLegacyAccountService;
|
|
@@ -0,0 +1,88 @@
|
|
|
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 OrganizationSettingsModel from "../../model/organizationSettings/organizationSettingsModel";
|
|
15
|
+
import SsoSettingsModel from "../../model/sso/ssoSettingsModel";
|
|
16
|
+
import SsoDataStorage from "../indexedDB_storage/ssoDataStorage";
|
|
17
|
+
import GenerateSsoKitService from "../sso/generateSsoKitService";
|
|
18
|
+
import SsoKitServerPartModel from "../../model/sso/ssoKitServerPartModel";
|
|
19
|
+
import EntityValidationError from "passbolt-styleguide/src/shared/models/entity/abstract/entityValidationError";
|
|
20
|
+
|
|
21
|
+
class UpdateSsoCredentialsService {
|
|
22
|
+
constructor(apiClientOption) {
|
|
23
|
+
this.organisationSettingsModel = new OrganizationSettingsModel(apiClientOption);
|
|
24
|
+
this.ssoSettingsModel = new SsoSettingsModel(apiClientOption);
|
|
25
|
+
this.ssoKitServerPartModel = new SsoKitServerPartModel(apiClientOption);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Clean the SSO kit then regenerate a new one
|
|
30
|
+
* @param {string} passphrase
|
|
31
|
+
* @returns {Promise<ApiClientOptions>}
|
|
32
|
+
*/
|
|
33
|
+
async forceUpdateSsoKit(passphrase) {
|
|
34
|
+
await SsoDataStorage.flush();
|
|
35
|
+
await this.updateSsoKitIfNeeded(passphrase);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Updates the current's user SSO kit:
|
|
40
|
+
* - Flush it if one exists and SSO plutin is disabled or the feature is not configured
|
|
41
|
+
* - Creates a new one if none exists and SSO plugin is enabled
|
|
42
|
+
* @param {string} passphrase
|
|
43
|
+
* @returns {Promise<void>}
|
|
44
|
+
*/
|
|
45
|
+
async updateSsoKitIfNeeded(passphrase) {
|
|
46
|
+
const localSsoKit = await SsoDataStorage.get();
|
|
47
|
+
const organizationSettings = await this.organisationSettingsModel.getOrFind();
|
|
48
|
+
if (!organizationSettings.isPluginEnabled("sso")) {
|
|
49
|
+
/*
|
|
50
|
+
* If the plugin is disabled there is no reason to keep an SSO kit
|
|
51
|
+
* Plus, if we have an SSO kit locally, the login page will continue display the SSO login
|
|
52
|
+
*/
|
|
53
|
+
if (localSsoKit) {
|
|
54
|
+
await SsoDataStorage.flush();
|
|
55
|
+
}
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
let currentSsoSettings;
|
|
60
|
+
try {
|
|
61
|
+
currentSsoSettings = await this.ssoSettingsModel.getCurrent();
|
|
62
|
+
} catch (e) {
|
|
63
|
+
if (e instanceof EntityValidationError) {
|
|
64
|
+
/*
|
|
65
|
+
* It might happen that the browser extension is on an older version than the server.
|
|
66
|
+
* If so, the server could be configured with an SSO provider that the browser extension doesn't support.
|
|
67
|
+
* In such a case, the SsoSettingsEntity will crash at the validation and could block the recover, setup or login steps.
|
|
68
|
+
*/
|
|
69
|
+
console.error(e);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
// In other cases, it's an unexpected error that should be thrown like usual
|
|
73
|
+
throw e;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (!currentSsoSettings?.provider && localSsoKit) {
|
|
77
|
+
/*
|
|
78
|
+
* if we have a local SSO kit but the plugin is not configured
|
|
79
|
+
* it means it has been disabled and there is no point to keep it
|
|
80
|
+
*/
|
|
81
|
+
await SsoDataStorage.flush();
|
|
82
|
+
} else if (currentSsoSettings?.provider && !localSsoKit) {
|
|
83
|
+
await GenerateSsoKitService.generate(passphrase, currentSsoSettings.provider);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export default UpdateSsoCredentialsService;
|
|
@@ -0,0 +1,115 @@
|
|
|
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.6.0
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import {OpenpgpAssertion} from "../../utils/openpgp/openpgpAssertions";
|
|
16
|
+
import EncryptMessageService from "../crypto/encryptMessageService";
|
|
17
|
+
import AccountRecoveryOrganizationPolicyEntity from "../../model/entity/accountRecovery/accountRecoveryOrganizationPolicyEntity";
|
|
18
|
+
import secrets from 'secrets-passbolt';
|
|
19
|
+
import AccountRecoveryPrivateKeyPasswordEntity from "../../model/entity/accountRecovery/accountRecoveryPrivateKeyPasswordEntity";
|
|
20
|
+
import AccountRecoveryPrivateKeyPasswordDecryptedDataEntity from "../../model/entity/accountRecovery/accountRecoveryPrivateKeyPasswordDecryptedDataEntity";
|
|
21
|
+
import AccountRecoveryUserSettingEntity from "../../model/entity/accountRecovery/accountRecoveryUserSettingEntity";
|
|
22
|
+
|
|
23
|
+
// The strength of the secret to use to encrypt the private key.
|
|
24
|
+
const SYMMETRIC_SECRET_BITS = 512;
|
|
25
|
+
|
|
26
|
+
class BuildApprovedAccountRecoveryUserSettingEntityService {
|
|
27
|
+
/**
|
|
28
|
+
* Build accepted account recovery user setting entity.
|
|
29
|
+
*
|
|
30
|
+
* @param {AbstractAccountEntity} account The account creating the account recovery user setting.
|
|
31
|
+
* @param {openpgp.PrivateKey} decryptedPrivateKey The user decrypted private key.
|
|
32
|
+
* @param {AccountRecoveryOrganizationPolicyEntity} organizationPolicy The organization policy.
|
|
33
|
+
* @returns {Promise<AccountRecoveryUserSettingEntity>}
|
|
34
|
+
*/
|
|
35
|
+
static async build(account, decryptedPrivateKey, organizationPolicy) {
|
|
36
|
+
OpenpgpAssertion.assertDecryptedPrivateKey(decryptedPrivateKey);
|
|
37
|
+
|
|
38
|
+
if (!organizationPolicy || !(organizationPolicy instanceof AccountRecoveryOrganizationPolicyEntity)) {
|
|
39
|
+
throw new Error("The provided organizationPolicy must be a valid AccountRecoveryOrganizationPolicyEntity.");
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const symmetricSecret = secrets.random(SYMMETRIC_SECRET_BITS);
|
|
43
|
+
const accountRecoveryPrivateKeyDto = await this._encryptPrivateKey(symmetricSecret, decryptedPrivateKey);
|
|
44
|
+
const accountRecoveryPrivateKeyPasswordForOrganizationDto = await this._encryptPrivateKeyPasswordsForOrganizationKey(account, symmetricSecret, organizationPolicy, decryptedPrivateKey);
|
|
45
|
+
|
|
46
|
+
accountRecoveryPrivateKeyDto.account_recovery_private_key_passwords = [accountRecoveryPrivateKeyPasswordForOrganizationDto];
|
|
47
|
+
|
|
48
|
+
const userSettingDto = {
|
|
49
|
+
user_id: account.userId,
|
|
50
|
+
status: AccountRecoveryUserSettingEntity.STATUS_APPROVED,
|
|
51
|
+
account_recovery_private_key: accountRecoveryPrivateKeyDto
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
return new AccountRecoveryUserSettingEntity(userSettingDto);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Encrypt the user private key symmetrically.
|
|
59
|
+
*
|
|
60
|
+
* @param {string} symmetricSecret The symmetric secret to use to encrypt the private key.
|
|
61
|
+
* @param {openpgp.PrivateKey} decryptedPrivateKey The user decrypted private key.
|
|
62
|
+
* @returns {Promise<Object>}
|
|
63
|
+
*/
|
|
64
|
+
static async _encryptPrivateKey(symmetricSecret, decryptedPrivateKey) {
|
|
65
|
+
const userPrivateKeySymmetricEncrypted = await EncryptMessageService.encryptSymmetrically(decryptedPrivateKey.armor(), [symmetricSecret], [decryptedPrivateKey]);
|
|
66
|
+
return {data: userPrivateKeySymmetricEncrypted};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Encrypt the user private key passwords for the account recovery contacts defined in the organization policy.
|
|
71
|
+
*
|
|
72
|
+
* @param {AbstractAccountEntity} account The account creating the account recovery user setting.
|
|
73
|
+
* @param {string} symmetricSecret The symmetric secret to use to encrypt the private key.
|
|
74
|
+
* @param {AccountRecoveryOrganizationPolicyEntity} organizationPolicy The organization policy.
|
|
75
|
+
* @param {openpgp.PrivateKey} decryptedPrivateKey The user decrypted private key.
|
|
76
|
+
* @returns {Promise<Object>}
|
|
77
|
+
* @private
|
|
78
|
+
*/
|
|
79
|
+
static async _encryptPrivateKeyPasswordsForOrganizationKey(account, symmetricSecret, organizationPolicy, decryptedPrivateKey) {
|
|
80
|
+
const organizationPublicKey = await OpenpgpAssertion.readKeyOrFail(organizationPolicy.armoredKey);
|
|
81
|
+
const privateKeyPasswordDecryptedData = this._buildPrivateKeyPasswordDecryptedData(account, symmetricSecret);
|
|
82
|
+
const serializedPrivateKeyPasswordDecryptedData = JSON.stringify(privateKeyPasswordDecryptedData.toDto());
|
|
83
|
+
const privateKeyPasswordEncryptedData = await EncryptMessageService.encrypt(serializedPrivateKeyPasswordDecryptedData, organizationPublicKey, [decryptedPrivateKey]);
|
|
84
|
+
|
|
85
|
+
return {
|
|
86
|
+
data: privateKeyPasswordEncryptedData,
|
|
87
|
+
recipient_foreign_model: AccountRecoveryPrivateKeyPasswordEntity.FOREIGN_MODEL_ORGANIZATION_KEY,
|
|
88
|
+
recipient_fingerprint: organizationPublicKey.getFingerprint().toUpperCase(),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Encrypt the user private key passwords for the account recovery contacts defined in the organization policy.
|
|
94
|
+
*
|
|
95
|
+
* @param {AbstractAccountEntity} account The account creating the account recovery user setting.
|
|
96
|
+
* @param {string} symmetricSecret The symmetric secret used to encrypt the private key with.
|
|
97
|
+
* @returns {AccountRecoveryPrivateKeyPasswordDecryptedDataEntity}
|
|
98
|
+
* @private
|
|
99
|
+
*/
|
|
100
|
+
static _buildPrivateKeyPasswordDecryptedData(account, symmetricSecret) {
|
|
101
|
+
const privateLeyPasswordDecryptedDataDto = {
|
|
102
|
+
domain: account.domain,
|
|
103
|
+
type: "account-recovery-private-key-password-decrypted-data",
|
|
104
|
+
version: "v1",
|
|
105
|
+
private_key_user_id: account.userId,
|
|
106
|
+
private_key_fingerprint: account.userKeyFingerprint,
|
|
107
|
+
private_key_secret: symmetricSecret,
|
|
108
|
+
created: (new Date()).toISOString()
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
return new AccountRecoveryPrivateKeyPasswordDecryptedDataEntity(privateLeyPasswordDecryptedDataDto);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export default BuildApprovedAccountRecoveryUserSettingEntityService;
|
|
@@ -0,0 +1,83 @@
|
|
|
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.6.0
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import {pgpKeys} from "../../../../../test/fixtures/pgpKeys/keys";
|
|
16
|
+
import BuildApprovedAccountRecoveryUserSettingEntityService from "./buildApprovedAccountRecoveryUserSettingEntityService";
|
|
17
|
+
import {enabledAccountRecoveryOrganizationPolicyDto} from "../../model/entity/accountRecovery/accountRecoveryOrganizationPolicyEntity.test.data";
|
|
18
|
+
import AccountRecoveryOrganizationPolicyEntity from "../../model/entity/accountRecovery/accountRecoveryOrganizationPolicyEntity";
|
|
19
|
+
import DecryptMessageService from "../crypto/decryptMessageService";
|
|
20
|
+
import {defaultAccountDto} from "../../model/entity/account/accountEntity.test.data";
|
|
21
|
+
import AccountEntity from "../../model/entity/account/accountEntity";
|
|
22
|
+
import AccountRecoveryPrivateKeyPasswordDecryptedDataEntity from "../../model/entity/accountRecovery/accountRecoveryPrivateKeyPasswordDecryptedDataEntity";
|
|
23
|
+
import {OpenpgpAssertion} from "../../utils/openpgp/openpgpAssertions";
|
|
24
|
+
|
|
25
|
+
describe("BuildApprovedAccountRecoveryUserSettingEntityService service", () => {
|
|
26
|
+
it("Build approved account recovery user setting entity", async() => {
|
|
27
|
+
const account = new AccountEntity(defaultAccountDto());
|
|
28
|
+
const organizationPolicyDto = enabledAccountRecoveryOrganizationPolicyDto();
|
|
29
|
+
const organizationPolicy = new AccountRecoveryOrganizationPolicyEntity(organizationPolicyDto);
|
|
30
|
+
const decryptedPrivateKey = await OpenpgpAssertion.readKeyOrFail(pgpKeys.ada.private_decrypted);
|
|
31
|
+
const accountRecoveryUserSetting = await BuildApprovedAccountRecoveryUserSettingEntityService.build(account, decryptedPrivateKey, organizationPolicy);
|
|
32
|
+
|
|
33
|
+
expect.assertions(11);
|
|
34
|
+
expect(accountRecoveryUserSetting.isApproved).toBe(true);
|
|
35
|
+
expect(accountRecoveryUserSetting.accountRecoveryPrivateKey).not.toBeNull();
|
|
36
|
+
expect(accountRecoveryUserSetting.accountRecoveryPrivateKey.accountRecoveryPrivateKeyPasswords).not.toBeNull();
|
|
37
|
+
|
|
38
|
+
// Ensure the recipient fingerprint is properly set.
|
|
39
|
+
const privateKeyPasswordRecipientFingerprint = accountRecoveryUserSetting.accountRecoveryPrivateKey.accountRecoveryPrivateKeyPasswords.items[0].recipientFingerprint;
|
|
40
|
+
const organizationPolicyFingerprint = organizationPolicyDto.account_recovery_organization_public_key.fingerprint.toUpperCase();
|
|
41
|
+
expect(privateKeyPasswordRecipientFingerprint).toBe(organizationPolicyFingerprint);
|
|
42
|
+
|
|
43
|
+
// Ensure the private key password decrypted data match the expected meta.
|
|
44
|
+
const userPrivateKeyPasswordEncrypted = await OpenpgpAssertion.readMessageOrFail(accountRecoveryUserSetting.accountRecoveryPrivateKey.accountRecoveryPrivateKeyPasswords.items[0].data);
|
|
45
|
+
const userPrivateKeyPasswordEncryptedData = await OpenpgpAssertion.readMessageOrFail(accountRecoveryUserSetting.accountRecoveryPrivateKey.data);
|
|
46
|
+
const accountRecoveryPrivateKeyDecrypted = await OpenpgpAssertion.readKeyOrFail(pgpKeys.account_recovery_organization.private_decrypted);
|
|
47
|
+
const userPrivateKeyPasswordDecryptedSerializedDataDto = await DecryptMessageService.decrypt(userPrivateKeyPasswordEncrypted, accountRecoveryPrivateKeyDecrypted, [decryptedPrivateKey]);
|
|
48
|
+
const userPrivateKeyPasswordDecryptedData = new AccountRecoveryPrivateKeyPasswordDecryptedDataEntity(JSON.parse(userPrivateKeyPasswordDecryptedSerializedDataDto));
|
|
49
|
+
expect(userPrivateKeyPasswordDecryptedData.type).toStrictEqual("account-recovery-private-key-password-decrypted-data");
|
|
50
|
+
expect(userPrivateKeyPasswordDecryptedData.version).toStrictEqual("v1");
|
|
51
|
+
expect(userPrivateKeyPasswordDecryptedData.privateKeyUserId).toStrictEqual(account.userId);
|
|
52
|
+
expect(userPrivateKeyPasswordDecryptedData.privateKeyFingerprint).toStrictEqual(account.userKeyFingerprint);
|
|
53
|
+
expect(userPrivateKeyPasswordDecryptedData.privateKeySecret).toHaveLength(128);
|
|
54
|
+
expect(Date.parse(userPrivateKeyPasswordDecryptedData.created)).toBeTruthy();
|
|
55
|
+
|
|
56
|
+
// Assert the secret can be used to decrypt the escrow.
|
|
57
|
+
const userPrivateArmoredOpenpgpKeyDecrypted = await DecryptMessageService.decryptSymmetrically(
|
|
58
|
+
userPrivateKeyPasswordEncryptedData,
|
|
59
|
+
userPrivateKeyPasswordDecryptedData.privateKeySecret,
|
|
60
|
+
[decryptedPrivateKey]
|
|
61
|
+
);
|
|
62
|
+
expect(userPrivateArmoredOpenpgpKeyDecrypted.trim()).toEqual(pgpKeys.ada.private_decrypted);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it("Should throw an error if the provided user private key is not a valid decrypted private pgp key.", async() => {
|
|
66
|
+
const account = new AccountEntity(defaultAccountDto());
|
|
67
|
+
const privateKey = await OpenpgpAssertion.readKeyOrFail(pgpKeys.ada.private);
|
|
68
|
+
const resultPromise = BuildApprovedAccountRecoveryUserSettingEntityService.build(account, privateKey, {});
|
|
69
|
+
|
|
70
|
+
expect.assertions(1);
|
|
71
|
+
await expect(resultPromise).rejects.toThrow("The private key should be decrypted.");
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it("Should throw an error if the provided organization policy is not a valid AccountRecoveryOrganizationPolicyEntity.", async() => {
|
|
75
|
+
const account = new AccountEntity(defaultAccountDto());
|
|
76
|
+
const organizationPolicy = {};
|
|
77
|
+
const privateKey = await OpenpgpAssertion.readKeyOrFail(pgpKeys.ada.private_decrypted);
|
|
78
|
+
const resultPromise = BuildApprovedAccountRecoveryUserSettingEntityService.build(account, privateKey, organizationPolicy);
|
|
79
|
+
|
|
80
|
+
expect.assertions(1);
|
|
81
|
+
await expect(resultPromise).rejects.toThrow("The provided organizationPolicy must be a valid AccountRecoveryOrganizationPolicyEntity.");
|
|
82
|
+
});
|
|
83
|
+
});
|
package/src/all/background_page/service/accountRecovery/decryptPrivateKeyPasswordDataService.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
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.6.0
|
|
13
|
+
*/
|
|
14
|
+
import DecryptMessageService from "../../service/crypto/decryptMessageService";
|
|
15
|
+
import AccountRecoveryPrivateKeyPasswordDecryptedDataEntity from "../../model/entity/accountRecovery/accountRecoveryPrivateKeyPasswordDecryptedDataEntity";
|
|
16
|
+
import {OpenpgpAssertion} from "../../utils/openpgp/openpgpAssertions";
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class DecryptPrivateKeyPasswordDataService {
|
|
20
|
+
/**
|
|
21
|
+
* Decrypt the private key password encrypted data.
|
|
22
|
+
* @param {AccountRecoveryPrivateKeyPasswordEntity} privateKeyPassword The private key password.
|
|
23
|
+
* @param {openpgp.PrivateKey} decryptionKey The decrypted decryption key.
|
|
24
|
+
* @param {string} verificationDomain The expected domain the private key password should contain.
|
|
25
|
+
* @param {string} [verificationUserId] The id of the user who is the owner of the private key encrypted with the private key password.
|
|
26
|
+
* @param {openpgp.PublicKey} [verificationUserPublicKey] The public key of the user who is the owner of the private key encrypted with the private key password
|
|
27
|
+
* @return {Promise<AccountRecoveryPrivateKeyPasswordDecryptedDataEntity>}
|
|
28
|
+
* @throw {Error} If the decryption key fingerprint does not match the private key password recipient fingerprint.
|
|
29
|
+
* @throw {Error} If the private key password data cannot be decrypted.
|
|
30
|
+
* @throw {Error} If the decrypted private key password data cannot be parsed.
|
|
31
|
+
* @throw {EntityValidationError} If the decrypted private key password data cannot be used to create a private key password decrypted data entity.
|
|
32
|
+
* @throw {Error} If the user id contained in the decrypted private key password data does not match the verification user id.
|
|
33
|
+
* @throw {Error} If the fingerprint contained in the decrypted private key password data does not match the verification fingerprint.
|
|
34
|
+
*/
|
|
35
|
+
static async decrypt(privateKeyPassword, decryptionKey, verificationDomain, verificationUserId, verificationUserPublicKey) {
|
|
36
|
+
let privateKeyPasswordDecryptedDataDto;
|
|
37
|
+
|
|
38
|
+
if (decryptionKey.getFingerprint().toUpperCase() !== privateKeyPassword.recipientFingerprint) {
|
|
39
|
+
throw new Error("The decryption key fingerprint does not match the private key password recipient fingerprint.");
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// @todo verify the signature on the password: can be the user itself while performing the setup or the admin while rotating the ork.
|
|
43
|
+
const privateKeyPasswordMessage = await OpenpgpAssertion.readMessageOrFail(privateKeyPassword.data);
|
|
44
|
+
const privateKeyPasswordDecryptedDataSerialized = await DecryptMessageService.decrypt(privateKeyPasswordMessage, decryptionKey);
|
|
45
|
+
|
|
46
|
+
try {
|
|
47
|
+
privateKeyPasswordDecryptedDataDto = JSON.parse(privateKeyPasswordDecryptedDataSerialized);
|
|
48
|
+
} catch (error) {
|
|
49
|
+
throw new Error("Unable to parse the decrypted private key password data.");
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const privateKeyPasswordDecryptedData = new AccountRecoveryPrivateKeyPasswordDecryptedDataEntity(privateKeyPasswordDecryptedDataDto);
|
|
53
|
+
|
|
54
|
+
if (privateKeyPasswordDecryptedData.domain !== verificationDomain) {
|
|
55
|
+
throw new Error("The domain contained in the private key password data does not match the expected target domain.");
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (verificationUserId) {
|
|
59
|
+
if (privateKeyPasswordDecryptedData.privateKeyUserId !== verificationUserId) {
|
|
60
|
+
throw new Error("The user id contained in the private key password data does not match the private key target used id.");
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (verificationUserPublicKey) {
|
|
65
|
+
if (privateKeyPasswordDecryptedData.privateKeyFingerprint !== verificationUserPublicKey.getFingerprint().toUpperCase()) {
|
|
66
|
+
throw new Error("The private key password data fingerprint should match the user public fingerprint.");
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return privateKeyPasswordDecryptedData;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export default DecryptPrivateKeyPasswordDataService;
|
package/src/all/background_page/service/accountRecovery/decryptPrivateKeyPasswordDataService.test.js
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
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.6.0
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import {v4 as uuidv4} from "uuid";
|
|
16
|
+
import DecryptPrivateKeyPasswordDataService from "./decryptPrivateKeyPasswordDataService";
|
|
17
|
+
import {defaultAccountRecoveryPrivateKeyPasswordDto} from "../../model/entity/accountRecovery/accountRecoveryPrivateKeyPasswordEntity.test.data";
|
|
18
|
+
import AccountRecoveryPrivateKeyPasswordEntity from "../../model/entity/accountRecovery/accountRecoveryPrivateKeyPasswordEntity";
|
|
19
|
+
import {pgpKeys} from "../../../../../test/fixtures/pgpKeys/keys";
|
|
20
|
+
import EncryptMessageService from "../crypto/encryptMessageService";
|
|
21
|
+
import {defaultAccountRecoveryPrivateKeyPasswordDecryptedDataDto} from "../../model/entity/accountRecovery/accountRecoveryPrivateKeyPasswordDecryptedDataEntity.test.data";
|
|
22
|
+
import AccountRecoveryPrivateKeyPasswordDecryptedDataEntity from "../../model/entity/accountRecovery/accountRecoveryPrivateKeyPasswordDecryptedDataEntity";
|
|
23
|
+
import {OpenpgpAssertion} from "../../utils/openpgp/openpgpAssertions";
|
|
24
|
+
|
|
25
|
+
describe("DecryptPrivateKeyPasswordDataService", () => {
|
|
26
|
+
describe("DecryptPrivateKeyPasswordDataService:decrypt", () => {
|
|
27
|
+
const expectedDomain = "https://passbolt.local";
|
|
28
|
+
const privateKeyPassword = new AccountRecoveryPrivateKeyPasswordEntity(defaultAccountRecoveryPrivateKeyPasswordDto());
|
|
29
|
+
const decryptionArmoredKey = pgpKeys.account_recovery_organization.private_decrypted;
|
|
30
|
+
const verificationUserId = pgpKeys.ada.userId;
|
|
31
|
+
const verificationPublicArmoredKey = pgpKeys.ada.public;
|
|
32
|
+
|
|
33
|
+
it("should decrypt a private key password data.", async() => {
|
|
34
|
+
const decryptionKey = await OpenpgpAssertion.readKeyOrFail(decryptionArmoredKey);
|
|
35
|
+
const verificationPublicKey = await OpenpgpAssertion.readKeyOrFail(verificationPublicArmoredKey);
|
|
36
|
+
const privateKeyPasswordDecryptedData = await DecryptPrivateKeyPasswordDataService.decrypt(privateKeyPassword, decryptionKey, expectedDomain, verificationUserId, verificationPublicKey);
|
|
37
|
+
expect.assertions(8);
|
|
38
|
+
expect(privateKeyPasswordDecryptedData).toBeInstanceOf(AccountRecoveryPrivateKeyPasswordDecryptedDataEntity);
|
|
39
|
+
expect(privateKeyPasswordDecryptedData.type).toStrictEqual("account-recovery-private-key-password-decrypted-data");
|
|
40
|
+
expect(privateKeyPasswordDecryptedData.version).toStrictEqual("v1");
|
|
41
|
+
expect(privateKeyPasswordDecryptedData.domain).toStrictEqual(expectedDomain);
|
|
42
|
+
expect(privateKeyPasswordDecryptedData.privateKeyUserId).toStrictEqual(pgpKeys.ada.userId);
|
|
43
|
+
expect(privateKeyPasswordDecryptedData.privateKeyFingerprint).toStrictEqual(pgpKeys.ada.fingerprint);
|
|
44
|
+
expect(privateKeyPasswordDecryptedData.privateKeySecret).toStrictEqual("f7cf1fa06f973a9ecbb5f0e2bc6d1830532e53ad50da231036bd6c8c00dd7c7dc6c07b04004615cd6808bea2cb6a4ce4c46f7f36b8865292c0f7a28cd6f56112");
|
|
45
|
+
expect(Date.parse(privateKeyPasswordDecryptedData.created)).toBeTruthy();
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it("should fail if the given decryption key does not match private key password recipient fingerprint", async() => {
|
|
49
|
+
const decryptionKey = await OpenpgpAssertion.readKeyOrFail(pgpKeys.ada.private_decrypted);
|
|
50
|
+
const verificationPublicKey = await OpenpgpAssertion.readKeyOrFail(verificationPublicArmoredKey);
|
|
51
|
+
const promise = DecryptPrivateKeyPasswordDataService.decrypt(privateKeyPassword, decryptionKey, expectedDomain, verificationUserId, verificationPublicKey);
|
|
52
|
+
expect.assertions(1);
|
|
53
|
+
await expect(promise).rejects.toThrowError("The decryption key fingerprint does not match the private key password recipient fingerprint.");
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it("should fail if the private key password cannot be decrypted.", async() => {
|
|
57
|
+
const decryptionKey = await OpenpgpAssertion.readKeyOrFail(decryptionArmoredKey);
|
|
58
|
+
const verificationPublicKey = await OpenpgpAssertion.readKeyOrFail(verificationPublicArmoredKey);
|
|
59
|
+
const data = "decrypt-me-decrypt-me-decrypt-me";
|
|
60
|
+
const privateKeyPassword = new AccountRecoveryPrivateKeyPasswordEntity(defaultAccountRecoveryPrivateKeyPasswordDto({data}));
|
|
61
|
+
const promise = DecryptPrivateKeyPasswordDataService.decrypt(privateKeyPassword, decryptionKey, expectedDomain, verificationUserId, verificationPublicKey);
|
|
62
|
+
expect.assertions(1);
|
|
63
|
+
await expect(promise).rejects.toThrowError("The message should be a valid openpgp message.");
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it("should fail if the decrypted private key password data cannot be parsed.", async() => {
|
|
67
|
+
const key = await OpenpgpAssertion.readKeyOrFail(pgpKeys.account_recovery_organization.public);
|
|
68
|
+
const decryptionKey = await OpenpgpAssertion.readKeyOrFail(decryptionArmoredKey);
|
|
69
|
+
const verificationPublicKey = await OpenpgpAssertion.readKeyOrFail(verificationPublicArmoredKey);
|
|
70
|
+
const data = await EncryptMessageService.encrypt("decrypt-me-decrypt-me-decrypt-me", key);
|
|
71
|
+
const privateKeyPassword = new AccountRecoveryPrivateKeyPasswordEntity(defaultAccountRecoveryPrivateKeyPasswordDto({data}));
|
|
72
|
+
const promise = DecryptPrivateKeyPasswordDataService.decrypt(privateKeyPassword, decryptionKey, expectedDomain, verificationUserId, verificationPublicKey);
|
|
73
|
+
expect.assertions(1);
|
|
74
|
+
await expect(promise).rejects.toThrowError("Unable to parse the decrypted private key password data.");
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it("should fail if the decrypted private key password data entity cannot be created with the decrypted data.", async() => {
|
|
78
|
+
const decryptionKey = await OpenpgpAssertion.readKeyOrFail(decryptionArmoredKey);
|
|
79
|
+
const verificationPublicKey = await OpenpgpAssertion.readKeyOrFail(verificationPublicArmoredKey);
|
|
80
|
+
const privateKeyPasswordDataDto = defaultAccountRecoveryPrivateKeyPasswordDecryptedDataDto({type: "not-a-valid-decrypted-data-entity-type"});
|
|
81
|
+
const key = await OpenpgpAssertion.readKeyOrFail(pgpKeys.account_recovery_organization.public);
|
|
82
|
+
const data = await EncryptMessageService.encrypt(JSON.stringify(privateKeyPasswordDataDto), key);
|
|
83
|
+
const privateKeyPassword = new AccountRecoveryPrivateKeyPasswordEntity(defaultAccountRecoveryPrivateKeyPasswordDto({data}));
|
|
84
|
+
const promise = DecryptPrivateKeyPasswordDataService.decrypt(privateKeyPassword, decryptionKey, expectedDomain, verificationUserId, verificationPublicKey);
|
|
85
|
+
expect.assertions(1);
|
|
86
|
+
await expect(promise).rejects.toThrowEntityValidationErrorOnProperties(["type"]);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it("should fail if the user id contained in the private key password data does not match the verification user id.", async() => {
|
|
90
|
+
const decryptionKey = await OpenpgpAssertion.readKeyOrFail(decryptionArmoredKey);
|
|
91
|
+
const verificationPublicKey = await OpenpgpAssertion.readKeyOrFail(verificationPublicArmoredKey);
|
|
92
|
+
const privateKeyPasswordDataDto = defaultAccountRecoveryPrivateKeyPasswordDecryptedDataDto({private_key_user_id: uuidv4()});
|
|
93
|
+
const key = await OpenpgpAssertion.readKeyOrFail(pgpKeys.account_recovery_organization.public);
|
|
94
|
+
const data = await EncryptMessageService.encrypt(JSON.stringify(privateKeyPasswordDataDto), key);
|
|
95
|
+
const privateKeyPassword = new AccountRecoveryPrivateKeyPasswordEntity(defaultAccountRecoveryPrivateKeyPasswordDto({data}));
|
|
96
|
+
const promise = DecryptPrivateKeyPasswordDataService.decrypt(privateKeyPassword, decryptionKey, expectedDomain, verificationUserId, verificationPublicKey);
|
|
97
|
+
expect.assertions(1);
|
|
98
|
+
await expect(promise).rejects.toThrowError("The user id contained in the private key password data does not match the private key target used id.");
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
it("should fail if the domain contained in the private key password data does not match the verification domain.", async() => {
|
|
102
|
+
const decryptionKey = await OpenpgpAssertion.readKeyOrFail(decryptionArmoredKey);
|
|
103
|
+
const verificationPublicKey = await OpenpgpAssertion.readKeyOrFail(verificationPublicArmoredKey);
|
|
104
|
+
const privateKeyPasswordDataDto = defaultAccountRecoveryPrivateKeyPasswordDecryptedDataDto({private_key_user_id: uuidv4()});
|
|
105
|
+
const key = await OpenpgpAssertion.readKeyOrFail(pgpKeys.account_recovery_organization.public);
|
|
106
|
+
const data = await EncryptMessageService.encrypt(JSON.stringify(privateKeyPasswordDataDto), key);
|
|
107
|
+
const privateKeyPassword = new AccountRecoveryPrivateKeyPasswordEntity(defaultAccountRecoveryPrivateKeyPasswordDto({data}));
|
|
108
|
+
const promise = DecryptPrivateKeyPasswordDataService.decrypt(privateKeyPassword, decryptionKey, "fake domain", verificationUserId, verificationPublicKey);
|
|
109
|
+
expect.assertions(1);
|
|
110
|
+
await expect(promise).rejects.toThrowError("The domain contained in the private key password data does not match the expected target domain.");
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it("should fail if the fingerprint contained in the private key password data does not match the verification fingerprint.", async() => {
|
|
114
|
+
const decryptionKey = await OpenpgpAssertion.readKeyOrFail(decryptionArmoredKey);
|
|
115
|
+
const verificationPublicKey = await OpenpgpAssertion.readKeyOrFail(verificationPublicArmoredKey);
|
|
116
|
+
const privateKeyPasswordDataDto = defaultAccountRecoveryPrivateKeyPasswordDecryptedDataDto({private_key_fingerprint: pgpKeys.betty.fingerprint});
|
|
117
|
+
const key = await OpenpgpAssertion.readKeyOrFail(pgpKeys.account_recovery_organization.public);
|
|
118
|
+
const data = await EncryptMessageService.encrypt(JSON.stringify(privateKeyPasswordDataDto), key);
|
|
119
|
+
const privateKeyPassword = new AccountRecoveryPrivateKeyPasswordEntity(defaultAccountRecoveryPrivateKeyPasswordDto({data}));
|
|
120
|
+
const promise = DecryptPrivateKeyPasswordDataService.decrypt(privateKeyPassword, decryptionKey, expectedDomain, verificationUserId, verificationPublicKey);
|
|
121
|
+
expect.assertions(1);
|
|
122
|
+
await expect(promise).rejects.toThrowError("The private key password data fingerprint should match the user public fingerprint.");
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
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.6.0
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import {OpenpgpAssertion} from "../../utils/openpgp/openpgpAssertions";
|
|
16
|
+
import DecryptMessageService from "../../service/crypto/decryptMessageService";
|
|
17
|
+
import AccountRecoveryPrivateKeyPasswordDecryptedDataEntity from "../../model/entity/accountRecovery/accountRecoveryPrivateKeyPasswordDecryptedDataEntity";
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class DecryptResponseDataService {
|
|
21
|
+
/**
|
|
22
|
+
* Decrypt the response encrypted data.
|
|
23
|
+
* @param {AccountRecoveryResponseEntity} response The response.
|
|
24
|
+
* @param {openpgp.PrivateKey} decryptionKey The decrypted decryption key.
|
|
25
|
+
* @param {string} verificationUserId The id of the user who is the owner of the private key encrypted with the private key password.
|
|
26
|
+
* @param {string}verificationDomain The expected domain to find in the decrypted private key password.
|
|
27
|
+
* @param {openpgp.PublicKey} [verificationUserPublicKey] (Optional) The public key of the user who is the owner of the private key encrypted with the private key password.
|
|
28
|
+
* @return {Promise<AccountRecoveryPrivateKeyPasswordDecryptedDataEntity>}
|
|
29
|
+
* @throws {Error} If the response data cannot be decrypted.
|
|
30
|
+
* @throws {Error} If the decrypted response data cannot be parsed.
|
|
31
|
+
* @throws {EntityValidationError} If the decrypted response data cannot be used to create a private key password decrypted data entity.
|
|
32
|
+
* @throws {Error} If the user id contained in the decrypted response data does not match the verification user id.
|
|
33
|
+
* @throws {Error} If the fingerprint contained in the decrypted response data does not match the verification fingerprint.
|
|
34
|
+
*/
|
|
35
|
+
static async decrypt(response, decryptionKey, verificationUserId, verificationDomain, verificationUserPublicKey) {
|
|
36
|
+
let privateKeyPasswordDecryptedDataDto;
|
|
37
|
+
const responseDataMessage = await OpenpgpAssertion.readMessageOrFail(response.data);
|
|
38
|
+
const privateKeyPasswordDecryptedDataSerialized = await DecryptMessageService.decrypt(responseDataMessage, decryptionKey);
|
|
39
|
+
|
|
40
|
+
try {
|
|
41
|
+
privateKeyPasswordDecryptedDataDto = JSON.parse(privateKeyPasswordDecryptedDataSerialized);
|
|
42
|
+
} catch (error) {
|
|
43
|
+
throw new Error("Unable to parse the decrypted response data.");
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const privateKeyPasswordDecryptedData = new AccountRecoveryPrivateKeyPasswordDecryptedDataEntity(privateKeyPasswordDecryptedDataDto);
|
|
47
|
+
|
|
48
|
+
if (privateKeyPasswordDecryptedData.privateKeyUserId !== verificationUserId) {
|
|
49
|
+
throw new Error("The user id contained in the response data does not match the verification user id.");
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (privateKeyPasswordDecryptedData.domain !== verificationDomain) {
|
|
53
|
+
throw new Error("The domain contained in the private key password data does not match the expected target domain.");
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (verificationUserPublicKey) {
|
|
57
|
+
if (privateKeyPasswordDecryptedData.privateKeyFingerprint !== verificationUserPublicKey.getFingerprint().toUpperCase()) {
|
|
58
|
+
throw new Error("The response data fingerprint should match the verification fingerprint.");
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return privateKeyPasswordDecryptedData;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export default DecryptResponseDataService;
|