* Updated all sets of user key to pass in userId
* Added userId on auth request login.
* Fixed tests.
* Fixed tests to pass in UserId
* Added parameter to tests.
* Addressed PR feedback.
* Merged main
* move cli service-container to new folder
* fix imports
* add tsconfig and fix type issues in other services
* fix more imports in service-container
* make ts server happy in service-container
* fix actual bugs in cli service-container
* fix package json reference path
* fix service-container import
* update type on cipher service
* alert server if device trust is lost
* add test
* add tests for extra errors
* fix build
---------
Co-authored-by: Jared Snider <116684653+JaredSnider-Bitwarden@users.noreply.github.com>
Collection management permissions can be set for a group or a specific
user. Currently the CLI only outputs group associations when it displays
collection configuration information. This can cause bugs when piping
commands together.
This commit ensures that `user` associations also get output. In all
cases this data was already available and just needed to be added to a
response model.
* Implement multi-worker encryption service
* Fix feature flag being flipped and check for empty input earlier
* Add tests
* Small cleanup
* Remove restricted import
* Rename feature flag
* Refactor to BulkEncryptService
* Rename feature flag
* Fix cipher service spec
* Implement browser bulk encryption service
* Un-deprecate browserbulkencryptservice
* Load browser bulk encrypt service on feature flag asynchronously
* Fix bulk encryption service factories
* Deprecate BrowserMultithreadEncryptServiceImplementation
* Copy tests for browser-bulk-encrypt-service-implementation from browser-multithread-encrypt-service-implementation
* Make sure desktop uses non-bulk fallback during feature rollout
* Rename FallbackBulkEncryptService and fix service dependency issue
* Disable bulk encrypt service on mv3
* Change condition order to avoid expensive api call
* Set default hardware concurrency to 1 if not available
* Make getdecrypteditemfromworker private
* Fix cli build
* Add check for key being null
* [PM-6426] Create TaskSchedulerService and update usage of long lived timeouts
* [PM-6426] Implementing nextSync timeout using TaskScheduler
* [PM-6426] Implementing systemClearClipboard using TaskScheduler
* [PM-6426] Fixing race condition with setting/unsetting active alarms
* [PM-6426] Implementing clear clipboard call on generatePasswordToClipboard with the TaskSchedulerService
* [PM-6426] Implementing abortTimeout for Fido2ClientService using TaskSchedulerService
* [PM-6426] Implementing reconnect timer timeout for NotificationService using the TaskSchedulerService
* [PM-6426] Implementing reconnect timer timeout for NotificationService using the TaskSchedulerService
* [PM-6426] Implementing sessionTimeout for LoginStrategyService using TaskSchedulerService
* [PM-6426] Implementing eventUploadInterval using TaskScheduler
* [PM-6426] Adding jest tests for the base TaskSchedulerService class
* [PM-6426] Updating jest tests for GeneratePasswordToClipboardCommand
* [PM-6426] Setting up the full sync process as an interval rather than a timeout
* [PM-6426] Renaming the scheduleNextSync alarm name
* [PM-6426] Fixing dependency references in services.module.ts
* [PM-6426] Adding jest tests for added BrowserApi methods
* [PM-6426] Refactoring small detail for how we identify the clear clipboard timeout in SystemService
* [PM-6426] Ensuring that we await clearing an established scheduled task for the notification service
* [PM-6426] Changing the name of the state definition for the TaskScheduler
* [PM-6426] Implementing jest tests for the BrowserTaskSchedulerService
* [PM-6426] Implementing jest tests for the BrowserTaskSchedulerService
* [PM-6426] Adding jest tests for the base TaskSchedulerService class
* [PM-6426] Finalizing jest tests for BrowserTaskScheduler class
* [PM-6426] Finalizing documentation on BrowserTaskSchedulerService
* [PM-6426] Fixing jest test for LoginStrategyService
* [PM-6426] Implementing compatibility for the browser.alarms api
* [PM-6426] Fixing how we check for the browser alarms api
* [PM-6426] Adding jest tests to the BrowserApi implementation
* [PM-6426] Aligning the implementation with our code guidelines for Angular components
* [PM-6426] Fixing jest tests and lint errors
* [PM-6426] Moving alarms api calls out of BrowserApi and structuring them within the BrowserTaskSchedulerService
* [PM-6426] Reworking implementation to register handlers separately from the call to those handlers
* [PM-6426] Adjusting how we register the fullSync scheduled task
* [PM-6426] Implementing approach for incorporating the user UUID when setting task handlers
* [PM-6426] Attempting to re-work implementation to facilitate userId-spcific alarms
* [PM-6426] Refactoring smaller details of the implementation
* [PM-6426] Working through the details of the implementation and setting up final refinments
* [PM-6426] Fixing some issues surrounding duplicate alarms triggering
* [PM-6426] Adjusting name for generate password to clipboard command task name
* [PM-6426] Fixing generate password to clipboard command jest tests
* [PM-6426] Working through jest tests and implementing a method to guard against setting a task without having a registered callback
* [PM-6426] Working through jest tests and implementing a method to guard against setting a task without having a registered callback
* [PM-6426] Implementing methodology for having a fallback to setTimeout if the browser context is lost in some manner
* [PM-6426] Working through jest tests
* [PM-6426] Working through jest tests
* [PM-6426] Working through jest tests
* [PM-6426] Working through jest tests
* [PM-6426] Finalizing stepped setInterval implementation
* [PM-6426] Implementing Jest tests for DefaultTaskSchedulerService
* [PM-6426] Adjusting jest tests
* [PM-6426] Adjusting jest tests
* [PM-6426] Adjusting jest tests
* [PM-6426] Fixing issues identified in code review
* [PM-6426] Fixing issues identified in code review
* [PM-6426] Removing user-based alarms and fixing an issue found with setting steppedd alarm interavals
* [PM-6426] Removing user-based alarms and fixing an issue found with setting steppedd alarm interavals
* [PM-6426] Fixing issue with typing information on a test
* [PM-6426] Using the getUpperBoundDelayInMinutes method to handle setting stepped alarms and setTimeout fallbacks
* [PM-6426] Removing the potential for the TaskScheduler to be optional
* [PM-6426] Reworking implementation to leverage subscription based deregistration of alarms
* [PM-6426] Fixing jest tests
* [PM-6426] Implementing foreground and background task scheduler services to avoid duplication of task scheudlers and to have the background setup as a fallback to the poopup tasks
* [PM-6426] Implementing foreground and background task scheduler services to avoid duplication of task scheudlers and to have the background setup as a fallback to the poopup tasks
* [PM-6426] Merging main into branch
* [PM-6426] Fixing issues with the CLI Service Container implementation
* [PM-6426] Reworking swallowed promises to contain a catch statement allow us to debug potential issues with registrations of alarms
* [PM-6426] Adding jest tests to the ForegroundTaskSchedulerService and the BackgroundTaskSchedulerService
* [PM-6426] Adding jest tests to the ForegroundTaskSchedulerService and the BackgroundTaskSchedulerService
* [PM-6426] Adding jest tests to the ForegroundTaskSchedulerService and the BackgroundTaskSchedulerService
* [PM-6426] Adding jest tests to the ForegroundTaskSchedulerService and the BackgroundTaskSchedulerService
* [PM-6426] Adjusting implementation based on code review feedback
* [PM-6426] Reworking file structure
* [PM-6426] Reworking file structure
* [PM-6426] Adding comments to provide clarity on how the login strategy cache experiation state is used
* [PM-6426] Catching and logging erorrs that appear from methods that return a promise within VaultTimeoutService
* Check that user is authed before getting user config
* Accept PR Suggestion
Co-authored-by: Andreas Coroiu <acoroiu@bitwarden.com>
* Use Strict Equal
---------
Co-authored-by: Andreas Coroiu <acoroiu@bitwarden.com>
* Initial checking of collect many
* should update to better handle parameters
* cleaning up event collection params
* Adding documentation
* Removing commented out code saved for testing
* Adding pr changes and using the account service for event collection user id
* browser main.background event collection service needed the account service
* Update the build job to use `bit` artifacts for stores
* Update the CLI's license in `package.json` for the NPM store
* Add license configuration to `snapcraft.yaml`
* [deps] Platform: Update argon2 to v0.40.1
* Update inclusion in context isolation
* Ensure node-gyp available for mac builds
Mac runners seem to have progressed above python 3.12, which removed `distutils`. We need to ensure it's installed for node-gyp compilations.
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
* turn on enableCipherKeyEncryption flag
* turn enableCipherKeyEncryption flag on in desktop config
---------
Co-authored-by: bnagawiecki <107435978+bnagawiecki@users.noreply.github.com>
* Refactor list organizations command to use organizationService.memberOrganizations$
* Deprecate OrganizationService.getAll method and update CLI get command to use the organizations observable
* On logging out the account service active account needs set to null
* Auth service logout back to old spot and account switch after cleaning the state
* Send current Org user Id on collection creation through CLI
* Run npm prettier
* Add organization services to CreateCommand creation on ServeCommand
* Refactor organization data models to include organizationUserId property
* Refactor create command to utilize the OrganizationUserId on the Organization object
* Add users to collection request in edit command
* fix: organization.data test update to correct deserialization, refs AC-2286
---------
Co-authored-by: Vincent Salucci <vincesalucci21@gmail.com>
* PM-7392 - EncryptSvc - add new method for detecting if a simple string is an enc string.
* PM-7392 - TokenSvc - add checks when setting and retrieving the access token to improve handling around the access token encryption.
* PM-7392 - (1) Clean up token svc (2) export access token key type for use in tests.
* PM-7392 - Get token svc tests passing; WIP more tests to come for new scenarios.
* PM-7392 - Access token secure storage to disk fallback WIP but mostly functional besides weird logout behavior.
* PM-7392 - Clean up unnecessary comment
* PM-7392 - TokenSvc - refresh token disk storage fallback
* PM-7392 - Fix token service tests in prep for adding tests for new scenarios.
* PM-7392 - TokenSvc tests - Test new setRefreshToken scenarios
* PM-7392 - TokenSvc - getRefreshToken should return null or a value - not undefined.
* PM-7392 - Fix test name.
* PM-7392 - TokenSvc tests - clean up test names that reference removed refresh token migrated flag.
* PM-7392 - getRefreshToken tests done.
* PM-7392 - Fix error quote
* PM-7392 - TokenSvc tests - setAccessToken new scenarios tested.
* PM-7392 - TokenSvc - getAccessToken - if secure storage errors add error to log.
* PM-7392 - TokenSvc tests - getAccessToken - all new scenarios tested
* PM-7392 - EncryptSvc - test new stringIsEncString method
* PM-7392 - Main.ts - fix circ dep issue.
* PM-7392 - Main.ts - remove comment.
* PM-7392 - Don't re-invent the wheel and simply use existing isSerializedEncString static method.
* PM-7392 - Enc String - (1) Add handling for Nan in parseEncryptedString (2) Added null handling to isSerializedEncString. (3) Plan to remove encrypt service implementation
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
* PM-7392 - Remove encrypt service method
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
* PM-7392 - Actually fix circ dep issues with Justin. Ty!
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
* PM-7392 - TokenSvc - update to use EncString instead of EncryptSvc + fix tests.
* PM-7392 - TokenSvc - (1) Remove test code (2) Refactor decryptAccessToken method to accept access token key and error on failure to pass required decryption key to method.
* PM-7392 - Per PR feedback and discussion, do not log the user out if hte refresh token cannot be found. This will allow users to continue to use the app until their access token expires and we will error on trying to refresh it. The app will then still work on a fresh login for 55 min.
* PM-7392 - API service - update doAuthRefresh error to clarify which token cannot be refreshed.
* PM-7392 - Fix SetRefreshToken case where a null input would incorrectly trigger a fallback to disk.
* PM-7392 - If the access token cannot be refreshed due to a missing refresh token or API keys, then surface an error to the user and log it so it isn't a silent failure + we get a log.
* PM-7392 - Fix CLI build errors
* PM-7392 - Per PR feedback, add missing tests (thank you Jake for writing these!)
Co-authored-by: Jake Fink <jfink@bitwarden.com>
* PM-7392 - Per PR feedback, update incorrect comment from 3 releases to 3 months.
* PM-7392 - Per PR feedback, remove links.
* PM-7392 - Per PR feedback, move tests to existing describe.
* PM-7392 - Per PR feedback, adjust all test names to match naming convention.
* PM-7392 - ApiService - refreshIdentityToken - log error before swallowing it so we have a record of it.
* PM-7392 - Fix copy for errorRefreshingAccessToken
* PM-7392 - Per PR feedback, move error handling toast responsibility to client specific app component logic reached via messaging.
* PM-7392 - Swap logout reason from enum to type.
* PM-7392 - ApiService - Stop using messaging to trigger toast to let user know about refresh access token errors; replace with client specific callback logic.
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
* PM-7392 - Per PR feedback, adjust enc string changes and tests.
* PM-7392 - Rename file to be type from enum
* PM-7392 - ToastService - we need to await the activeToast.onHidden observable so return the activeToast from the showToast.
* PM-7392 - Desktop AppComp - cleanup messaging
* PM-7392 - Move Logout reason custom type to auth/common
* PM-7392 - WIP - Enhancing logout callback to consider the logout reason + move show toast logic into logout callback
* PM-7392 - Logout callback should simply pass along the LogoutReason instead of handling it - let each client's message listener handle it.
* PM-7392 - More replacements of expired with logoutReason
* PM-7392 - More expired to logoutReason replacements
* PM-7392 - Build new handlers for displaying the logout reason for desktop & web.
* PM-7392 - Revert ToastService changes
* PM-7392 - TokenSvc - Replace messageSender with logout callback per PR feedback.
* PM-7392 - Desktop App comp - replace toast usage with simple dialog to guarantee users will see the reason for them being logged out.
* PM-7392 - Web app comp - fix issue
* PM-7392 - Desktop App comp - don't show cancel btn on simple dialogs.
* PM-7392 - Desktop App comp - Don't open n simple dialogs.
* PM-7392 - Fix browser build
* PM-7392 - Remove logout reason from CLI as each logout call handles messaging on its own.
* PM-7392 - Previously, if a security stamp was invalid, the session was marked as expired. Restore that functionality.
* PM-7392 - Update sync service logoutCallback to include optional user id.
* PM-7392 - Clean up web app comp
* PM-7392 - Web - app comp - only handle actually possible web logout scenarios.
* PM-7392 - Browser Popup app comp - restore done logging out message functionality + add new default logout message
* PM-7392 - Add optional user id to logout callbacks.
* PM-7392 - Main.background.ts - add clarifying comment.
* PM-7392 - Per feedback, use danger simple dialog type for error.
* PM-7392 - Browser Popup - add comment clarifying expectation of seeing toasts.
* PM-7392 - Consolidate invalidSecurityStamp error handling
* PM-7392 - Per PR feedback, REFRESH_ACCESS_TOKEN_ERROR_CALLBACK can be completely sync. + Refactor to method in main.background.
* PM-7392 - Per PR feedback, use a named callback for refreshAccessTokenErrorCallback in CLI
* PM-7392 - Add TODO
* PM-7392 - Re-apply bw.ts changes to new service-container.
* PM-7392 - TokenSvc - tweak error message.
* PM-7392 - Fix test
* PM-7392 - Clean up merge conflict where I duplicated dependencies.
* PM-7392 - Per discussion with product, change default logout toast to be info
* PM-7392 - After merge, add new logout reason to sync service.
* PM-7392 - Remove default logout message per discussion with product since it isn't really visible on desktop or browser.
* PM-7392 - address PR feedback.
---------
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
Co-authored-by: Jake Fink <jfink@bitwarden.com>
Co-authored-by: Matt Gibson <mgibson@bitwarden.com>