* Switch to jest
* Fix jslib-angular package name
* Make angular test project
* Split up tests by jslib project
* Remove obsolete node test script
* Use legacy deps with jest-preset-angular
* Move web tests to common
* Remove build from pipeline
This was only being used because we were not using ts runners.
We are now, so build is unnecessary
* add ellipsis pipe
* run prettier
* Account for ellipsis length in returned string
* Fix complete words case
* Fix another complete words issue
* fix for if there are not spaces in long value
* extract length check to beginning of method
* condense if statements
* remove log
* Remove error Response type check
Minimization is impacting type checking in a non-consistent way.
The previous type check works locally,
but not from build artifacts 🤷. We only set `captchaRequired` on
our errors when we want a resubmit with captcha included, so we're safe
keying off that
* linter
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
* [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
* 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.
* Initial commit for icon update
* Updated lg to reflect current usage
* Created BitwardenIconsService
* Prettier updates
* More prettier updates
* Updated font
* Prettier
* Added new icons to service map
* Removed variables and converted css to use scss maps and exported list
* Updated font sheet (130)
* Removed base class and replaced bolt icon
* Added 3x icon size
* Added sm text size helper
* Added rotate 270 helper
* Prettier
* Updated font sheet
* Requested Changes
* Removed BitwardenIcons Util - obsolete
* [bug] Improve state management performance
Large vaults see a clear degrade in performance using the state service, especially when multiple vaults are authed and unlocked at the same time.
Some changes made to address this:
1. Clearing in memory decrypted data for non active accounts. This really should have been something we were doing anyway, but letting go of that memory burden has a noticable performance boost.
2. Not loading a bunch of unecsassary data from disk accounts into memory on application startup. This was being done to initilize in memory accounts, but brought a lot of extra baggage with it like storing encrypted data in memory, even though it is never referenced that way.
3. Breaking the on disk state object up into seperate keys for accounts instead of storing everything together under a "state" key. This ensures there is less information fetched from disk each time we call for an account.
There were some restructuring changes needed to facilitate these items:
1. We need to be able to construct an account in the StateService, but typescript doesn't allow for new() constraints on generics so a factory needs to be created and passed into the StateService for this to work.
2. Since we can't reference an all-knowing "accounts" object for on disk state anymore we have to maintain a list of authenticated accounts, and this has been added.
3. The StateMigration service needed to be updated to break up the accounts object, so current dev and QA state will be broken and need to be reset.
Some other general refactorings that were helpful gettings this working:
1. Added a constant for keys to the StateService and StateMigrationService.
2. Bundling everything needed to deauthenticate a user into a dedicated method.
3. Bundling all the disk storage clear methods (that should be refactored later into client specific state services) into one helper method.
4. Bundling everything needed to dynamically select a new active user into a dedicated method.
* [bug] Set environmentUrls appropriatly on account add
* [bug] Stop tracking activity without an active user
* [bug] Remove lastActive from globalState and globalState migration
* [style] Ran prettier
* [refactor] Restructure EnvironmentUrls in state
* Patch up (add missing fields) and more extensivly use the EnvironmentUrls class instead of passing around an any
* Add environmentUrls to the AccountSettings model in addition to GlobalState for use in both scopes
* Move EnvironmentUrls initialization to the model level and out of StateSerice
* Adjust the StateMigrationService to account for these changes
* [refactor] Improve order of operations for LockGuardService
We currently jump through a bunch of hoops to verify users can access the Lock page, like checking authentication first.
If a user is not authenticated, they are not locked, so we can improve performance for the happy path of this serivice by checking isLocked first and using isAuthenticated to deviate from the normal flow if needed.
* [bug] Subscribe to State.accounts in EnvironmentService and set urls accordingly
The EnvironmentService has no context for account changes currently and does not update actively used urls based on active account.
This commit addresses this issue by subscribing to State.accounts and resetting the service's urls on account change.
* [bug] Clear AccessToken from State on clean
In order for logout flows to function as expected we need to deauthenticate users when cleaning up state before checking for the next active user
Otherwise the service will continue to think the user being logged out is active
* [refactor] Stop pushing accounts when modifying disk state
There is no reason to push new accounts to subscribers when updating disk state.
Subscribers recieve a copy of in memory state, so changes to disk will not be refelected and have to be fetched seperatly from the service.
Pushing when saving disk state is just creating an unecassary performance burden.
* [refactor] Default to in memory active user if availible, even when accessing disk state
Sometimes we need to pull activeUserId from storage to access a bit of data, like on initial boot, but most of the time this isn't necassary.
Since we pull this userId a lot, checking disk each time is a performance burden. Defaulting to the in memory user ID if avaible helps alleviate this.
* [style] Ran prettier
* [style] Change a let to a const