passbolt-styleguide 3.8.4 → 3.9.0-alpha2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (318) hide show
  1. package/build/css/help.min.css +3 -3
  2. package/build/css/public.min.css +3 -3
  3. package/build/css/themes/default/api_authentication.min.css +3 -3
  4. package/build/css/themes/default/api_cloud.min.css +3 -3
  5. package/build/css/themes/default/api_main.min.css +3 -3
  6. package/build/css/themes/default/api_reports.min.css +3 -3
  7. package/build/css/themes/default/api_webinstaller.min.css +3 -3
  8. package/build/css/themes/default/ext_app.min.css +3 -3
  9. package/build/css/themes/default/ext_authentication.min.css +3 -3
  10. package/build/css/themes/default/ext_external.min.css +2 -2
  11. package/build/css/themes/default/ext_in_form_cta.min.css +3 -3
  12. package/build/css/themes/default/ext_in_form_menu.min.css +3 -3
  13. package/build/css/themes/default/ext_quickaccess.min.css +3 -3
  14. package/build/css/themes/midgar/api_authentication.min.css +3 -3
  15. package/build/css/themes/midgar/api_main.min.css +3 -3
  16. package/build/css/themes/midgar/api_reports.min.css +3 -3
  17. package/build/css/themes/midgar/ext_app.min.css +3 -3
  18. package/build/css/themes/midgar/ext_authentication.min.css +3 -3
  19. package/build/css/themes/midgar/ext_in_form_cta.min.css +3 -3
  20. package/build/css/themes/midgar/ext_in_form_menu.min.css +3 -3
  21. package/build/css/themes/midgar/ext_quickaccess.min.css +3 -3
  22. package/build/css/themes/solarized_dark/api_authentication.min.css +1 -1
  23. package/build/css/themes/solarized_dark/api_main.min.css +1 -1
  24. package/build/css/themes/solarized_dark/api_reports.min.css +1 -1
  25. package/build/css/themes/solarized_dark/ext_app.min.css +1 -1
  26. package/build/css/themes/solarized_dark/ext_authentication.min.css +1 -1
  27. package/build/css/themes/solarized_dark/ext_in_form_cta.min.css +1 -1
  28. package/build/css/themes/solarized_dark/ext_in_form_menu.min.css +1 -1
  29. package/build/css/themes/solarized_dark/ext_quickaccess.min.css +1 -1
  30. package/build/css/themes/solarized_light/api_authentication.min.css +1 -1
  31. package/build/css/themes/solarized_light/api_main.min.css +1 -1
  32. package/build/css/themes/solarized_light/api_reports.min.css +1 -1
  33. package/build/css/themes/solarized_light/ext_app.min.css +1 -1
  34. package/build/css/themes/solarized_light/ext_authentication.min.css +1 -1
  35. package/build/css/themes/solarized_light/ext_in_form_cta.min.css +1 -1
  36. package/build/css/themes/solarized_light/ext_in_form_menu.min.css +1 -1
  37. package/build/css/themes/solarized_light/ext_quickaccess.min.css +1 -1
  38. package/build/js/dist/api-account-recovery.js +1 -1
  39. package/build/js/dist/api-app.js +1 -1
  40. package/build/js/dist/api-app.js.LICENSE.txt +75 -5
  41. package/build/js/dist/api-feedback.js +2 -0
  42. package/build/js/dist/api-feedback.js.LICENSE.txt +45 -0
  43. package/build/js/dist/api-recover.js +1 -1
  44. package/build/js/dist/api-setup.js +1 -1
  45. package/build/js/dist/api-triage.js +1 -1
  46. package/build/js/dist/api-vendors.js +1 -1
  47. package/build/js/dist/api-vendors.js.LICENSE.txt +19 -9
  48. package/build/js/dist/src/locales/de-DE/common.json +995 -0
  49. package/build/js/dist/src/locales/en-UK/common.json +1061 -0
  50. package/build/js/dist/src/locales/es-ES/common.json +995 -0
  51. package/build/js/dist/src/locales/fr-FR/common.json +995 -0
  52. package/build/js/dist/src/locales/ja-JP/common.json +980 -0
  53. package/build/js/dist/src/locales/lt-LT/common.json +1025 -0
  54. package/build/js/dist/src/locales/nl-NL/common.json +995 -0
  55. package/build/js/dist/src/locales/pl-PL/common.json +1025 -0
  56. package/build/js/dist/src/locales/sv-SE/common.json +995 -0
  57. package/package.json +18 -1
  58. package/src/img/controls/attention.svg +1 -0
  59. package/src/locales/en-UK/common.json +80 -16
  60. package/src/react-extension/ApiApp.js +17 -5
  61. package/src/react-extension/ApiFeedback.entry.js +24 -0
  62. package/src/react-extension/ExtApp.js +12 -5
  63. package/src/react-extension/ExtAuthenticationLogin.js +17 -15
  64. package/src/react-extension/ExtAuthenticationLogin.test.stories.js +59 -0
  65. package/src/react-extension/ExtBootstrapApp.js +1 -0
  66. package/src/react-extension/components/Administration/AdministrationWorkspace.js +24 -0
  67. package/src/react-extension/components/Administration/AdministrationWorkspace.test.data.js +3 -3
  68. package/src/react-extension/components/Administration/AdministrationWorkspace.test.js +13 -1
  69. package/src/react-extension/components/Administration/AdministrationWorkspace.test.page.js +7 -0
  70. package/src/react-extension/components/Administration/ConfirmDeleteSsoSettingsDialog/ConfirmDeleteSsoSettingsDialog.js +101 -0
  71. package/src/react-extension/components/Administration/ConfirmDeleteSsoSettingsDialog/ConfirmDeleteSsoSettingsDialog.test.data.js +23 -0
  72. package/src/react-extension/components/Administration/ConfirmDeleteSsoSettingsDialog/ConfirmDeleteSsoSettingsDialog.test.stories.js +27 -0
  73. package/src/react-extension/components/Administration/ConfirmSaveAccountRecoverySettings/ConfirmSaveAccountRecoverySettings.js +1 -1
  74. package/src/react-extension/components/Administration/DisplayAdministrationMenu/DisplayAdministrationMenu.js +78 -2
  75. package/src/react-extension/components/Administration/DisplayAdministrationMenu/DisplayAdministrationMenu.test.data.js +3 -1
  76. package/src/react-extension/components/Administration/DisplayAdministrationMenu/DisplayAdministrationMenu.test.js +60 -0
  77. package/src/react-extension/components/Administration/DisplayAdministrationMenu/DisplayAdministrationMenu.test.page.js +23 -4
  78. package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceActions/DisplayAdministrationInternationalisationActions/DisplayAdministrationInternationalisationActions.js +125 -0
  79. package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceActions/DisplayAdministrationMfaActions/DisplayAdministrationMfaActions.js +131 -0
  80. package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceActions/DisplayAdministrationSelfRegistrationActions/DisplayAdministrationSelfRegistrationActions.js +103 -0
  81. package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceActions/DisplayAdministrationSsoActions/DisplayAdministrationSsoActions.js +91 -0
  82. package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceActions/DisplayAdministrationSubscriptionActions/DisplayAdministrationSubscriptionActions.js +85 -0
  83. package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceActions/DisplayAdministrationUserDirectoryActions/DisplayAdministrationUserDirectoryActions.js +228 -0
  84. package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceBreadcrumb/DisplayAdministrationWorkspaceBreadcrumb.js +4 -0
  85. package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceBreadcrumb/DisplayAdministrationWorkspaceBreadcrumb.test.js +9 -0
  86. package/src/react-extension/components/Administration/DisplayEmailNotificationsAdministration/DisplayEmailNotificationsAdministration.js +3 -3
  87. package/src/react-extension/components/Administration/DisplayEmailNotificationsAdministration/DisplayEmailNotificationsAdministration.test.data.js +14 -0
  88. package/src/react-extension/components/Administration/DisplayEmailNotificationsAdministration/DisplayEmailNotificationsAdministration.test.page.js +0 -17
  89. package/src/react-extension/components/Administration/DisplayInternationalizationAdministration/DisplayInternationalizationAdministration.js +18 -115
  90. package/src/react-extension/components/Administration/DisplayInternationalizationAdministration/DisplayInternationalizationAdministration.test.data.js +11 -13
  91. package/src/react-extension/components/Administration/DisplayInternationalizationAdministration/DisplayInternationalizationAdministration.test.js +38 -43
  92. package/src/react-extension/components/Administration/DisplayInternationalizationAdministration/DisplayInternationalizationAdministration.test.page.js +47 -10
  93. package/src/react-extension/components/Administration/DisplayInternationalizationAdministration/DisplayInternationalizationAdministration.test.stories.js +10 -43
  94. package/src/react-extension/components/Administration/DisplayMfaAdministration/DisplayMfaAdministration.js +82 -367
  95. package/src/react-extension/components/Administration/DisplayMfaAdministration/DisplayMfaAdministration.test.data.js +128 -42
  96. package/src/react-extension/components/Administration/DisplayMfaAdministration/DisplayMfaAdministration.test.js +75 -121
  97. package/src/react-extension/components/Administration/DisplayMfaAdministration/DisplayMfaAdministration.test.page.js +46 -16
  98. package/src/react-extension/components/Administration/DisplayMfaAdministration/DisplayMfaAdministration.test.stories.js +18 -14
  99. package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/ConfirmDeletionSelfRegistrationSettings/ConfirmDeletionSelfRegistrationSettings.js +103 -0
  100. package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/ConfirmDeletionSelfRegistrationSettings/ConfirmDeletionSelfRegistrationSettings.test.js +53 -0
  101. package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/ConfirmDeletionSelfRegistrationSettings/ConfirmDeletionSelfRegistrationSettings.test.page.js +81 -0
  102. package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/ConfirmDeletionSelfRegistrationSettings/ConfirmDeletionSelfRegistrationSettings.test.stories.js +34 -0
  103. package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/ConfirmSaveSelfRegistrationSettings/ConfirmSaveSelfRegistrationSettings.js +125 -0
  104. package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/ConfirmSaveSelfRegistrationSettings/ConfirmSaveSelfRegistrationSettings.test.data.js +63 -0
  105. package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/ConfirmSaveSelfRegistrationSettings/ConfirmSaveSelfRegistrationSettings.test.js +54 -0
  106. package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/ConfirmSaveSelfRegistrationSettings/ConfirmSaveSelfRegistrationSettings.test.page.js +88 -0
  107. package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/ConfirmSaveSelfRegistrationSettings/ConfirmSaveSelfRegistrationSettings.test.stories.js +35 -0
  108. package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/DisplaySelfRegistrationAdministration.js +381 -0
  109. package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/DisplaySelfRegistrationAdministration.test.data.js +69 -0
  110. package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/DisplaySelfRegistrationAdministration.test.js +332 -0
  111. package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/DisplaySelfRegistrationAdministration.test.page.js +247 -0
  112. package/src/react-extension/components/Administration/DisplaySelfRegistrationAdministration/DisplaySelfRegistrationAdministration.test.stories.js +72 -0
  113. package/src/react-extension/components/Administration/DisplaySimulateSynchronizeUserDirectoryAdministration/DisplaySimulateSynchronizeUserDirectoryAdministration.js +19 -19
  114. package/src/react-extension/components/Administration/DisplaySimulateSynchronizeUserDirectoryAdministration/DisplaySimulateSynchronizeUserDirectoryAdministration.test.data.js +1717 -1729
  115. package/src/react-extension/components/Administration/DisplaySimulateSynchronizeUserDirectoryAdministration/DisplaySimulateSynchronizeUserDirectoryAdministration.test.js +11 -3
  116. package/src/react-extension/components/Administration/DisplaySimulateSynchronizeUserDirectoryAdministration/DisplaySimulateSynchronizeUserDirectoryAdministration.test.page.js +4 -1
  117. package/src/react-extension/components/Administration/DisplaySimulateSynchronizeUserDirectoryAdministration/DisplaySimulateSynchronizeUserDirectoryAdministration.test.stories.js +11 -1784
  118. package/src/react-extension/components/Administration/DisplaySubscriptionKey/DisplaySubscriptionKey.js +41 -140
  119. package/src/react-extension/components/Administration/DisplaySubscriptionKey/DisplaySubscriptionKey.test.data.js +15 -3
  120. package/src/react-extension/components/Administration/DisplaySubscriptionKey/DisplaySubscriptionKey.test.js +22 -49
  121. package/src/react-extension/components/Administration/DisplaySubscriptionKey/DisplaySubscriptionKey.test.page.js +19 -11
  122. package/src/react-extension/components/Administration/DisplaySubscriptionKey/DisplaySubscriptionKey.test.stories.js +9 -3
  123. package/src/react-extension/components/Administration/DisplaySynchronizeUserDirectoryAdministration/DisplaySynchronizeUserDirectoryAdministration.js +5 -6
  124. package/src/react-extension/components/Administration/DisplaySynchronizeUserDirectoryAdministration/DisplaySynchronizeUserDirectoryAdministration.test.data.js +1717 -1728
  125. package/src/react-extension/components/Administration/DisplaySynchronizeUserDirectoryAdministration/DisplaySynchronizeUserDirectoryAdministration.test.js +11 -3
  126. package/src/react-extension/components/Administration/DisplaySynchronizeUserDirectoryAdministration/DisplaySynchronizeUserDirectoryAdministration.test.page.js +4 -1
  127. package/src/react-extension/components/Administration/DisplaySynchronizeUserDirectoryAdministration/DisplaySynchronizeUserDirectoryAdministration.test.stories.js +11 -1784
  128. package/src/react-extension/components/Administration/DisplayUserDirectoryAdministration/DisplayUserDirectoryAdministration.js +362 -835
  129. package/src/react-extension/components/Administration/DisplayUserDirectoryAdministration/DisplayUserDirectoryAdministration.test.data.js +427 -418
  130. package/src/react-extension/components/Administration/DisplayUserDirectoryAdministration/DisplayUserDirectoryAdministration.test.js +134 -175
  131. package/src/react-extension/components/Administration/DisplayUserDirectoryAdministration/DisplayUserDirectoryAdministration.test.page.js +108 -11
  132. package/src/react-extension/components/Administration/DisplayUserDirectoryAdministration/DisplayUserDirectoryAdministration.test.stories.js +17 -25
  133. package/src/react-extension/components/Administration/EditSubscriptionKey/EditSubscriptionKey.js +4 -2
  134. package/src/react-extension/components/Administration/ManageAccountRecoveryAdministrationSettings/ManageAccountRecoveryAdministrationSettings.js +3 -3
  135. package/src/react-extension/components/Administration/ManageAccountRecoveryAdministrationSettings/ManageAccountRecoveryAdministrationSettings.test.js +1 -1
  136. package/src/react-extension/components/Administration/ManageSmtpAdministrationSettings/ManageSmtpAdministrationSettings.js +32 -7
  137. package/src/react-extension/components/Administration/ManageSmtpAdministrationSettings/ManageSmtpAdministrationSettings.test.data.js +0 -3
  138. package/src/react-extension/components/Administration/ManageSmtpAdministrationSettings/ManageSmtpAdministrationSettings.test.js +145 -1
  139. package/src/react-extension/components/Administration/ManageSmtpAdministrationSettings/ManageSmtpAdministrationSettings.test.page.js +52 -1
  140. package/src/react-extension/components/Administration/ManageSmtpAdministrationSettings/ManageSmtpAdministrationSettings.test.stories.js +15 -0
  141. package/src/react-extension/components/Administration/ManageSsoSettings/ManageSsoSettings.js +340 -0
  142. package/src/react-extension/components/Administration/ManageSsoSettings/ManageSsoSettings.test.data.js +56 -0
  143. package/src/react-extension/components/Administration/ManageSsoSettings/ManageSsoSettings.test.js +223 -0
  144. package/src/react-extension/components/Administration/ManageSsoSettings/ManageSsoSettings.test.page.js +235 -0
  145. package/src/react-extension/components/Administration/ManageSsoSettings/ManageSsoSettings.test.stories.js +55 -0
  146. package/src/react-extension/components/Administration/ManageSsoSettings/SsoProviders.data.js +34 -0
  147. package/src/react-extension/components/Administration/SelectAccountRecoveryOrganizationKey/GenerateOrganizationKey.js +12 -3
  148. package/src/react-extension/components/Administration/SelectAccountRecoveryOrganizationKey/GenerateOrganizationKey.test.js +27 -0
  149. package/src/react-extension/components/Administration/SelectAccountRecoveryOrganizationKey/SelectAccountRecoveryOrganizationKey.test.page.js +8 -0
  150. package/src/react-extension/components/Administration/TestSsoSettingsDialog/TestSsoSettingsDialog.js +197 -0
  151. package/src/react-extension/components/Administration/TestSsoSettingsDialog/TestSsoSettingsDialog.test.data.js +37 -0
  152. package/src/react-extension/components/Administration/TestSsoSettingsDialog/TestSsoSettingsDialog.test.js +187 -0
  153. package/src/react-extension/components/Administration/TestSsoSettingsDialog/TestSsoSettingsDialog.test.page.js +120 -0
  154. package/src/react-extension/components/Administration/TestSsoSettingsDialog/TestSsoSettingsDialog.test.stories.js +31 -0
  155. package/src/react-extension/components/Authentication/CheckPassphrase/CheckPassphrase.js +9 -5
  156. package/src/react-extension/components/Authentication/CheckPassphrase/CheckPassphrase.test.data.js +4 -0
  157. package/src/react-extension/components/Authentication/CheckPassphrase/CheckPassphrase.test.js +11 -42
  158. package/src/react-extension/components/Authentication/CheckPassphrase/CheckPassphrase.test.page.js +1 -0
  159. package/src/react-extension/components/Authentication/CreateGpgKey/CreateGpgKey.js +9 -5
  160. package/src/react-extension/components/Authentication/CreateGpgKey/CreateGpgKey.test.data.js +4 -0
  161. package/src/react-extension/components/Authentication/CreateGpgKey/CreateGpgKey.test.js +16 -2
  162. package/src/react-extension/components/Authentication/CreateGpgKey/CreateGpgKey.test.page.js +17 -1
  163. package/src/react-extension/components/AuthenticationLogin/Login/Login.js +159 -61
  164. package/src/react-extension/components/AuthenticationLogin/Login/Login.test.data.js +14 -11
  165. package/src/react-extension/components/AuthenticationLogin/Login/Login.test.js +79 -0
  166. package/src/react-extension/components/AuthenticationLogin/Login/Login.test.page.js +16 -0
  167. package/src/react-extension/components/AuthenticationLogin/OrchestrateLogin/OrchestrateLoginBoxMain.js +2 -0
  168. package/src/react-extension/components/AuthenticationSetup/SetupAuthentication/SetupAuthentication.js +4 -0
  169. package/src/react-extension/components/Common/Error/ApiError/ApiError.js +119 -0
  170. package/src/react-extension/components/Common/Error/ApiError/ApiError.test.js +43 -0
  171. package/src/react-extension/components/Common/Error/ApiError/ApiError.test.page.js +108 -0
  172. package/src/react-extension/components/Common/Error/ApiError/ApiError.test.stories.js +39 -0
  173. package/src/react-extension/components/Common/Inputs/Autocomplete/Autocomplete.test.js +12 -0
  174. package/src/react-extension/components/Common/Inputs/Autocomplete/AutocompleteItem.js +2 -2
  175. package/src/react-extension/components/Common/Legacy/HandleLegacyAppjs.js +1 -1
  176. package/src/react-extension/components/Common/Navigation/Header/Logo.js +13 -1
  177. package/src/react-extension/components/Resource/CreateResource/CreateResource.js +103 -30
  178. package/src/react-extension/components/Resource/CreateResource/CreateResource.test.js +44 -10
  179. package/src/react-extension/components/Resource/CreateResource/CreateResource.test.page.js +35 -7
  180. package/src/react-extension/components/Resource/DisplayResourcesList/DisplayResourcesList.js +3 -3
  181. package/src/react-extension/components/Resource/DisplayResourcesList/DisplayResourcesListContextualMenu.js +6 -5
  182. package/src/react-extension/components/Resource/DisplayResourcesWorkspace/DisplayResourcesWorkspaceMenu.js +5 -4
  183. package/src/react-extension/components/Resource/EditResource/EditResource.js +95 -23
  184. package/src/react-extension/components/Resource/EditResource/EditResource.test.js +45 -13
  185. package/src/react-extension/components/Resource/EditResource/EditResource.test.page.js +35 -2
  186. package/src/react-extension/components/ResourceDetails/DisplayResourceDetails/DisplayResourceDetails.js +2 -1
  187. package/src/react-extension/components/ResourceDetails/DisplayResourceDetails/DisplayResourceDetailsInformation.js +3 -2
  188. package/src/react-extension/components/ResourceFolder/CreateResourceFolder/CreateResourceFolder.js +23 -2
  189. package/src/react-extension/components/ResourceFolder/CreateResourceFolder/CreateResourceFolder.test.js +8 -0
  190. package/src/react-extension/components/ResourceFolder/CreateResourceFolder/CreateResourceFolder.test.page.js +26 -2
  191. package/src/react-extension/components/ResourceFolder/RenameResourceFolder/RenameResourceFolder.js +22 -1
  192. package/src/react-extension/components/ResourceFolder/RenameResourceFolder/RenameResourceFolder.test.js +8 -0
  193. package/src/react-extension/components/ResourceFolder/RenameResourceFolder/RenameResourceFolder.test.page.js +25 -2
  194. package/src/react-extension/components/ResourceFolderDetails/DisplayResourceFolderDetails/DisplayResourceFolderDetails.js +2 -1
  195. package/src/react-extension/components/ResourcePassword/GenerateResourcePassword/GenerateResourcePassword.js +2 -1
  196. package/src/react-extension/components/ResourceTag/EditResourceTag/EditResourceTag.js +14 -1
  197. package/src/react-extension/components/ResourceTag/EditResourceTag/EditResourceTag.test.js +8 -0
  198. package/src/react-extension/components/ResourceTag/EditResourceTag/EditResourceTag.test.page.js +12 -0
  199. package/src/react-extension/components/User/CreateUser/CreateUser.js +42 -3
  200. package/src/react-extension/components/User/CreateUser/CreateUser.test.js +16 -0
  201. package/src/react-extension/components/User/CreateUser/CreateUser.test.page.js +26 -0
  202. package/src/react-extension/components/User/DisplayUserWorkspaceActions/DisplayUserWorkspaceActions.js +2 -1
  203. package/src/react-extension/components/User/DisplayUsersContextualMenu/DisplayUsersContextualMenu.js +5 -5
  204. package/src/react-extension/components/User/EditUser/EditUser.js +29 -2
  205. package/src/react-extension/components/User/EditUser/EditUser.test.js +12 -0
  206. package/src/react-extension/components/User/EditUser/EditUser.test.page.js +26 -0
  207. package/src/react-extension/components/UserDetails/DisplayUserDetails/DisplayUserDetails.js +2 -1
  208. package/src/react-extension/components/UserDetails/DisplayUserDetails/DisplayUserDetails.test.data.js +1332 -1331
  209. package/src/react-extension/components/UserDetails/DisplayUserDetailsPublicKey/DisplayUserDetailsPublicKey.js +2 -1
  210. package/src/react-extension/components/UserGroup/CreateUserGroup/CreateUserGroup.js +19 -1
  211. package/src/react-extension/components/UserGroup/CreateUserGroup/CreateUserGroup.test.js +9 -0
  212. package/src/react-extension/components/UserGroup/CreateUserGroup/CreateUserGroup.test.page.js +12 -0
  213. package/src/react-extension/components/UserGroup/DisplayUserGroupDetails/DisplayUserGroupDetails.js +2 -1
  214. package/src/react-extension/components/UserGroup/EditUserGroup/EditUserGroup.js +16 -1
  215. package/src/react-extension/components/UserGroup/EditUserGroup/EditUserGroup.test.js +8 -0
  216. package/src/react-extension/components/UserGroup/EditUserGroup/EditUserGroup.test.page.js +26 -1
  217. package/src/react-extension/components/UserSetting/ChangeUserPassphrase/ConfirmPassphrase.js +1 -1
  218. package/src/react-extension/components/UserSetting/ChangeUserPassphrase/EnterNewPassphrase.js +6 -4
  219. package/src/react-extension/components/UserSetting/ChangeUserPassphrase/EnterNewPassphrase.test.data.js +4 -1
  220. package/src/react-extension/components/UserSetting/ChangeUserPassphrase/EnterNewPassphrase.test.js +21 -11
  221. package/src/react-extension/components/UserSetting/ChangeUserPassphrase/EnterNewPassphrase.test.page.js +10 -1
  222. package/src/react-extension/contexts/AdminSmtpSettingsContext.js +2 -0
  223. package/src/react-extension/contexts/AdminSmtpSettingsContext.test.data.js +13 -0
  224. package/src/react-extension/contexts/AdminSmtpSettingsContext.test.js +3 -1
  225. package/src/react-extension/contexts/AdminSsoContext.js +558 -0
  226. package/src/react-extension/contexts/AdminSsoContext.test.data.js +51 -0
  227. package/src/react-extension/contexts/Administration/AdministrationInternationalizationContext/AdministrationInternationalizationContext.js +194 -0
  228. package/src/react-extension/contexts/Administration/AdministrationInternationalizationContext/AdministrationInternationalizationContext.test.js +111 -0
  229. package/src/react-extension/contexts/Administration/AdministrationMfa/AdministrationMfaContext.js +265 -0
  230. package/src/react-extension/contexts/Administration/AdministrationMfa/AdministrationMfaContext.test.js +178 -0
  231. package/src/react-extension/contexts/Administration/AdministrationSelfRegistration/AdministrationSelfRegistrationContext.js +453 -0
  232. package/src/react-extension/contexts/Administration/AdministrationSelfRegistration/AdministrationSelfRegistrationContext.test.js +218 -0
  233. package/src/react-extension/contexts/Administration/AdministrationSubscription/AdministrationSubscription.js +168 -0
  234. package/src/react-extension/contexts/Administration/AdministrationSubscription/AdministrationSubscription.test.js +73 -0
  235. package/src/react-extension/contexts/Administration/AdministrationUserDirectory/AdministrationUserDirectoryContext.js +353 -0
  236. package/src/react-extension/contexts/Administration/AdministrationUserDirectory/AdministrationUserDirectoryContext.test.js +220 -0
  237. package/src/react-extension/contexts/AdministrationWorkspaceContext.js +17 -178
  238. package/src/react-extension/contexts/AdministrationWorkspaceContext.test.js +0 -26
  239. package/src/react-extension/contexts/ApiAppContext.test.data.js +4 -2
  240. package/src/react-extension/contexts/Authentication/AuthenticationLoginContext.js +54 -4
  241. package/src/react-extension/contexts/Authentication/AuthenticationLoginContext.test.data.js +10 -1
  242. package/src/react-extension/contexts/Authentication/AuthenticationLoginContext.test.js +92 -14
  243. package/src/react-extension/contexts/Authentication/AuthenticationSetupContext.js +1 -0
  244. package/src/react-extension/contexts/NavigationContext.js +34 -0
  245. package/src/react-extension/contexts/SsoContext.js +151 -0
  246. package/src/react-extension/contexts/SsoContext.test.data.js +36 -0
  247. package/src/react-extension/contexts/SsoContext.test.js +104 -0
  248. package/src/react-extension/lib/Domain/DomainUtil.js +70 -0
  249. package/src/react-extension/lib/Domain/DomainUtil.test.js +129 -0
  250. package/src/react-extension/lib/Domain/Domains.js +6113 -0
  251. package/src/react-extension/lib/Error/InputValidator.js +24 -0
  252. package/src/react-extension/lib/Map/DynamicRef.js +49 -0
  253. package/src/react-extension/lib/Map/DynamicRef.test.js +56 -0
  254. package/src/react-extension/lib/Map/MapObject.js +48 -0
  255. package/src/react-extension/lib/Map/MapObject.test.js +43 -0
  256. package/src/react-quickaccess/ExtQuickAccess.js +7 -4
  257. package/src/react-quickaccess/components/GeneratePasswordPage/GeneratePasswordPage.js +3 -1
  258. package/src/react-quickaccess/components/GeneratePasswordPage/GeneratePasswordPage.test.data.js +4 -0
  259. package/src/react-quickaccess/components/LoginPage/LoginPage.js +115 -4
  260. package/src/react-quickaccess/components/LoginPage/LoginPage.test.data.js +10 -0
  261. package/src/react-quickaccess/components/LoginPage/LoginPage.test.stories.js +30 -3
  262. package/src/react-quickaccess/components/ResourceAutoSave/SaveResource.js +33 -1
  263. package/src/react-quickaccess/components/ResourceAutoSave/SaveResource.test.data.js +25 -0
  264. package/src/react-quickaccess/components/ResourceAutoSave/SaveResource.test.js +60 -0
  265. package/src/react-quickaccess/components/ResourceAutoSave/SaveResource.test.page.js +60 -0
  266. package/src/react-quickaccess/components/ResourceCreatePage/ResourceCreatePage.js +33 -1
  267. package/src/react-quickaccess/components/ResourceCreatePage/ResourceCreatePage.test.js +36 -7
  268. package/src/react-quickaccess/components/ResourceViewPage/ResourceViewPage.js +3 -2
  269. package/src/react-quickaccess/contexts/SsoContext.js +150 -0
  270. package/src/react-web-integration/lib/InForm/InFormFieldSelector.js +5 -0
  271. package/src/shared/constants/inputs.const.js +30 -0
  272. package/src/shared/lib/Browser/clipBoard.js +45 -0
  273. package/src/shared/lib/Browser/clipBoard.test.js +59 -0
  274. package/src/shared/models/Mfa/Duo.js +36 -0
  275. package/src/shared/models/Mfa/Duo.test.js +59 -0
  276. package/src/shared/models/Mfa/MfaDTO.js +51 -0
  277. package/src/shared/models/Mfa/MfaDTO.test.js +48 -0
  278. package/src/shared/models/Mfa/MfaEnumeration.js +17 -0
  279. package/src/shared/models/Mfa/MfaModel.js +48 -0
  280. package/src/shared/models/Mfa/MfaModel.test.js +37 -0
  281. package/src/shared/models/Mfa/Yubikey.js +35 -0
  282. package/src/shared/models/Mfa/Yubikey.test.js +47 -0
  283. package/src/shared/models/selfRegistration/SelfRegistrationDomainsViewModel.js +55 -0
  284. package/src/shared/models/selfRegistration/SelfRegistrationDomainsViewModel.test.js +37 -0
  285. package/src/shared/models/selfRegistration/SelfRegistrationDto.js +42 -0
  286. package/src/shared/models/selfRegistration/SelfRegistrationDto.test.js +48 -0
  287. package/src/shared/models/selfRegistration/SelfRegistrationEnumeration.js +17 -0
  288. package/src/shared/models/subscription/SubscriptionDto.js +34 -0
  289. package/src/shared/models/subscription/SubscriptionDto.test.js +31 -0
  290. package/src/shared/models/subscription/SubscriptionModel.js +33 -0
  291. package/src/shared/models/subscription/SubscriptionModel.test.js +48 -0
  292. package/src/shared/models/user/UserModel.js +37 -0
  293. package/src/shared/models/userDirectory/UserDirectoryDTO.js +57 -0
  294. package/src/shared/models/userDirectory/UserDirectoryDTO.test.js +40 -0
  295. package/src/shared/models/userDirectory/UserDirectoryEnum.js +22 -0
  296. package/src/shared/models/userDirectory/UserDirectoryModel.js +64 -0
  297. package/src/shared/models/userDirectory/UserDirectoryModel.test.js +37 -0
  298. package/src/shared/services/actions/subscription/SubscriptionActionService.js +69 -0
  299. package/src/shared/services/actions/subscription/SubscriptionActionService.test.js +73 -0
  300. package/src/shared/services/api/Internationalisation/InternationalisationService.js +46 -0
  301. package/src/shared/services/api/Mfa/MfaService.js +54 -0
  302. package/src/shared/services/{accountRecovery → api/accountRecovery}/ApiAppAccountRecoveryUserService.js +2 -2
  303. package/src/shared/services/{accountRecovery → api/accountRecovery}/ExtAppAccountRecoveryUserService.js +0 -0
  304. package/src/shared/services/api/secrets/pownedService.js +64 -0
  305. package/src/shared/services/api/secrets/pownedService.test.js +63 -0
  306. package/src/shared/services/api/selfRegistration/selfRegistrationService.js +64 -0
  307. package/src/shared/services/api/user/UserService.js +45 -0
  308. package/src/shared/services/api/userDirectory/UserDirectoryService.js +108 -0
  309. package/src/shared/services/forms/Mfa/MfaFormService.js +195 -0
  310. package/src/shared/services/forms/Mfa/MfaFormService.test.js +341 -0
  311. package/src/shared/services/forms/selfRegistration/SelfRegistrationFormService.js +92 -0
  312. package/src/shared/services/forms/selfRegistration/SelfRegistrationFormService.test.js +101 -0
  313. package/src/shared/services/forms/userDirectory/UserDirectoryFormService.js +118 -0
  314. package/src/shared/services/forms/userDirectory/UserDirectoryFormService.test.js +128 -0
  315. package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceActions/DisplayAdministrationWorkspaceActions.js +0 -205
  316. package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceActions/DisplayAdministrationWorkspaceActions.test.data.js +0 -37
  317. package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceActions/DisplayAdministrationWorkspaceActions.test.js +0 -197
  318. package/src/react-extension/components/Administration/DisplayAdministrationWorkspaceActions/DisplayAdministrationWorkspaceActions.test.page.js +0 -133
@@ -0,0 +1,36 @@
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.8.0
13
+ */
14
+
15
+
16
+ /**
17
+ * Model related to Duo model
18
+ */
19
+ class Duo {
20
+ /**
21
+ * Constructor
22
+ *
23
+ * @param {Duo} Duo duo object from server
24
+ * @public
25
+ */
26
+ constructor(duo = {}) {
27
+ this.hostName = "duoHostname" in duo ? duo.duoHostname : duo.hostName;
28
+ this.integrationKey = "duoIntegrationKey" in duo ? duo.duoIntegrationKey : duo.integrationKey;
29
+ this.salt = "duoSalt" in duo ? duo.duoSalt : duo.salt;
30
+ this.secretKey = "duoSecretKey" in duo ? duo.duoSecretKey : duo.secretKey;
31
+ }
32
+ }
33
+
34
+ export default Duo;
35
+
36
+
@@ -0,0 +1,59 @@
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.8.0
13
+ */
14
+
15
+ import Duo from "./Duo";
16
+
17
+
18
+ describe("Duo model", () => {
19
+ const randomKey = "random-key";
20
+ const randomSalt = "random-salt";
21
+ const randomHostname = "random-hostname";
22
+ const randomIntegrationKey = "random-integration-key";
23
+
24
+ describe("Duo::constructor", () => {
25
+ it("should init with hostName, integrationKey, salt and secretKey", () => {
26
+ const duoParam = {
27
+ hostName: randomHostname,
28
+ integrationKey: randomIntegrationKey,
29
+ salt: randomSalt,
30
+ secretKey: randomKey,
31
+ };
32
+ const duo = new Duo(duoParam);
33
+
34
+ expect.assertions(4);
35
+
36
+ expect(duo.hostName).toEqual(duoParam.hostName);
37
+ expect(duo.secretKey).toEqual(duoParam.secretKey);
38
+ expect(duo.salt).toEqual(duoParam.salt);
39
+ expect(duo.integrationKey).toEqual(duoParam.integrationKey);
40
+ });
41
+ it("should init with duoHostname, duoIntegrationKey, duoSalt and duoSecretKey", () => {
42
+ const duoParam = {
43
+ duoHostname: randomHostname,
44
+ duoIntegrationKey: randomIntegrationKey,
45
+ duoSalt: randomSalt,
46
+ duoSecretKey: randomKey,
47
+ };
48
+ const duo = new Duo(duoParam);
49
+
50
+ expect.assertions(4);
51
+
52
+ expect(duo.hostName).toEqual(duoParam.duoHostname);
53
+ expect(duo.secretKey).toEqual(duoParam.duoSecretKey);
54
+ expect(duo.salt).toEqual(duoParam.duoSalt);
55
+ expect(duo.integrationKey).toEqual(duoParam.duoIntegrationKey);
56
+ });
57
+ });
58
+ });
59
+
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Passbolt ~ Open source password manager for teams
3
+ * Copyright (c) 2022 Passbolt SA (https://www.passbolt.com)
4
+ *
5
+ * Licensed under GNU Affero General Public License version 3 of the or any later version.
6
+ * For full copyright and license information, please see the LICENSE.txt
7
+ * Redistributions of files must retain the above copyright notice.
8
+ *
9
+ * @copyright Copyright (c) 2022 Passbolt SA (https://www.passbolt.com)
10
+ * @license https://opensource.org/licenses/AGPL-3.0 AGPL License
11
+ * @link https://www.passbolt.com Passbolt(tm)
12
+ * @since 3.8.0
13
+ */
14
+
15
+ import {MfaProviders} from "./MfaEnumeration";
16
+ import Yubikey from './Yubikey';
17
+ import Duo from './Duo';
18
+
19
+
20
+ /**
21
+ * Model related to the Mfa dto settings
22
+ */
23
+ class MfaDTO {
24
+ /**
25
+ * Constructor
26
+ *
27
+ * @param {MfaModel} mfaModel
28
+ * @public
29
+ */
30
+ constructor(mfaModel = {}) {
31
+ this.providers = [];
32
+ this.setProviders(mfaModel);
33
+ this.yubikey = this.providers.includes(MfaProviders.yubikey) ? new Yubikey(mfaModel) : {};
34
+ this.duo = this.providers.includes(MfaProviders.duo) ? new Duo(mfaModel) : {};
35
+ }
36
+
37
+ setProviders(mfaModel) {
38
+ if (mfaModel.totpProviderToggle) {
39
+ this.providers.push(MfaProviders.totp);
40
+ }
41
+ if (mfaModel.yubikeyToggle) {
42
+ this.providers.push(MfaProviders.yubikey);
43
+ }
44
+ if (mfaModel.duoToggle) {
45
+ this.providers.push(MfaProviders.duo);
46
+ }
47
+ }
48
+ }
49
+
50
+ export default MfaDTO;
51
+
@@ -0,0 +1,48 @@
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.8.0
13
+ */
14
+
15
+ import {mockModel} from "../../../react-extension/components/Administration/DisplayMfaAdministration/DisplayMfaAdministration.test.data";
16
+ import MfaDTO from './MfaDTO';
17
+ import {MfaProviders} from './MfaEnumeration';
18
+
19
+
20
+ describe("MfaDTO model", () => {
21
+ describe("MfaDTO::constructor", () => {
22
+ it("should init dto with model", () => {
23
+ const dto = new MfaDTO(mockModel);
24
+
25
+ expect.assertions(3);
26
+
27
+ expect(dto.providers).toEqual([MfaProviders.totp, MfaProviders.yubikey, MfaProviders.duo]);
28
+ expect(dto.duo).toEqual({"hostName": "api-123456af.duosecurity.com", "integrationKey": "PAGI605APMFKP8YSME6T", "salt": "salt1salt1salt1salt1salt1salt1salt1salt1", "secretKey": "PACNkhAAlVLH0m8d3efssULkizlEtunMhIsOTCLT"});
29
+ expect(dto.yubikey).toEqual({"clientId": "80412", "secretKey": "pas6lyijz2AIhX3D9eLIYAxv63lt@"});
30
+ });
31
+
32
+ it("should not init with yubikey and duo if not selected", () => {
33
+ const model = mockModel;
34
+ model.yubikeyToggle = false;
35
+ model.duoToggle = false;
36
+ model.totpProviderToggle = false;
37
+ const dto = new MfaDTO(model);
38
+
39
+ expect.assertions(3);
40
+
41
+ expect(dto.providers).toEqual([]);
42
+ expect(dto.duo).toEqual({});
43
+ expect(dto.yubikey).toEqual({});
44
+ });
45
+ });
46
+ });
47
+
48
+
@@ -0,0 +1,17 @@
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.8.0
13
+ */
14
+
15
+ export const MfaProviders = {
16
+ totp: "totp", yubikey: "yubikey", duo: "duo"
17
+ };
@@ -0,0 +1,48 @@
1
+
2
+ /**
3
+ * Passbolt ~ Open source password manager for teams
4
+ * Copyright (c) 2022 Passbolt SA (https=//www.passbolt.com)
5
+ *
6
+ * Licensed under GNU Affero General Public License version 3 of the or any later version.
7
+ * For full copyright and license information; please see the LICENSE.txt
8
+ * Redistributions of files must retain the above copyright notice.
9
+ *
10
+ * @copyright Copyright (c) 2022 Passbolt SA (https://www.passbolt.com)
11
+ * @license https://opensource.org/licenses/AGPL-3.0 AGPL License
12
+ * @link https://www.passbolt.com Passbolt(tm)
13
+ * @since 3.8.0
14
+ */
15
+
16
+ import {MfaProviders} from './MfaEnumeration';
17
+
18
+ /**
19
+ * Model related to the mfa model settings
20
+ */
21
+ class MfaModel {
22
+ /**
23
+ * Constructor
24
+ *
25
+ * @param {MfaDTO} mfaDTO from db
26
+ * @public
27
+ */
28
+ constructor(mfaDTO = {}) {
29
+ // ONE TIME PASSWORD
30
+ this.totpProviderToggle = "providers" in mfaDTO ? mfaDTO.providers.includes(MfaProviders.totp) : false; // One Time Password toggle value
31
+
32
+ // YUBIKEY
33
+ this.yubikeyToggle = "providers" in mfaDTO ? mfaDTO.providers.includes(MfaProviders.yubikey) : false; // yubikey toggle value
34
+ this.yubikeyClientIdentifier = "yubikey" in mfaDTO ? mfaDTO.yubikey.clientId : ""; // yubikey client identifier
35
+ this.yubikeySecretKey = "yubikey" in mfaDTO ? mfaDTO.yubikey.secretKey : ""; // yubikey secret key
36
+
37
+ // DUO
38
+ this.duoToggle = "providers" in mfaDTO ? mfaDTO.providers.includes(MfaProviders.duo) : false; // yubikey toggle value
39
+ this.duoHostname = "duo" in mfaDTO ? mfaDTO.duo.hostName : ""; // duo hostname
40
+ this.duoIntegrationKey = "duo" in mfaDTO ? mfaDTO.duo.integrationKey : ""; // yubikey secret key
41
+ this.duoSalt = "duo" in mfaDTO ? mfaDTO.duo.salt : ""; // duo salt
42
+ this.duoSecretKey = "duo" in mfaDTO ? mfaDTO.duo.secretKey : ""; // duo secret key
43
+ }
44
+ }
45
+
46
+ export default MfaModel;
47
+
48
+
@@ -0,0 +1,37 @@
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.8.0
13
+ */
14
+
15
+ import {mockMfaSettings, mockModel} from "../../../react-extension/components/Administration/DisplayMfaAdministration/DisplayMfaAdministration.test.data";
16
+ import MfaModel from "./MfaModel";
17
+ import {mockDefaultMfaModel} from '../../../react-extension/components/Administration/DisplayMfaAdministration/DisplayMfaAdministration.test.data';
18
+
19
+
20
+ describe("MFAModel", () => {
21
+ describe("MFAModel::constructor", () => {
22
+ it("should init model with default value", () => {
23
+ const model = new MfaModel();
24
+ expect.assertions(1);
25
+ expect(model).toEqual(mockDefaultMfaModel);
26
+ });
27
+
28
+ it("should init model with dto value", () => {
29
+ const model = new MfaModel(mockMfaSettings);
30
+ expect.assertions(1);
31
+ expect(model).toEqual(mockModel);
32
+ });
33
+ });
34
+ });
35
+
36
+
37
+
@@ -0,0 +1,35 @@
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.8.0
13
+ */
14
+
15
+
16
+ /**
17
+ * Model related to Yubikey model
18
+ */
19
+ class Yubikey {
20
+ /**
21
+ * Constructor
22
+ *
23
+ * @param {Yubikey} yubikey duo object from server
24
+ * @public
25
+ */
26
+ constructor(yubikey = {}) {
27
+ this.clientId = "yubikeyClientIdentifier" in yubikey ? yubikey.yubikeyClientIdentifier : yubikey.clientId;
28
+ this.secretKey = "yubikeySecretKey" in yubikey ? yubikey.yubikeySecretKey : yubikey.secretKey;
29
+ }
30
+ }
31
+
32
+ export default Yubikey;
33
+
34
+
35
+
@@ -0,0 +1,47 @@
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.8.0
13
+ */
14
+
15
+ import Yubikey from "./Yubikey";
16
+
17
+ describe("YubiKey model", () => {
18
+ const randomKey = "random-key";
19
+ const randomClient = "random-client";
20
+
21
+ describe("YubiKey::constructor", () => {
22
+ it("should init with clientId and secretKey", async() => {
23
+ const yubikeyParam = {
24
+ clientId: randomClient,
25
+ secretKey: randomKey,
26
+ };
27
+ const yubikey = new Yubikey(yubikeyParam);
28
+
29
+ expect.assertions(2);
30
+
31
+ expect(yubikey.clientId).toEqual(yubikeyParam.clientId);
32
+ expect(yubikey.secretKey).toEqual(yubikeyParam.secretKey);
33
+ });
34
+ it("should init with yubikeyClientIdentifier and yubikeySecretKey", async() => {
35
+ const yubikeyParam = {
36
+ yubikeyClientIdentifier: randomClient,
37
+ yubikeySecretKey: randomKey,
38
+ };
39
+ const yubikey = new Yubikey(yubikeyParam);
40
+
41
+ expect.assertions(2);
42
+
43
+ expect(yubikey.clientId).toEqual(yubikeyParam.yubikeyClientIdentifier);
44
+ expect(yubikey.secretKey).toEqual(yubikeyParam.yubikeySecretKey);
45
+ });
46
+ });
47
+ });
@@ -0,0 +1,55 @@
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.8.3
13
+ */
14
+
15
+ import {v4 as uuidv4} from "uuid";
16
+
17
+ /**
18
+ * Model related to the self registration domaisn view models for UI
19
+ */
20
+ class SelfRegistrationDomainsViewModel {
21
+ /**
22
+ * Constructor
23
+ * @param {SelfRegistrationDto} selfRegistrationDto
24
+ */
25
+ constructor(selfRegistrationDto = {}) {
26
+ this.allowedDomains = this.mapAllowedDomains(selfRegistrationDto.data?.allowed_domains || []);
27
+ }
28
+
29
+ /**
30
+ * set row with an unique uuid, to avoid front issue during deletion and addition for error messages
31
+ * @param {*} rows
32
+ */
33
+ mapAllowedDomains(domains) {
34
+ return new Map(
35
+ domains.map(domain => [uuidv4(), domain]),
36
+ );
37
+ }
38
+
39
+ /**
40
+ * return the allowed domains as settings
41
+ */
42
+ getSettings() {
43
+ return this.allowedDomains;
44
+ }
45
+
46
+ /**
47
+ * return the allowed domains as settings
48
+ */
49
+ setSettings(domains) {
50
+ this.allowedDomains = this.mapAllowedDomains(domains);
51
+ }
52
+ }
53
+
54
+ export default SelfRegistrationDomainsViewModel;
55
+
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Passbolt ~ Open source password manager for teams
3
+ * Copyright (c) 2022 Passbolt SA (https://www.passbolt.com)
4
+ *
5
+ * Licensed under GNU Affero General Public License version 3 of the or any later version.
6
+ * For full copyright and license information, please see the LICENSE.txt
7
+ * Redistributions of files must retain the above copyright notice.
8
+ *
9
+ * @copyright Copyright (c) 2022 Passbolt SA (https://www.passbolt.com)
10
+ * @license https://opensource.org/licenses/AGPL-3.0 AGPL License
11
+ * @link https://www.passbolt.com Passbolt(tm)
12
+ * @since 3.9.0
13
+ */
14
+
15
+ import SelfRegistrationDomainsViewModel from './SelfRegistrationDomainsViewModel';
16
+
17
+ describe("SelfRegistrationDomainsViewModel", () => {
18
+ describe("SelfRegistrationDomainsViewModel::construstor", () => {
19
+ it("should map allow_domains array to map", () => {
20
+ expect.assertions(2);
21
+
22
+ const domains = ["passbolt.com", "passbolt.io"];
23
+ const viewModel = new SelfRegistrationDomainsViewModel({data: {allowed_domains: domains}});
24
+ const iterators = viewModel.allowedDomains.values();
25
+ expect(iterators.next().value).toEqual("passbolt.com");
26
+ expect(iterators.next().value).toEqual("passbolt.io");
27
+ });
28
+ it("should map allow_domains array to empty array if no allowed_domains is null", () => {
29
+ expect.assertions(1);
30
+
31
+ const viewModel = new SelfRegistrationDomainsViewModel({data: {allowed_domains: null}});
32
+ expect(viewModel.allowedDomains.size).toEqual(0);
33
+ });
34
+ });
35
+ });
36
+
37
+
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Passbolt ~ Open source password manager for teams
3
+ * Copyright (c) 2022 Passbolt SA (https://www.passbolt.com)
4
+ *
5
+ * Licensed under GNU Affero General Public License version 3 of the or any later version.
6
+ * For full copyright and license information, please see the LICENSE.txt
7
+ * Redistributions of files must retain the above copyright notice.
8
+ *
9
+ * @copyright Copyright (c) 2022 Passbolt SA (https://www.passbolt.com)
10
+ * @license https://opensource.org/licenses/AGPL-3.0 AGPL License
11
+ * @link https://www.passbolt.com Passbolt(tm)
12
+ * @since 3.9.0
13
+ */
14
+
15
+ import {SelfRegistrationProviderTypes} from "./SelfRegistrationEnumeration";
16
+
17
+ /**
18
+ * Model related to the self registration dto for API
19
+ */
20
+ class SelfRegistrationDto {
21
+ /**
22
+ * Constructor
23
+ * @param {SelfRegistrationDomainsViewModel} selfRegistration
24
+ * @param {Object} settings which come from the server and should not be modify
25
+ */
26
+ constructor(selfRegistrationDomains, settings = {}) {
27
+ this.id = settings.id;
28
+ this.provider = settings.provider || SelfRegistrationProviderTypes.EMAILDOMAINS;
29
+ this.data = this.mapData(selfRegistrationDomains?.allowedDomains);
30
+ }
31
+
32
+ /**
33
+ * Map domains into string array of domains
34
+ * @param {Map} domains
35
+ */
36
+ mapData(domains = new Map()) {
37
+ return {allowed_domains: Array.from(domains.values())};
38
+ }
39
+ }
40
+
41
+ export default SelfRegistrationDto;
42
+
@@ -0,0 +1,48 @@
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.8.3
13
+ */
14
+
15
+ import SelfRegistrationDto from './SelfRegistrationDto';
16
+ import {SelfRegistrationProviderTypes} from './SelfRegistrationEnumeration';
17
+
18
+ describe("SelfRegistrationDto", () => {
19
+ describe("SelfRegistrationDto::clone", () => {
20
+ const selfRegistrationDomains = {allowedDomains: new Map()};
21
+ it("should init data with SelfRegistrationDomainsViewModel", () => {
22
+ expect.assertions(3);
23
+
24
+ selfRegistrationDomains.allowedDomains.set('uuid1', "passbolt.com");
25
+ selfRegistrationDomains.allowedDomains.set('uuid2', "passbolt.io");
26
+ const dto = new SelfRegistrationDto(selfRegistrationDomains, {id: "uuid", provider: "SSO"});
27
+
28
+ expect(dto.id).toEqual("uuid");
29
+ expect(dto.provider).toEqual("SSO");
30
+ expect(dto.data.allowed_domains).toEqual(Array.from(selfRegistrationDomains.allowedDomains.values()));
31
+ });
32
+
33
+ it("should init provider with email_domains if provider is missing", () => {
34
+ expect.assertions(1);
35
+
36
+ const dto = new SelfRegistrationDto(selfRegistrationDomains, {id: "uuid"});
37
+ expect(dto.provider).toEqual(SelfRegistrationProviderTypes.EMAILDOMAINS);
38
+ });
39
+
40
+ it("should init allowedDomains with empty array if we did not provide it", () => {
41
+ expect.assertions(1);
42
+
43
+ const dto = new SelfRegistrationDto({}, {id: "uuid"});
44
+ expect(dto.data.allowed_domains).toEqual([]);
45
+ });
46
+ });
47
+ });
48
+
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Passbolt ~ Open source password manager for teams
3
+ * Copyright (c) 2022 Passbolt SA (https://www.passbolt.com)
4
+ *
5
+ * Licensed under GNU Affero General Public License version 3 of the or any later version.
6
+ * For full copyright and license information, please see the LICENSE.txt
7
+ * Redistributions of files must retain the above copyright notice.
8
+ *
9
+ * @copyright Copyright (c) 2022 Passbolt SA (https://www.passbolt.com)
10
+ * @license https://opensource.org/licenses/AGPL-3.0 AGPL License
11
+ * @link https://www.passbolt.com Passbolt(tm)
12
+ * @since 3.9.0
13
+ */
14
+
15
+ export const SelfRegistrationProviderTypes = {
16
+ EMAILDOMAINS: 'email_domains', // Default value for provider
17
+ };
@@ -0,0 +1,34 @@
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.8.0
13
+ */
14
+ /**
15
+ * Model related to the subscription dto for API
16
+ */
17
+ class SubscriptionDto {
18
+ /**
19
+ * Constructor
20
+ * @param {SubscriptionModel} SubscriptionModel
21
+ */
22
+ constructor(subscriptionModel = {}) {
23
+ this.customer_id = subscriptionModel.customerId;
24
+ this.subscription_id = subscriptionModel.subscriptionId;
25
+ this.users = subscriptionModel.users;
26
+ this.email = subscriptionModel.email;
27
+ this.expiry = subscriptionModel.expiry;
28
+ this.created = subscriptionModel.created;
29
+ this.data = subscriptionModel.data;
30
+ }
31
+ }
32
+
33
+ export default SubscriptionDto;
34
+
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Passbolt ~ Open source password manager for teams
3
+ * Copyright (c) 2022 Passbolt SA (https://www.passbolt.com)
4
+ *
5
+ * Licensed under GNU Affero General Public License version 3 of the or any later version.
6
+ * For full copyright and license information, please see the LICENSE.txt
7
+ * Redistributions of files must retain the above copyright notice.
8
+ *
9
+ * @copyright Copyright (c) 2022 Passbolt SA (https://www.passbolt.com)
10
+ * @license https://opensource.org/licenses/AGPL-3.0 AGPL License
11
+ * @link https=//www.passbolt.com Passbolt(tm)
12
+ * @since 3.8.0
13
+ */
14
+ import SubscriptionDto from './SubscriptionDto';
15
+ import {mockSubscription, mockSubscriptionModel} from '../../../react-extension/components/Administration/DisplaySubscriptionKey/DisplaySubscriptionKey.test.data';
16
+
17
+ /**
18
+ * Test model related to the subscription dto
19
+ */
20
+ describe("SubscriptionDto model", () => {
21
+ describe("SubscriptionDto::constructor", () => {
22
+ it("should init dto with model", () => {
23
+ expect.assertions(1);
24
+ const dto = new SubscriptionDto(mockSubscriptionModel);
25
+ expect(dto).toEqual(mockSubscription);
26
+ });
27
+ });
28
+ });
29
+
30
+
31
+