Collapsed groupings have regressed to not maintaining their state through restarting clients.
The state mangement refactor erroniously began saving this field to memory instead of disk, but there were some other issues that changing this brought on that are also fixed in this commit.
Changes:
1. Save collapsedGroupings persistantly in StateService
2. Adjust the type of collapsedGroupings on the Account model from a Set<string> to a string[]
* This is the way we were storing this value in previous releases, and saving the entire set object breaks.
3. Adjust the StateService getter/setter for collapsedGroupings to expect a string[]
4. Extract a string[] from the GroupingsComponent groupings that is a Set<string> before saving
* Resolve hasKeyStored returning true when no biometric key is stored
* Change to use a switch statement which avoids having to fetch the key.
* Use triple equals
* Run prettier
* [bug] Fix logout timeout action for inactive accounts
* Pass userId in to the logout callback parameter to the vaultTimeoutService. The message handle in desktop already expects this.
* Set lastActive on account login, and null it on account deauthentication. This prevents an issue where newly logged in accounts immediatly time out due to inactivity.
* Add userId to locked callbacks
* Add userId to log out callback
* Add password protected export
* Run prettier
* Test password protected export service
* Create type for known import type strings
* Test import service changes
* Test bitwarden password importer
* Run prettier
* Remove unnecessary class properties
* Run prettier
* Tslint fixes
* Add KdfType to password protected export
* Linter fixes
* run prettier
* Use Identity server routes
We've moved `prelogin` and `register` endpoints to the Indentity project
Reflecting that change here
* Only update path for dev environment
* Use different strategy classes for different types of login
* General refactor and cleanup of auth logic
* Create subclasses for different types of login credentials
* Create subclasses for different types of tokenRequests
* Create TwoFactorService, move code out of authService
* refactor base CLI commands to use new interface
Some clients have unique global setting defaults (and unique global settings)
For example: the web vault defaults to light theme, but most clients with theme support default to system theme.
The current way we handle GlobalState is buried in jslib and not easily extendible in clients.
To fix this, we need to treat GlobalState as a generic in the StateService and StateMigration service and allow for its extension in those methods and anywhere GlobalState is inited.
* Add testdata, create types for keeperjson import
* Create keeperjson importer and tests
* Register, Create instance of keeperjson importer
* Move keeperCsvImporter to keeperImporters folder
* Fixed import of BaseImporter
* Removed unnecessary check for key
* Move instantiation of importer into beforeEach
* Fixed the second import with a wrong path
* Adjust types based on new test export
* Add test case for empty notes and custom fields
* Implement logic for failed test case
* Removed test expectation
* [bug] Ensure globals set before migration is run are not lost
Some fields, like biometrics, are set before we can run the state migration
For some use cases, like initial install, this can lead to migration clearing those fields when it doesn't find them in storage.
This commit sets up an order of checks for migrating globals that considers fields that may already have been set.
* [style] Ran prettier
There is a use case that overrides locally set environmentUrls: an initial boot of a logged out application.
We override environmentUrls with whatever the tempory settings store has, even if different urls are added before authenticating.
This commit ensures we always use input environmentUrls.
With the move to a central StateService we erroniously cut out search indexing from the process of setting decrypted ciphers to memory.
This commit calls the method responsible for setting decrypted ciphers and indexing when decrypting, instead of setting decrypted ciphers directly.
Some clients, like Directory Connector, use different key for their user identifier: entityId
We currently only check for userId in the migration service, but need to account for both.
A couple of helper methods were recently added to the StateMigrationService, but they were set to private and can't be used in children.
Some clients, like the Directory Connector, extend the StateMigrationService and need access to these methods.