passbolt-browser-extension 5.7.0 → 5.8.0

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 (74) hide show
  1. package/CHANGELOG.md +75 -1
  2. package/RELEASE_NOTES.md +84 -54
  3. package/eslint.config.mjs +213 -135
  4. package/package.json +8 -7
  5. package/src/all/background_page/controller/import/importResourcesFileController.test.js +31 -0
  6. package/src/all/background_page/controller/rbac/{findMeController.js → findRbacMeController.js} +4 -6
  7. package/src/all/background_page/controller/rbac/{findMeController.test.js → findRbacMeController.test.js} +4 -4
  8. package/src/all/background_page/controller/role/findAllRoleControler.js +51 -0
  9. package/src/all/background_page/controller/role/findAllRoleControler.test.js +53 -0
  10. package/src/all/background_page/controller/role/rolesUpdateLocalStorageController.js +51 -0
  11. package/src/all/background_page/controller/role/rolesUpdateLocalStorageController.test.js +94 -0
  12. package/src/all/background_page/event/appEvents.js +2 -2
  13. package/src/all/background_page/event/quickAccessEvents.js +2 -2
  14. package/src/all/background_page/event/roleEvents.js +18 -9
  15. package/src/all/background_page/model/entity/account/accountEntity.test.js +2 -1
  16. package/src/all/background_page/model/entity/theme/themeEntity.test.js +26 -0
  17. package/src/all/background_page/model/import/resources/kdbx/kdbx-expiry.kdbx +0 -0
  18. package/src/all/background_page/model/import/resources/kdbx/kdbx-never-expiry.kdbx +0 -0
  19. package/src/all/background_page/model/theme/themeModel.test.js +73 -0
  20. package/src/all/background_page/service/api/accountSettings/accountSettingsService.js +0 -12
  21. package/src/all/background_page/service/api/accountSettings/accountSettingsService.test.data.js +35 -0
  22. package/src/all/background_page/service/api/accountSettings/accountSettingsService.test.js +65 -0
  23. package/src/all/background_page/service/local_storage/rolesLocalStorage.js +2 -2
  24. package/src/all/background_page/service/rbac/findAndUpdateRbacsLocalStorageService.js +58 -0
  25. package/src/all/background_page/service/rbac/findRbacService.js +37 -0
  26. package/src/all/background_page/service/rbac/findRbacService.test.js +61 -0
  27. package/src/all/background_page/service/rbac/getOrFindRbacService.js +44 -0
  28. package/src/all/background_page/service/resource/import/ImportResourcesService.js +25 -7
  29. package/src/all/background_page/service/role/findAndUpdateRolesLocalStorageService.js +57 -0
  30. package/src/all/background_page/service/role/findAndUpdateRolesLocalStorageService.test.js +70 -0
  31. package/src/all/background_page/service/role/findRolesService.js +45 -0
  32. package/src/all/background_page/service/role/findRolesService.test.js +105 -0
  33. package/src/all/background_page/service/role/getOrFindRolesService.js +50 -0
  34. package/src/all/background_page/service/role/getOrFindRolesService.test.js +64 -0
  35. package/src/all/contentScripts/js/app/AccountRecovery.js +2 -0
  36. package/src/all/contentScripts/js/app/App.js +3 -0
  37. package/src/all/contentScripts/js/app/Login.js +4 -0
  38. package/src/all/contentScripts/js/app/Recover.js +4 -0
  39. package/src/all/contentScripts/js/app/Setup.js +3 -0
  40. package/src/all/locales/cs-CZ/common.json +13 -12
  41. package/src/all/locales/de-DE/common.json +13 -12
  42. package/src/all/locales/es-ES/common.json +1 -0
  43. package/src/all/locales/fr-FR/common.json +20 -19
  44. package/src/all/locales/it-IT/common.json +24 -23
  45. package/src/all/locales/ja-JP/common.json +24 -23
  46. package/src/all/locales/ko-KR/common.json +1 -0
  47. package/src/all/locales/lt-LT/common.json +24 -23
  48. package/src/all/locales/nl-NL/common.json +24 -23
  49. package/src/all/locales/pl-PL/common.json +14 -13
  50. package/src/all/locales/pt-BR/common.json +23 -22
  51. package/src/all/locales/ro-RO/common.json +24 -23
  52. package/src/all/locales/ru-RU/common.json +24 -23
  53. package/src/all/locales/sl-SI/common.json +19 -18
  54. package/src/all/locales/sv-SE/common.json +27 -26
  55. package/src/all/locales/uk-UA/common.json +19 -18
  56. package/src/all/webAccessibleResources/js/app/AccountRecovery.js +3 -0
  57. package/src/all/webAccessibleResources/js/app/App.js +3 -0
  58. package/src/all/webAccessibleResources/js/app/InFormCallToAction.js +3 -0
  59. package/src/all/webAccessibleResources/js/app/InFormMenu.js +2 -0
  60. package/src/all/webAccessibleResources/js/app/Login.js +3 -0
  61. package/src/all/webAccessibleResources/js/app/QuickAccess.js +3 -1
  62. package/src/all/webAccessibleResources/js/app/Recover.js +3 -0
  63. package/src/all/webAccessibleResources/js/app/Setup.js +3 -0
  64. package/src/chrome/manifest.json +1 -1
  65. package/src/chrome-mv3/manifest.json +1 -1
  66. package/src/chrome-mv3/serviceWorker/service/network/requestFetchOffscreenService.test.js +0 -1
  67. package/src/firefox/manifest.json +1 -1
  68. package/src/safari/manifest.json +1 -1
  69. package/.eslintrc.json +0 -231
  70. package/src/all/background_page/model/rbac/RbacModel.js +0 -75
  71. package/src/all/background_page/model/role/roleModel.js +0 -56
  72. package/src/all/background_page/service/api/role/roleService.js +0 -54
  73. /package/.github/{ISSUE_TEMPLATE.md → ISSUE_TEMPLATE/bug_report.md} +0 -0
  74. /package/.github/{PULL_REQUEST_TEMPLATE.md → PULL_REQUEST_TEMPLATE/pull_request_template.md} +0 -0
package/CHANGELOG.md CHANGED
@@ -4,6 +4,79 @@ This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [5.8.0] - 2025-12-16
8
+ ### Added
9
+ - PB-46646 Reduce accidental destructive actions by moving Delete user and Disable MFA into a More menu in Users and groups
10
+ - PB-28298 Add users to groups by dragging and dropping
11
+ - PB-47198 Add exception to allow users to autofill workbench.cisecurity.org
12
+ - PB-46997 DR - WP1.1 Update RbacsCollection to EntityV2Collection and add new methods
13
+ - PB-46999 DR - WP1.2 Update RoleEntity schema and add new methods
14
+ - PB-47000 DR - WP1.3 Update RolesCollection to EntityV2Collection and add new methods
15
+ - PB-47002 DR - WP2.1 Update of RoleService to a RoleApiService
16
+ - PB-47003 DR - WP2.2 Update of RoleModel to a RoleService
17
+ - PB-47003 DR - WP2.3 Update of RbacService to a RbacApiService
18
+ - PB-47014 DR - WP2.4 Update of RbacModel to a RbacService
19
+ - PB-47015 DR - WP3.1 Create the FindAllRolesController and update the event
20
+ - PB-47015 DR - WP3.1 Create the FindAllRolesController and update the event
21
+ - PB-47017 DR - WP3.2 Update the FindMeController into a FindMeRbacController
22
+ - PB-47088 DR - WP3.3 Create the FindAndUpdateRolesLocalStorageController
23
+ - PB-47018 DR - WP4.1 Create RoleServiceWorkerService to get the roles
24
+ - PB-47019 DR - WP4.2 Create RbacServiceWorkerService to get the RBAC permissions of a signed-in user
25
+ - PB-47021 DR - WP4.3 Add the method canRoleUseAction in CanUseService
26
+ - PB-47089 DR - WP4.4 Add a method to find and update roles in local storage
27
+ - PB-47022 DR - WP5.1 Add the method canIUseAction in RbacContext
28
+ - PB-47023 DR - WP5.2 Verify the signed-in user's RBAC privileges before allowing access to the FilterUsersByGroup functionality
29
+ - PB-47024 DR - WP5.3 Verify the signed-in user's RBAC privileges before allowing access to the DisplayUserWorkspaceMainActions functionality
30
+
31
+ - PB-47023 DR - WP5.4 Verify the signed-in user's RBAC privileges before allowing access to the DisplayUserWorkspaceActions functionality
32
+ - PB-47036 DR - WP5.5 Verify the signed-in user's RBAC privileges before allowing access to the DisplayUsersWorkspaceFilterBar functionality
33
+ - PB-47037 DR - WP5.6 Verify the signed-in user's RBAC privileges before allowing access to the DisplayUsers functionality
34
+ - PB-47039 DR - WP5.7 Update CreateUser to select role in a dropdown component
35
+ - PB-47042 DR - WP5.8 Update EditUser to select role in a dropdown component
36
+ - PB-47027 DR - WP5.9 Create the component CreateRoleDialog
37
+ - PB-47028 DR - WP5.10 Create the component EditRoleDialog
38
+ - PB-47029 DR - WP5.11 Create the component DeleteRoleDialog
39
+ - PB-47030 DR - WP5.12 Update the style of DisplayRbacAdministration to match current design
40
+ - PB-47031 DR - WP5.13 Add create role in DisplayRbacAdministration
41
+ - PB-47032 DR - WP5.14 Display all roles in DisplayRbacAdministration
42
+ - PB-47033 DR - WP5.15 Add menu item to update the name of new role
43
+ - PB-47016 DR - WP5.16 Add menu item to delete new role
44
+ - PB-47090 DR - WP5.17 Update ManageAccountRecoveryUserSettings to use roles from context
45
+ - PB-47091 DR - WP5.18 Update ReviewAccountRecoveryRequest to use roles from context
46
+ - PB-47092 DR - WP5.19 Update DisplayScimSettingsAdministration to use roles from context
47
+ - PB-47093 DR - WP5.20 Update DisplayUserDetailsInformation to use roles from context
48
+ - PB-47094 DR - WP5.21 Update DisplayAccountRecoveryUserSettings to use roles from context
49
+ - PB-47095 DR - WP5.22 Update UserWorkspaceContext to use roles from context
50
+ - PB-47096 DR - WP5.23 Create the RoleContextProvider and add it on ExtAppContext
51
+ - PB-47214 DR - WP5.24 Update the RoleEntity to avoid name bypass
52
+ - PB-47215 DR - WP5.25 Update RolesCollection to filter out Guest role
53
+ - PB-47216 DR - WP5.26 Update FindRolesService to filter out guest role
54
+ - PB-47231 DR - WP5.27 Create component DeleteRoleNotAllowed
55
+
56
+ ### Fixed
57
+ - PB-46180 Incorrect folder name encoding in sharing progress dialog
58
+ - PB-46612 Add missing border radius to secret history selected revision
59
+ - PB-45978 Resize bar continues dragging after mouse release
60
+ - PB-46905 Display the "Remove from group" action button to group managers
61
+ - PB-46627 Fix missing space in the “Advanced settings” of the password generator tabs between the last component and the CTA
62
+ - PB-46930 Secret history review should display an unknown user when creator does not exists
63
+ - PB-47298 KDBX not set expiry if never is set
64
+
65
+ ### Maintenance
66
+ - PB-46636 Remove eslint v8 compatibility
67
+ - PB-46890 Small upgrade for js-yaml (Medium)
68
+ - PB-46831 Increase coverage of passbolt-styleguide DisplayUserTheme to 100%, and verify no change occurs when the user selects the already-selected theme
69
+ - PB-29338 React 18: upgrade changes with Legacy DOM renderer
70
+ - PB-47057 React 18: Remove unused dev dependency jest-dom
71
+ - PB-47069 DisplayResourceDetailsInformation Test Cases for Expired Passwords
72
+ - PB-46831 Increase coverage of passbolt-styleguide DisplayUserTheme to 100%
73
+ - PB-47069 DisplayResourceDetailsInformation Test Cases for Expired Passwords
74
+ - PB-47311 Major upgrade for serialize-javascript (Medium)
75
+ - PB-46832 Increase coverage of ThemeEntity
76
+ - PB-46833 Increase coverage of AccountSettingsService
77
+ - PB-46834 Increase coverage of ThemeModel
78
+ - PB-47011 ESLINT - WP1.1 Install phantom dependencies
79
+
7
80
  ## [5.7.0] - 2025-11-12
8
81
  ### Added
9
82
  - PB-17712 Focus should be put in the passphrase field when importing keepass file protected by passphrase
@@ -2491,7 +2564,8 @@ self registration settings option in the left-side bar
2491
2564
  - AP: User with plugin installed
2492
2565
  - LU: Logged in user
2493
2566
 
2494
- [Unreleased]: https://github.com/passbolt/passbolt_browser_extension/compare/v5.7.0...HEAD
2567
+ [Unreleased]: https://github.com/passbolt/passbolt_browser_extension/compare/v5.8.0...HEAD
2568
+ [5.8.0]: https://github.com/passbolt/passbolt_browser_extension/compare/v5.7.0...5.8.0
2495
2569
  [5.7.0]: https://github.com/passbolt/passbolt_browser_extension/compare/v5.6.0...5.7.0
2496
2570
  [5.6.0]: https://github.com/passbolt/passbolt_browser_extension/compare/v5.5.1...v5.6.0
2497
2571
  [5.5.1]: https://github.com/passbolt/passbolt_browser_extension/compare/v5.5.0...v5.5.1
package/RELEASE_NOTES.md CHANGED
@@ -1,72 +1,102 @@
1
- Release song: https://www.youtube.com/watch?v=fMnh5Tn8aeM
1
+ Release song: https://www.youtube.com/watch?v=F5uXomY94w8
2
2
 
3
- Passbolt 5.7.0 introduces secret history, a highly demanded feature that gives users visibility and control over previous versions of their secrets. This release also includes several usability improvements requested and bug fixes reported by the community.
3
+ Passbolt 5.8.0 introduces dynamic role management, allowing organizations to define additional roles that better align with internal policies, compliance requirements, and operational needs. This release also adds drag & drop user assignment to groups, simplifying day-to-day user and group management.
4
4
 
5
- ## Secret history
5
+ **Warning**: Ensure that all users have updated their browser extension to at least version 5.8 before assigning new roles. Otherwise, they will not be able to connect to Passbolt.
6
6
 
7
- It is now possible to access previous revisions of a secret directly from Passbolt.
7
+ ## Dynamic role management
8
8
 
9
- Secret history helps reduce the impact of human error and offers a safer way to manage evolving secrets. For instance, this enables users to undo an accidental update on the spot. Note that the feature is disabled by default and requires an administrator to enable it from the administration workspace.
9
+ As was already the case with the default User role, Passbolt allows administrators to restrict what users can do by limiting access to specific capabilities. With version 5.8, this model is extended beyond the default Admin and User roles, making it possible to create additional roles and assign them to users for more granular control.Default roles cannot be modified or deleted, while newly created roles (up to two per instance) can copy permissions from existing roles and can be renamed or deleted.
10
10
 
11
- ## User and group workspace improvements
11
+ Dynamic roles also enable the delegation of administrative responsibilities. Rather than granting full administrative access, administrators can now assign selected capabilities to custom roles and distribute operational tasks across multiple users. Initial support covers group creation, as well as handling account recovery requests in Passbolt Pro.
12
12
 
13
- A new “Remove from group” action has been added to the user and group workspaces. This addition eliminates the confusion between permanently deleting a user and simply removing them from a specific group.
13
+ At this stage, dynamic role management comes with a defined scope and set of constraints.
14
14
 
15
- Moreover, administrators can now instantly filter users that require attention via the “Attention Required” filter in the workspace. For instance: identifying users with a pending account recovery request to review, or missing metadata keys.
15
+ - The default Admin and User roles keep fixed names and cannot be renamed or deleted.
16
+ - As before, the User role can be restricted, but it cannot be assigned delegated administrative responsibilities.
17
+ - The Admin role, by contrast, always retains access to all capabilities and cannot be restricted.
18
+ - Custom roles are currently limited to two per instance and support a first set of administrative capabilities.
16
19
 
17
- ## Import report
20
+ This scope will be expanded progressively as additional needs and use cases are identified by the community.
18
21
 
19
- The application now displays a summary dialog after an import, offering accurate and actionable information. The report precisely categorises alerts into successes, warnings and errors, providing end users with additional logs.
22
+ ## Drag & drop users to groups
23
+
24
+ Managing group membership often requires repetitive actions when working with large teams or frequently changing group structures. With Passbolt 5.8, administrators can now add users to a group by dragging them directly onto it from the Users & Groups workspace. This removes the need to open and edit each group individually and makes day-to-day group management faster and more fluid.
20
25
 
21
26
  ## Miscellaneous improvements
22
- As usual this release is packed with improvements and bug fixes reported by the community. Notably, the reliability of autofill has been improved across a wider range of websites. If you find that autofill does not work on a particular website, feel free to open a bug report including the website details to help us identify the custom selector. For more, check out the changelog below.
23
27
 
24
- Many thanks to everyone who provided feedback, reported issues, and helped refine these new features.
28
+ As usual, this release includes fixes and smaller improvements intended to improve the overall experience. For the full list of changes, please refer to the changelog.
29
+
30
+ Many thanks to everyone who provided feedback and helped refine these features.
25
31
 
26
32
  ### Added
27
- - PB-17712 Focus should be put in the passphrase field when importing keepass file protected by passphrase
28
- - PB-33599 Allow users to access previous revisions of a resource’s secret
29
- - PB-33599 Allow administrators to configure how many secret revisions are retained
30
- - PB-44420 Allow administrators to download the Users Directory sync report for follow-up actions
31
- - PB-44434 As an administrator I can see encrypted metadata healthchecks from the administration workspace
32
- - PB-45249 Add “Attention required” filter in the “Users & groups” workspace to filter users by attention required
33
- - PB-45842 Add link to SCIM admin guide in the product
34
- - PB-46427 Add remove from group button in User & Group Workspace page
33
+ - PB-46646 Reduce accidental destructive actions by moving Delete user and Disable MFA into a More menu in Users and groups
34
+ - PB-28298 Add users to groups by dragging and dropping
35
+ - PB-47198 Add exception to allow users to autofill workbench.cisecurity.org
36
+ - PB-46997 DR - WP1.1 Update RbacsCollection to EntityV2Collection and add new methods
37
+ - PB-46999 DR - WP1.2 Update RoleEntity schema and add new methods
38
+ - PB-47000 DR - WP1.3 Update RolesCollection to EntityV2Collection and add new methods
39
+ - PB-47002 DR - WP2.1 Update of RoleService to a RoleApiService
40
+ - PB-47003 DR - WP2.2 Update of RoleModel to a RoleService
41
+ - PB-47003 DR - WP2.3 Update of RbacService to a RbacApiService
42
+ - PB-47014 DR - WP2.4 Update of RbacModel to a RbacService
43
+ - PB-47015 DR - WP3.1 Create the FindAllRolesController and update the event
44
+ - PB-47015 DR - WP3.1 Create the FindAllRolesController and update the event
45
+ - PB-47017 DR - WP3.2 Update the FindMeController into a FindMeRbacController
46
+ - PB-47088 DR - WP3.3 Create the FindAndUpdateRolesLocalStorageController
47
+ - PB-47018 DR - WP4.1 Create RoleServiceWorkerService to get the roles
48
+ - PB-47019 DR - WP4.2 Create RbacServiceWorkerService to get the RBAC permissions of a signed-in user
49
+ - PB-47021 DR - WP4.3 Add the method canRoleUseAction in CanUseService
50
+ - PB-47089 DR - WP4.4 Add a method to find and update roles in local storage
51
+ - PB-47022 DR - WP5.1 Add the method canIUseAction in RbacContext
52
+ - PB-47023 DR - WP5.2 Verify the signed-in user's RBAC privileges before allowing access to the FilterUsersByGroup functionality
53
+ - PB-47024 DR - WP5.3 Verify the signed-in user's RBAC privileges before allowing access to the DisplayUserWorkspaceMainActions functionality
54
+
55
+ - PB-47023 DR - WP5.4 Verify the signed-in user's RBAC privileges before allowing access to the DisplayUserWorkspaceActions functionality
56
+ - PB-47036 DR - WP5.5 Verify the signed-in user's RBAC privileges before allowing access to the DisplayUsersWorkspaceFilterBar functionality
57
+ - PB-47037 DR - WP5.6 Verify the signed-in user's RBAC privileges before allowing access to the DisplayUsers functionality
58
+ - PB-47039 DR - WP5.7 Update CreateUser to select role in a dropdown component
59
+ - PB-47042 DR - WP5.8 Update EditUser to select role in a dropdown component
60
+ - PB-47027 DR - WP5.9 Create the component CreateRoleDialog
61
+ - PB-47028 DR - WP5.10 Create the component EditRoleDialog
62
+ - PB-47029 DR - WP5.11 Create the component DeleteRoleDialog
63
+ - PB-47030 DR - WP5.12 Update the style of DisplayRbacAdministration to match current design
64
+ - PB-47031 DR - WP5.13 Add create role in DisplayRbacAdministration
65
+ - PB-47032 DR - WP5.14 Display all roles in DisplayRbacAdministration
66
+ - PB-47033 DR - WP5.15 Add menu item to update the name of new role
67
+ - PB-47016 DR - WP5.16 Add menu item to delete new role
68
+ - PB-47090 DR - WP5.17 Update ManageAccountRecoveryUserSettings to use roles from context
69
+ - PB-47091 DR - WP5.18 Update ReviewAccountRecoveryRequest to use roles from context
70
+ - PB-47092 DR - WP5.19 Update DisplayScimSettingsAdministration to use roles from context
71
+ - PB-47093 DR - WP5.20 Update DisplayUserDetailsInformation to use roles from context
72
+ - PB-47094 DR - WP5.21 Update DisplayAccountRecoveryUserSettings to use roles from context
73
+ - PB-47095 DR - WP5.22 Update UserWorkspaceContext to use roles from context
74
+ - PB-47096 DR - WP5.23 Create the RoleContextProvider and add it on ExtAppContext
75
+ - PB-47214 DR - WP5.24 Update the RoleEntity to avoid name bypass
76
+ - PB-47215 DR - WP5.25 Update RolesCollection to filter out Guest role
77
+ - PB-47216 DR - WP5.26 Update FindRolesService to filter out guest role
78
+ - PB-47231 DR - WP5.27 Create component DeleteRoleNotAllowed
35
79
 
36
80
  ### Fixed
37
- - PB-18497 Add loading spinner when submitting imported GPG key during account extension association (activation/recover)
38
- - PB-36183 Display UTC date in tooltip for relative “X days ago” timestamps
39
- - PB-42032 Fix: update passphrase help section link goes to the former help site
40
- - PB-43950 Add padding between fields and their description on the Users Directory administration page
41
- - PB-44603 Help link in administration internationalization page should target the contribute page of the help site
42
- - PB-44949 GITHUB#240 Inform menu crash on suggested resource icon
43
- - PB-45263 Enforce password expiry on imported resources when a password policy requires it
44
- - PB-45588 Extend metadata description textarea in resource creation dialog to use full available height
45
- - PB-45699 User without groups is not display correctly on the right sidebar
46
- - PB-45723 The in-form CTA is not visible since v5.5 for some web application
47
- - PB-45797 Fix typos in BExt
48
- - PB-45917 I can autofill my username in the login form of cryptpad in French
49
- - PB-45992 Keep selection of resources when collapsing the Workspace section
50
- - PB-46013 Empty Full Report textarea displayed in Users Directory dialogs when there are no resources to synchronize
51
- - PB-46065 Prevent re-encryption of metadata with personal user key when a resource is shared with a group
52
- - PB-46118 Import unexpected error handling on import
53
- - PB-46191 Update UserSettings validateDomain to make sure the issue cannot be exploited
54
- - PB-46372 As LU, I should see the content share dialog within the boundaries of the dialog
55
- - PB-46385 Fix auto-fill on OVH with custom selector field on username
81
+ - PB-46180 Incorrect folder name encoding in sharing progress dialog
82
+ - PB-46612 Add missing border radius to secret history selected revision
83
+ - PB-45978 Resize bar continues dragging after mouse release
84
+ - PB-46905 Display the "Remove from group" action button to group managers
85
+ - PB-46627 Fix missing space in the “Advanced settings” of the password generator tabs between the last component and the CTA
86
+ - PB-46930 Secret history review should display an unknown user when creator does not exists
87
+ - PB-47298 KDBX not set expiry if never is set
56
88
 
57
89
  ### Maintenance
58
- - PB-30373 Remove unused event passbolt.app-bootstrap.navigate-to-logout
59
- - PB-45099 Update: Regular expression on private key metadata validation
60
- - PB-45100 Update: Regular expression on GPG Message validation
61
- - PB-45585 Fix SCIM styleguide related unit tests error
62
- - PB-45589 Refactor resource favorite capability to use FavoriteServiceWorkerService instead of direct port requests
63
- - PB-45590 Migrate favorite logic from FavoriteModel to FavoriteResourceService and remove legacy model
64
- - PB-45591 Route passbolt.favorite.add/delete events through controllers instead of calling services directly
65
- - PB-45593 Add test coverage for FavoriteService API and rename class to align with Passbolt standard
66
- - PB-45678 Upgrade ESLint dependencies across both repositories
67
- - PB-45835 Migrate group (partially) related code to new architecture
68
- - PB-45894 Rename leftSideBar and rightSideBar classes to respect naming convention
69
- - PB-45963 Replace find-all with find-my-groups Port Requests
70
- - PB-45965 Rename groupService to groupApiService
71
- - PB-46127 Update i18next dependency
72
- - PB-46190 Update themeEntity to remove preview unused field
90
+ - PB-46636 Remove eslint v8 compatibility
91
+ - PB-46890 Small upgrade for js-yaml (Medium)
92
+ - PB-46831 Increase coverage of passbolt-styleguide DisplayUserTheme to 100%, and verify no change occurs when the user selects the already-selected theme
93
+ - PB-29338 React 18: upgrade changes with Legacy DOM renderer
94
+ - PB-47057 React 18: Remove unused dev dependency jest-dom
95
+ - PB-47069 DisplayResourceDetailsInformation Test Cases for Expired Passwords
96
+ - PB-46831 Increase coverage of passbolt-styleguide DisplayUserTheme to 100%
97
+ - PB-47069 DisplayResourceDetailsInformation Test Cases for Expired Passwords
98
+ - PB-47311 Major upgrade for serialize-javascript (Medium)
99
+ - PB-46832 Increase coverage of ThemeEntity
100
+ - PB-46833 Increase coverage of AccountSettingsService
101
+ - PB-46834 Increase coverage of ThemeModel
102
+ - PB-47011 ESLINT - WP1.1 Install phantom dependencies
package/eslint.config.mjs CHANGED
@@ -1,146 +1,224 @@
1
- import {defineConfig} from "eslint/config";
2
- import jest from "eslint-plugin-jest";
3
- import noUnsanitized from "eslint-plugin-no-unsanitized";
4
- import globals from "globals";
5
- import babelParser from "@babel/eslint-parser";
6
- import path from "node:path";
7
- import {fileURLToPath} from "node:url";
8
- import js from "@eslint/js";
9
- import {FlatCompat} from "@eslint/eslintrc";
10
-
11
- const __filename = fileURLToPath(import.meta.url);
12
- const __dirname = path.dirname(__filename);
13
- const compat = new FlatCompat({
14
- baseDirectory: __dirname,
15
- recommendedConfig: js.configs.recommended,
16
- allConfig: js.configs.all
17
- });
18
-
19
- export default defineConfig([{
20
- extends: compat.extends("eslint:recommended", "plugin:react/recommended"),
21
-
22
- plugins: {
23
- jest,
24
- "no-unsanitized": noUnsanitized
25
- },
26
-
27
- languageOptions: {
28
- globals: {
29
- ...globals.browser,
30
- ...globals.amd,
31
- ...globals.webextensions,
32
- ...globals.jest,
33
- ...globals.node,
34
- global: true,
35
- port: true,
36
- Validator: true,
37
- openpgp: true,
38
- PapaParse: true,
39
- kdbxweb: true,
40
- storage: true,
41
- jsSHA: true,
42
- XRegExp: true,
43
- stripslashes: true,
44
- urldecode: true,
45
- OpenpgpkeyEntity: true,
46
- },
1
+ import globals from 'globals';
2
+ import babelParser from '@babel/eslint-parser';
3
+ import path from 'path';
4
+ import {fileURLToPath} from 'url';
5
+
6
+ // ESLint plugins import
7
+ import js from '@eslint/js';
8
+ import noUnsanitizedPlugin from 'eslint-plugin-no-unsanitized';
9
+ import jestPlugin from 'eslint-plugin-jest';
10
+ import reactPlugin from 'eslint-plugin-react';
11
+ import importPlugin from 'eslint-plugin-import';
12
+
13
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
14
+
15
+ export default [
16
+ js.configs.recommended, // core JavaScript rules
17
+ reactPlugin.configs.flat.recommended, // React best practices
18
+ reactPlugin.configs.flat['jsx-runtime'], // JSX transform rules
19
+ importPlugin.flatConfigs.recommended, // import/export validations
20
+ {
21
+ files: ['**/*.{js,jsx,mjs,cjs}'],
22
+
23
+ languageOptions: {
24
+ parser: babelParser,
25
+ ecmaVersion: 2024,
26
+ sourceType: 'module',
27
+
28
+ parserOptions: {
29
+ requireConfigFile: false,
30
+ ecmaFeatures: {
31
+ jsx: true,
32
+ },
33
+ babelOptions: {
34
+ presets: ['@babel/preset-react'],
35
+ },
36
+ },
47
37
 
48
- parser: babelParser,
49
- ecmaVersion: 2018,
50
- sourceType: "module",
38
+ globals: {
39
+ ...globals.browser,
40
+ ...globals.node,
41
+ ...globals.es2024,
42
+ ...globals.webextensions,
51
43
 
52
- parserOptions: {
53
- requireConfigFile: false,
44
+ // Custom globals
45
+ global: 'readonly',
46
+ port: 'readonly',
47
+ },
48
+ }, plugins: {
49
+ 'no-unsanitized': noUnsanitizedPlugin,
50
+ },
54
51
 
55
- babelOptions: {
56
- presets: ["@babel/preset-react"],
52
+ settings: {
53
+ react: {
54
+ version: 'detect',
57
55
  },
56
+ 'import/resolver': {
57
+ node: {
58
+ paths: [__dirname], // Add project root to resolution paths
59
+ extensions: ['.js', '.jsx', '.mjs', '.cjs'],
60
+ },
61
+ alias: {
62
+ map: [
63
+ ['passbolt-styleguide', path.resolve(__dirname)],
64
+ ],
65
+ extensions: ['.js', '.jsx', '.ts', '.tsx'],
66
+ },
67
+ },
68
+ },
69
+
70
+ rules: {
71
+ /*
72
+ * ============================================
73
+ * CUSTOM OVERRIDES
74
+ * ============================================
75
+ */
76
+
77
+ "array-bracket-spacing": 1, // Enforces consistent spacing inside array brackets
78
+ "block-spacing": 1, // Enforces consistent spacing inside single-line blocks
79
+ "brace-style": ["warn", "1tbs", {allowSingleLine: true}], // Enforces one true brace style (opening brace on same line)
80
+ "comma-spacing": 1, // Enforces consistent spacing before/after commas
81
+ "computed-property-spacing": 1, // Enforces consistent spacing inside computed property brackets
82
+ "eol-last": 1, // Requires newline at the end of files
83
+ "func-call-spacing": 1, // Disallows spaces between function name and parentheses in calls
84
+ "key-spacing": ["warn", {mode: "minimum"}], // Enforces minimum spacing between keys and values in object literals
85
+ "keyword-spacing": 1, // Enforces consistent spacing before/after keywords (if, else, for, etc.)
86
+ "linebreak-style": 1, // Enforces consistent linebreak style (unix vs windows)
87
+ "no-trailing-spaces": 1, // Disallows trailing whitespace at the end of lines
88
+ "object-curly-spacing": ["warn", "never"], // Disallows spaces inside object curly braces
89
+ "one-var": ["error", {initialized: "never", uninitialized: "always"}], // Enforces variables declaration style (one declaration for uninitialized, separate for initialized)
90
+ "padded-blocks": ["warn", "never"], // Disallows padding blank lines within blocks
91
+ "semi": ["warn", "always"], // Requires semicolons at the end of statements
92
+ "semi-spacing": 1, // Enforces spacing before/after semicolons
93
+ "space-before-blocks": 1, // Requires space before opening brace of blocks
94
+ "space-before-function-paren": ["warn", "never"], // Disallows space before function parentheses
95
+ "space-in-parens": ["warn", "never"], // Disallows spaces inside parentheses
96
+ "space-infix-ops": 1, // Requires spaces around infix operators (+, -, =, etc.)
97
+ "arrow-body-style": ["warn", "as-needed"], // Requires braces around arrow function body only when needed
98
+ "arrow-parens": ["warn", "as-needed"], // Requires parens around arrow function parameters only when needed
99
+ "arrow-spacing": 1, // Enforces consistent spacing before/after arrow function arrows
100
+ "template-curly-spacing": ["warn", "never"], // Disallows spaces inside template literal curly braces
101
+ "multiline-comment-style": ["error", "starred-block"], // Enforces starred-block style for multiline comments (/* * */)
102
+ "indent": ["warn", 2, {MemberExpression: 1, SwitchCase: 1}], // Enforces 2 spaces indentation with specific rules for member expressions and switch cases
103
+ // "object-shorthand": ["error", "consistent"],
104
+
105
+
106
+ // Critical rules not in recommended configs
107
+ 'curly': 'error', // Always use braces
108
+ 'no-implicit-coercion': 'error', // No implicit type coercion
109
+ 'no-implicit-globals': 'error', // No implicit global variables
110
+ 'no-unsanitized/method': 'error', // Prevent XSS via innerHTML
111
+ 'no-unsanitized/property': 'error', // Prevent XSS via outerHTML
112
+
113
+ // Our specific preferences (override recommended)
114
+ 'no-console': 'off', // Allow console.log in dev
115
+ 'react/display-name': 'off', // Don't require display names
116
+ 'react/prop-types': 'off', // Skip PropTypes (future TypeScript)
117
+ 'no-useless-escape': 'off', // Too many false positives
118
+ "func-names": [
119
+ "error",
120
+ "never"
121
+ ],
122
+
123
+ // Phantom dependency detection (CRITICAL)
124
+ 'import/no-extraneous-dependencies': ['error', {
125
+ devDependencies: [
126
+ '**/*.test.{js,jsx}',
127
+ '**/*.spec.{js,jsx}',
128
+ '**/__tests__/**',
129
+ '**/test/**',
130
+ '**/tests/**',
131
+ '**/scripts/**',
132
+ '*.config.{js,mjs,cjs}',
133
+ 'webpack.config.js',
134
+ ],
135
+ optionalDependencies: false,
136
+ peerDependencies: true,
137
+ }],
138
+
139
+ // Browser extension specific
140
+ 'n/no-unsupported-features/node-builtins': 'off', // We use browser APIs
141
+ 'n/no-missing-import': 'off', // Handled by import plugin
142
+ 'n/no-missing-require': 'off', // Handled by import plugin
143
+
144
+ // Muted during migration
145
+ 'import/no-named-as-default-member': 'off',
146
+ 'import/no-duplicates': 'off',
147
+ 'import/named': 'off',
148
+ 'import/no-named-as-default': 'off',
149
+ 'no-empty': 'off',
150
+ 'react/jsx-uses-react': 'error', // Marks React as used when JSX is present
151
+ 'react/jsx-uses-vars': 'error', // Marks JSX components as used
152
+ 'react/react-in-jsx-scope': 'error', // Ensures React is in scope for JSX
58
153
  },
59
154
  },
155
+ /*
156
+ * ============================================
157
+ * TEST FILES CONFIGURATION
158
+ * ============================================
159
+ */
160
+ {
161
+ files: [
162
+ '**/*.test.{js,jsx}',
163
+ '**/*.test.data.{js,jsx}',
164
+ '**/*.test.page.{js,jsx}',
165
+ '**/*.test.page.object.{js,jsx}',
166
+ '**/*.test.stories.{js,jsx}',
167
+ '**/*.spec.{js,jsx}',
168
+ '**/__tests__/**',
169
+ '**/test/mock/**',
170
+ ],
171
+
172
+ languageOptions: {
173
+ globals: {
174
+ ...globals.jest,
175
+ },
176
+ },
177
+
178
+ plugins: {
179
+ jest: jestPlugin,
180
+ },
60
181
 
61
- settings: {
62
- react: {
63
- version: "detect",
182
+ rules: {
183
+ ...jestPlugin.configs['flat/recommended'].rules,
184
+
185
+ // Test-specific overrides
186
+ 'no-console': 'off', // Allow console in tests
187
+ 'import/no-extraneous-dependencies': 'off', // Dev deps OK in tests
188
+ 'jest/prefer-expect-assertions': 'off', // Not always needed
189
+
190
+ // Rules muted during migration
191
+ 'jest/no-conditional-expect': 'off',
192
+ 'jest/valid-title': 'off',
193
+ 'jest/no-alias-methods': 'off',
194
+ 'jest/no-export': 'off',
195
+ 'jest/valid-expect': 'off',
196
+ 'jest/no-identical-title': 'off',
197
+ 'jest/expect-expect': 'off',
198
+ 'jest/valid-expect-in-promise': 'off',
199
+ 'jest/no-disabled-tests': 'off',
200
+ 'jest/valid-describe-callback': 'off',
201
+ 'jest/no-focused-tests': 'off',
202
+ 'jest/no-standalone-expect': 'off'
64
203
  },
65
204
  },
205
+ /*
206
+ * ============================================
207
+ * BUILD/CONFIG FILES
208
+ * ============================================
209
+ */
210
+ {
211
+ files: ['*.config.{js,mjs,cjs}', 'scripts/**/*.js', 'webpack.config.js'],
212
+
213
+ languageOptions: {
214
+ globals: {
215
+ ...globals.node,
216
+ },
217
+ },
66
218
 
67
- rules: {
68
- strict: ["error", "never"],
69
- "no-console": 0,
70
-
71
- "no-empty": ["error", {
72
- allowEmptyCatch: true,
73
- }],
74
-
75
- curly: 2,
76
- "no-eval": 2,
77
-
78
- "no-extend-native": ["error", {
79
- exceptions: ["Error"],
80
- }],
81
-
82
- "no-global-assign": 2,
83
- "no-implicit-coercion": 2,
84
- "no-implicit-globals": 2,
85
- "no-implied-eval": 2,
86
- "no-lone-blocks": 2,
87
- "no-useless-escape": 0,
88
- "array-bracket-spacing": 1,
89
- "block-spacing": 1,
90
-
91
- "brace-style": ["warn", "1tbs", {
92
- allowSingleLine: true,
93
- }],
94
-
95
- "comma-spacing": 1,
96
- "computed-property-spacing": 1,
97
- "eol-last": 1,
98
- "func-call-spacing": 1,
99
-
100
- "key-spacing": ["warn", {
101
- mode: "minimum",
102
- }],
103
-
104
- "keyword-spacing": 1,
105
- "linebreak-style": 1,
106
- "no-trailing-spaces": 1,
107
- "no-var": 1,
108
- "object-curly-spacing": ["warn", "never"],
109
-
110
- "one-var": ["error", {
111
- initialized: "never",
112
- uninitialized: "always",
113
- }],
114
-
115
- "padded-blocks": ["warn", "never"],
116
- semi: ["warn", "always"],
117
- "semi-spacing": 1,
118
- "space-before-blocks": 1,
119
- "space-before-function-paren": ["warn", "never"],
120
- "space-in-parens": ["warn", "never"],
121
- "space-infix-ops": 1,
122
- "arrow-body-style": ["warn", "as-needed"],
123
- "arrow-parens": ["warn", "as-needed"],
124
- "arrow-spacing": 1,
125
- "no-useless-constructor": 1,
126
-
127
- "prefer-arrow-callback": ["warn", {
128
- allowNamedFunctions: true,
129
- }],
130
-
131
- "prefer-const": ["error"],
132
- "prefer-template": 1,
133
- "template-curly-spacing": ["warn", "never"],
134
- "func-names": ["error", "never"],
135
- "object-shorthand": ["error", "consistent"],
136
- "multiline-comment-style": ["error", "starred-block"],
137
-
138
- indent: ["warn", 2, {
139
- MemberExpression: 1,
140
- SwitchCase: 1,
141
- }],
142
-
143
- "no-unsanitized/method": "error",
144
- "no-unsanitized/property": "error",
219
+ rules: {
220
+ 'no-console': 'off', // Allow console in scripts
221
+ 'import/no-extraneous-dependencies': 'off', // Dev deps OK in configs
222
+ },
145
223
  },
146
- }]);
224
+ ];