* [PM-46898] fix: Name new My items collections with myItemsV2
The default user collection was named from the "myItems" key ("My Items"),
while the rest of the UI uses "myItemsV2" ("My items"). Switch the web,
browser, desktop and CLI paths that create the collection to "myItemsV2"
and drop the now-unused "myItems" key. Existing collections keep their
stored name.
* Use errorImportingMyItemsMultiCollectionV2 for the lowercase My items import error
* Label the My items shared folder from i18n in the vault table
* Label the My items shared folder from i18n in the item view and edit form
* Keep other members' emails on their My items collections and test the labels
* [PAM-337] Add collection access-rule flag and dialog callout slot
Carries hasEnabledAccessRule from the collection details response through
CollectionData, Collection, CollectionView and CollectionAdminView, keeping
it off the SDK wire format. Adds the COLLECTION_ACCESS_RULE_CALLOUT token
and an NgComponentOutlet slot in the collection edit dialog; unprovided, it
renders nothing.
* PAM-337: Copy hasEnabledAccessRule onto collections that fail to decrypt
* Remove unrelated warning from toSdkCollection docblock
* PAM-337: Remove the remaining deny_unknown_fields claims
---------
Co-authored-by: Anders Åberg <github@andersaberg.com>
* Adds member actions for inviting staged users
* allows sending invites to a mix of staged/non-staged
* touchups post-review
* add JSDoc for sending staged invite
* client implementation of bulk response for staged users
* consolidate sendInvite into bulkSendInvite
Both hit the same endpoint, so sendInvite was duplicating the whole body for a
single id. It now delegates and adapts the first failure into a MemberActionResult,
keeping the return shape the row action's handleMemberActionResult expects.
bulkSendInvite takes user ids rather than views, since it only ever read .id.
* report partial failures when sending staged invites
The send-invite endpoint skips members that are no longer staged and reports them
per row, so a partial send is a normal outcome. sendStagedInvites only surfaced
errors when every member failed, so a mixed response showed just the success toast.
validationService.showError also could not render the failure list: an array has no
.message, so it fell through to the generic "unexpected error" string. Report the
distinct server messages in an error toast instead.
* routes invite/reinvte through the SDK
* converts promises to observables for SDK client to await higher up
* moves observable-streams to member actions service
* provide SdkService in member access report dialog spec
---------
Co-authored-by: JaredScar <thewolfbadger@gmail.com>
* Bulk decrypt with decrypt with failures new PR
* Implements rename feature for when a collection fails decryption via SDK call
* PR comments actioned on
* PR claude comment fixes
* PR claude comment fixes
* PR claude comments fixed
* PR Claude Comment fixes
* Rid of unused signal
* Fix up PR comments from Thomas
* Updates feature flag to proper key from epic
* Fix PR claude finding 1
* PR Claude comment fixes
* Fix PR comments
* Fix up message
* Rids of error badge in table to go back to existing behavior since no design/product capacity right now. Also rids of warning box above name of broken collection name
Update OrganizationUserResetPasswordRequest to use a standard constructor() method that take MasterPasswordAuthenticationData and MasterPasswordUnlockData.
* [PM-40212] Web vault: enable-PAM UI (member toggle + bulk Activate PAM)
Add the web-vault affordances to grant members Privileged Access
Management access, mirroring the Secrets Manager pattern:
- Thread `accessPam` through the org-user response, list/admin views,
and the single-user update request.
- Add a per-member PAM toggle to the edit-member dialog (both the
Details-tab and Role-tab layouts), gated on `usePam` + FeatureFlag.Pam.
- Add a bulk "Activate PAM" command under the Secrets Manager CTA on the
members list, driving PUT organizations/{orgId}/users/enable-pam.
The affordances are hidden unless the org is PAM-entitled (`usePam`)
and the feature flag is on; the server's UsePam rejection remains the
fallback. i18n keys added to the web `en` locale only.
* refactor(admin-console): address review feedback on bulk-enable-pam dialog
- Use app- selector prefix on BulkEnablePamDialogComponent
- Self-close the bit-avatar tag
* test(admin-console): cover openBulkActivatePamDialog in member dialog manager spec
* refactor(admin-console): rename PAM UI to Privileged Controls
Rename the enable-PAM affordances to the product name "Privileged
Controls", and mark the name as untranslatable so Crowdin leaves it
intact:
- Rename the six new web `en` i18n keys to `privilegedControls*` /
`*PrivilegedControls`, and give each a description noting that
'Privileged Controls' is a product name and should not be translated
(matching the Bitwarden Authenticator and Duo entries).
- Expand the "Activate PAM" button to "Activate Privileged Controls" and
drop the "(PAM)" parenthetical from the bulk description, since the
acronym no longer maps to the product name.
- Rename BulkEnablePamDialogComponent and its three files to
bulk-enable-privileged-controls-dialog, along with the selector,
dialog data type, and the openBulkActivatePrivilegedControlsDialog /
bulkActivatePrivilegedControls / canUsePrivilegedControls /
privilegedControlsEnabled members and the two checkbox QA ids.
Wire-level names keep the `pam` spelling because the client cannot
rename them unilaterally: the serialized `accessPam` request property,
the `AccessPam` response property, and the `enable-pam` endpoint (plus
the method mirroring it). `FeatureFlag.Pam` and `usePam` are unchanged
and predate this branch.
* refactor(admin-console): self-close bit-menu-divider in the new menu item
Addresses review feedback on the Privileged Controls bulk-action menu
item.
* refactor: enhance type safety across various components
- Updated `organizationRedirectGuard` to allow `undefined` in `customRedirect` parameter.
- Modified `UserConfirmComponent`, `AccountComponent`, and other components to use optional chaining and non-null assertions for better type safety.
- Removed unnecessary `@ts-strict-ignore` comments from several files.
- Ensured consistent handling of potentially undefined values in form submissions and API requests.
- Improved overall code clarity and maintainability by enforcing stricter type definitions.
* test: add unit test for undefined callback in organization redirect guard
- Introduced a new route in the organization redirect guard to handle cases where the redirect callback returns undefined.
- Added a test to verify that navigating to this route correctly falls back to the admin console redirect.
- Removed unused taxFormPromise from AccountComponent for cleaner code.
* refactor: remove unused secret property and formPromise from DeleteOrganizationDialogComponent
- Eliminated the `secret` property and `formPromise` from the component to streamline the code.
- Updated the formGroup initialization to reflect these changes, enhancing clarity and maintainability.
* add problem detail support, wire up email changing
* fix tests
* add name
* clear error on value change
* typos
* add more error messages
* add name guard
* fix silent rewrite of name on save
* fix tests
- Removed ConfigService from MainBackground and ServiceContainer classes.
- Updated DefaultCollectionService to eliminate ConfigService usage, simplifying the decryption logic.
- Adjusted related tests to reflect the removal of ConfigService and ensure proper functionality without it.
* [PM-28896] Enhance DefaultCollectionService tests and improve decryption logic
- Added tests to ensure decryption behavior when orgKeys$ emits null and transitions to valid keys.
- Updated the decryption logic to combine encrypted collections and organization keys, ensuring proper handling of locked/logged-out states.
- Improved test coverage for various scenarios involving collection decryption.
* Remove unused dependencies from package-lock.json to streamline the project and reduce potential security vulnerabilities.
* Add AuthService dependency to MainBackground and ServiceContainer
- Integrated AuthService into MainBackground and ServiceContainer to enhance authentication handling.
- Updated DefaultCollectionService to utilize AuthService for managing authentication status during collection decryption.
- Improved test coverage for DefaultCollectionService to reflect changes in authentication logic.
* Update package-lock.json to include new dependencies and versions for http-proxy-middleware and is-plain-obj, while removing outdated entries. This ensures compatibility with the latest Angular build tools and improves overall package management.
* Remove AuthService references from MainBackground and DefaultCollectionService, updating related tests to use orgKeys instead of authStatus for state management.
* Update package-lock.json to remove outdated http-proxy-middleware entries, downgrade its version in one instance, and add new dependencies for chokidar and readdirp, ensuring compatibility with Angular ESLint and improving package management.
* Add LogService to MainBackground and ServiceContainer; enhance DefaultCollectionService with error handling for batch decryption failures
* Refactor DefaultCollectionService to improve error handling and caching behavior for decrypted collections. Removed legacy batch decryption error handling and updated tests to reflect new retry logic on transient failures. Enhanced comments for clarity on state management and emission behavior.
* Refactor DefaultCollectionService by removing legacy error handling for batch decryption. This change simplifies the code and enhances clarity by eliminating unnecessary comments and streamlining the logic for handling decrypted collections.
* Update DefaultCollectionService tests to propagate errors from decryptMany instead of logging and returning empty lists. Refactor retry logic for transient failures to ensure proper error handling and state management during decryption attempts.
* Remove LogService dependency from various components to streamline service initialization and improve code clarity.
* Revert "Update DefaultCollectionService tests to propagate errors from decryptMany instead of logging and returning empty lists. Refactor retry logic for transient failures to ensure proper error handling and state management during decryption attempts."
This reverts commit 64af313c83.
* Revert "Refactor DefaultCollectionService by removing legacy error handling for batch decryption. This change simplifies the code and enhances clarity by eliminating unnecessary comments and streamlining the logic for handling decrypted collections."
This reverts commit a18dff10ac.
* Remove duplicate logService call
---------
Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
* feat(auth): use server-provided salt with email fallback in account recovery
* refactor(auth): remove @ts-strict-ignore from account recovery files
* test(auth): cover server-salt and email-fallback paths in account recovery
* fix: add i18n message for error
* fix: strict typing error
* test: adding test back lost during conflict resolution.
* test: add coverage
* doc: add task to comment for easier unwinding later
* fix: use typeof check for more strict type checking on response from server
---------
Co-authored-by: Jared Snider <116684653+JaredSnider-Bitwarden@users.noreply.github.com>
* add edit member dialog, refactored to be ts-strict from member-dialog component
* clean up
* fix dialog selector pattern
* remove feature flag logic
* clean up, fix type error
* fix circular dependency, fix dialog directive
* fix remove user
* refactor nested-checkbox, add story
* update member-access-report to use new member edit component
* refactors org user view models and consumers to be ts-strict compliant
* DRY up invite logic
* clean up
* run prettier
* fix circular dep
* fix circular dependency (real)
* update test
* more clean up
* more type saftey fixes
* more types
* even more types
* add jsdoc
* fix test
* Refactor bidirectional mapping for CollectionType and SDK types
Updated the mapping between numeric CollectionType and SDK's numeric variant to ensure type safety. The previous string variant has been replaced with numeric values for better consistency and maintainability. This change enhances type checking in TypeScript and ensures that any additions to the CollectionTypes require corresponding updates in the mapping.
* Refactor CollectionType handling in collection models
Removed bidirectional mapping for CollectionType and SDK types, simplifying the type assignment in the Collection and CollectionView classes. This change enhances code clarity and reduces complexity by directly using the SDK's numeric variant for type assignments.
* Update CollectionType handling in tests to use numeric values
Replaced string representations of CollectionType with their corresponding numeric values in the collection SDK mapping tests. This change ensures consistency with the recent refactor of type handling, enhancing type safety and maintainability across the codebase.
* Update tests to use CollectionTypes for type assignments
Replaced numeric values with the CollectionTypes enum in the collection SDK mapping tests. This change improves code clarity and consistency, aligning with recent refactors to enhance type safety and maintainability across the codebase.
* Update Bitwarden SDK dependencies to version 0.2.0-main.739 in package.json and package-lock.json. This change ensures compatibility with the latest features and fixes in the SDK.
* Refactor tests to utilize CollectionTypes enum for type assignments
Updated test cases in default-collection-encryption.service.spec.ts to replace string literals with the CollectionTypes enum for improved type safety and consistency. This aligns with recent refactors aimed at enhancing code clarity and maintainability.
* Add Collection Encryption Service and integrate into collection handling
- Introduced `CollectionEncryptionService` and its default implementation `DefaultCollectionEncryptionService` for handling collection encryption and decryption.
- Updated `DefaultCollectionService` to utilize the new encryption service based on feature flags.
- Refactored collection-related classes to support SDK-based encryption operations.
- Added necessary imports and updated service providers in Angular module for dependency injection.
- Enhanced collection models to support SDK format conversions for encryption tasks.
* Implement encryption functionality in CollectionEncryptionService
- Added `encrypt` method to `CollectionEncryptionService` for encrypting collection views.
- Updated `DefaultCollectionEncryptionService` to include the new `encrypt` method, ensuring proper handling of SDK encryption.
- Modified `DefaultCollectionService` to utilize the encryption service based on feature flags.
- Enhanced collection and collection view models to support SDK format conversions for encryption tasks.
* refactor(collections): Update collection decryption methods and handle encryption support
- Modified `fromSdkCollectionView` to include `sourceCollection` for preserving `defaultUserCollectionEmail`.
- Updated decryption methods in `DefaultCollectionEncryptionService` to pass the original collection.
- Marked `encrypt` method as unsupported in the SDK, directing users to the legacy key-service path.
- Removed SDK feature flag checks from `DefaultCollectionService`'s `encrypt` method.
* refactor(collections): Update feature flag for collection decryption to PM35153
- Changed references from PM34918CollectionEncryptionService to PM35153CollectionSdkDecryption in both service and test files.
- Adjusted the feature flag checks to align with the new decryption implementation.
* Implement collection encryption using SDK in DefaultCollectionEncryptionService
* Refactor collection decryption in DefaultCollectionEncryptionService to handle errors individually and improve logging
* Add polyfills for Symbol.dispose and Symbol.asyncDispose in test setup; add unit tests for DefaultCollectionEncryptionService and collection SDK mapping
* Refactor error handling in DefaultCollectionEncryptionService to throw errors instead of returning EMPTY, improving error propagation and logging consistency.
* Refactor collection decryption and enhance type mapping
- Updated the `decrypt` method in `default-collection-encryption.service.ts` to utilize `decryptMany` for improved error handling.
- Added exhaustive bidirectional mapping for `CollectionType` and `SdkCollectionType` in `collection.ts`.
- Enhanced tests in `collection-sdk-mapping.spec.ts` to verify roundtrip conversions for `CollectionTypes`.
- Adjusted `Collection` and `CollectionView` classes to use the new type mappings for SDK interactions.
* Refactor DefaultCollectionEncryptionService to use a more concise method for encrypting collections. Update collection-sdk-mapping tests to utilize SdkEncString for better type safety. Simplify NewItemNudgeComponent's logic for showing nudge spotlight based on cipher type, ensuring null checks are handled appropriately.
* Refactor NewItemNudgeComponent to use strict null checks for cipher type comparison, enhancing code clarity and consistency.
* Add bulk auto-confirm functionality for organization users
- Introduced methods to retrieve pending auto-confirm users and to bulk auto-confirm them in the OrganizationUserApiService.
- Added OrganizationUserPendingAutoConfirmResponse model to handle responses for pending auto-confirmation.
- Implemented logic in DefaultAutomaticUserConfirmationService to automatically confirm users who accepted their invitations while the admin was offline.
- Updated feature flags to enable bulk auto-confirmation on login.
These changes enhance the user management experience by streamlining the confirmation process for organization users.
* Enhance MainBackground class by adding authService, accountService, and configService dependencies to the constructor. This update improves service integration for background operations.
* Add bulk auto-confirm functionality on user login
- Implemented the `initBulkAutoConfirmOnLoginSweep` method in `DefaultAutomaticUserConfirmationService` to trigger bulk auto-confirmation for users transitioning from Locked to Unlocked status.
- Enhanced unit tests to verify the behavior of the sweep service under different authentication states.
- Updated the service to utilize `AuthenticationStatus` for improved state management during user confirmation processes.
These changes streamline the user confirmation workflow, ensuring timely processing of pending confirmations upon user login.
* Refactor DefaultAutomaticUserConfirmationService for improved user confirmation handling
- Updated the `initBulkAutoConfirmOnLoginSweep` method to utilize a set for tracking seen user IDs, preventing duplicate processing during user state transitions.
- Enhanced error handling in the bulk auto-confirmation process to gracefully manage transient errors.
- Introduced a new `resolveAutoConfirmOrg` method to streamline organization retrieval logic for user confirmation.
- Updated unit tests to reflect changes in the handling of account information and ensure correct behavior during user confirmation processes.
These modifications enhance the efficiency and reliability of the user confirmation workflow, particularly during login transitions.
* Update BulkAutoConfirmOnLogin feature flag value to reflect new implementation
* Enhance unit tests for DefaultAutomaticUserConfirmationService to validate feature flag behavior. Added checks to ensure subscriptions are not set up when the feature flag is disabled and confirmed correct behavior during user state transitions. Updated the `initBulkAutoConfirmOnLoginSweep` method to be asynchronous for proper feature flag handling.
* Adding validation to ensure organizations are not being created without keys unintentionally
* Added request test class.
* Removing request test.
* removing duplicate check
* Keys is different than key
* removed feature flag for default user collection being created for restored users.
* leaving the url as we'll need it in case we have to revert a release
* Added encrypted default collection name to new feature flagged restore user methods/endpoint.
* corrected filter to use null check with imperative code
Migrated vault filters to new v3 vault's navigation
* Decoupled existing vault filtering from vault component by using routed params with routed-vault-filter-bridge
* Converted vault filters to standalone components
* Removed extending filter Base Components from deprecated /libs/angular library and handled logic directly
* Moved shared 'models' and 'services' directories from web-vault into /libs/vault
* [PM-27675] Integrate dialogs into VaultItemTransferService
* [PM-27675] Update tests for new dialogs
* [PM-27675] Center dialogs and prevent closing with escape or pointer events
* [PM-27675] Add transferInProgress$ observable to VaultItemsTransferService
* [PM-27675] Hook vault item transfer service into browser vault component
* [PM-27675] Move defaultUserCollection$ to collection service
* [PM-27675] Cleanup dialog styles
* [PM-27675] Introduce readySubject to popup vault component to keep prevent flashing content while item transfer is in progress
* [PM-27675] Fix vault-v2 tests
* add one time setup dialog for auto confirm
* add one time setup dialog for auto confirm
* fix copy, padding, cleanup observable logic
* cleanup
* cleanup
* refactor
* clean up
* more cleanup
* Fix deleted files
This reverts commit 7c18a5e512.
* add state definition for auto confirm
* typo
* refactor organziation user service
* WIP create auto confirm service
* add POST method, finish implementation
* add missing userId param, jsdoc
* fix DI
* refactor organziation user service
* WIP create auto confirm service
* add POST method, finish implementation
* add missing userId param, jsdoc
* clean up, more DI fixes
* remove @Injectable from service, fix tests
* remove from libs/common, fix dir structure, add tests
* enforce restrictions based on collection type, set default collection type
* fix ts strict errors
* fix default collection enforcement in vault header
* enforce default collection restrictions in vault collection row
* enforce default collection restrictions in AC vault header
* enforce default collection restriction for select all
* fix ts strict error
* switch to signal, fix feature flag
* fix story
* clean up
* remove feature flag, move check for defaultCollecion to CollecitonView
* fix test
* remove unused configService
* fix test: coerce null to undefined for collection Id
* clean up leaky abstraction for default collection
* fix ts-strict error
* fix parens
* add new property to models, update logic, refactor for ts-strict
* fix type
* rename defaultCollection getter
* clean up
* clean up
* clean up, add comment, fix submit
* add comment
* add feature flag
* check model for name
* cleanup readonly logic, remove featureflag logic
* wip
* refactor CollectionRequest into Create and Update models
* fix readonly logic
* cleanup
* set defaultUserCollectionEmail in decryption from Collection
* split save into update/create methods
* fix readonly logic
* fix collections post and put requests
* add defaultUserCollection email to model when submitting collection dialog