1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-10-10 06:08:34 +02:00
Commit Graph

11779 Commits

Author SHA1 Message Date
Addison Beck
025a4a5e38
[bug] Index search service when setting decrypted ciphers (#620)
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.
2022-01-20 16:25:04 -05:00
Matt Gibson
19bf7c75a3
Use node-ts and jasmine-ts to run tests (#621)
* Use node-ts and jasmine-ts to run tests

* prettier

* Add tsconf-paths module
2022-01-20 14:07:13 -06:00
Thomas Rittson
8b650666c5
Fix migration to Key Connector (#452)
* Move Key Connector check to subclass

* Move authService.logout call to main program

* Move Key Connector migration check to unlock command

* Use get/setConvertAccountRequired flag

* Move Key Connector convert to own command, set usesKeyConnector after conversion

* Remove KC conversion check from syncCommand, fix callback

* Make class service private

* Fix naming convention

* Update jslib and deps
2022-01-21 06:03:37 +10:00
Addison Beck
cf1e483c7f
[bug] Account for entityId as a userId alternative during state migration (#622)
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.
2022-01-20 14:00:58 -05:00
Oscar Hinton
d1c01a2bb0
Remove account switching border (#1249) 2022-01-20 17:15:29 +01:00
Oscar Hinton
0edee78da1
Change account switching dropdown to align with the right side (#1248) 2022-01-20 16:32:05 +01:00
Addison Beck
7300db703c
[Bug] Change method scope for internal StateMigrationService methods (#619)
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.
2022-01-20 10:30:01 -05:00
Addison Beck
caad11c571
[chore] Update jslib (#1403) 2022-01-20 09:38:34 -05:00
Addison Beck
80c9196e44
[chore] Update jslib (#1247) 2022-01-20 09:26:24 -05:00
Addison Beck
54c6a4b3c3
[bug] Correct scope for several data points (#618)
The following data points are currently scoped to an account but are made global with this commit:
* Enable Menu Bar Icon
* Minimize To Menu Bar
* Close To Menu Bar
* Start To Menu Bar

Note: these are all electron specific fields
2022-01-20 09:03:31 -05:00
Addison Beck
57351d29a2
[bug] Migrate state even if there is not a user logged in (#615)
Currently the StateMigrationService depends on a userId key for running migrations, but if there is not an authenticated user saved to storage that userId is not present.
These changes allow for migrating state data even without an active user. For account specific settings like clearClipboard we now temporarily store those values together in disk state until an account is authed that they can be added to. Temp account state is then cleared.

Some notes:
* In order for this to work we need GlobalState.stateVersion to have a default value of StateVersion.One instead of StateVersion.Latest. Defaulting it to latest was causing migrations to not run on some clients (like desktop) that try to access storage before migrations have been run but save a version as if migrations did run.
* I also noticed we aren't clearing old state items from before migrating, and added a case for this to the migrator.
* I extracted a few bits of reused code into private methods in the stateMigration service. Things like get/set from storage, default options, etc.
2022-01-20 08:30:00 -05:00
Addison Beck
032d2be990
[bug] Remove old mac-bar styling (#1246)
With the account switching work a header was added to the desktop app that new acts as a home for the mac window controls.
Previously we needed a special home for these controls, but since moving them we are not just creating empty space.
Removing this class and the divs that use it corrects the behavior.
2022-01-20 07:44:20 -05:00
Daniel James Smith
a684c102d7
Bump electron from 16.0.2 to 16.0.7 (#1243)
* Pull jslib to bump electron from 16.0.2 to 16.0.7

* Updates to package-lock.json
2022-01-20 12:22:22 +01:00
Thomas Rittson
11e7133aef
Save usesKeyConnector using defaultOnDiskOptions (#617) 2022-01-20 19:32:44 +10:00
Thomas Rittson
9737c829f3
Fix migration to Key Connector in cli commands (#616)
* Move CLI Key Connector check out of base class

* Add missing await

* Move safe operation out of try/catch block

* Move Key Connector migration check to unlock command

* Set convertAccountRequired flag in syncService

* Remove unneeded service
2022-01-20 19:28:48 +10:00
Daniel James Smith
b73449159d
Update copy on fingerprint phrase prompt (#1399) 2022-01-20 10:07:47 +01:00
Daniel James Smith
12bb8b060c
[Account switching] Design changes (#1240)
* Various design changes to the account switcher

* Hide serverUrl on cloud accounts

* Display account limit reached instead of add account
2022-01-19 17:03:34 +01:00
Addison Beck
b796fe094f
[Bug] [Account Switching] Improve State Management Performance (#1237)
* [dep] Implement new StateService factory parameter from jslib

* [bug] Ensure setLastActive uses the correct userId

Sometimes, because of how often it fires, setLastActive can cause accounts to override each other. To make sure the correct userId is always used we now subscribe to activeUser in the appComponent and pass that value into any setLastActive calls.

* [bug] Show loader when logging out

When logging out of a large vault the application can appear to hang. This commit turns on the app component loader while logout is doing work.

* [bug] Stop tracking activity without an active user

* [style] Ran prettier

* [chore] Update jslib
2022-01-19 11:00:28 -05:00
Addison Beck
ccd715d7b8
[Bug] [Account Switching] Improve State Management Performance (#611)
* [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
2022-01-19 10:51:10 -05:00
Kyle Spearrin
922cd1dc54
serve command (#451) 2022-01-19 10:45:14 -05:00
Thomas Rittson
84a0bfb07c
Update jslib (#449) 2022-01-19 07:05:48 +10:00
Daniel James Smith
8b521aa35e
[Account switching] Hide active account (#1241)
* Hide active account from dropdown

* No longer need to check if selected account is active before switching

* Applied feedback from PR review
2022-01-18 21:43:14 +01:00
Vince Grassia
ab7fda888f
Update Version Bump action to latest (#2271) 2022-01-18 10:31:10 -05:00
Oscar Hinton
3cacf8a8c4
Rename package to @bitwarden/desktop (#1242) 2022-01-18 14:04:21 +01:00
Thomas Rittson
cc285e5ea7
Always migrate envUrls (#614) 2022-01-18 13:44:39 +10:00
Daniel James Smith
8460629de4
Bump electron from 16.0.2 to 16.0.7 (#613) 2022-01-17 17:27:14 +01:00
Oscar Hinton
31e433a49b
Rename package to @bitwarden/browser (#2274) 2022-01-17 17:26:35 +01:00
Oscar Hinton
bf48434d0f
Rename package to @bitwarden/web-vault (#1396) 2022-01-17 17:23:14 +01:00
Andrew Marquez
3f4032011a
Send deletedCipher message to messagingService to refresh badge and menu. Fixes #1708 (#2244) 2022-01-17 16:25:32 +01:00
Oscar Hinton
b6d2d5bf71
[BEEEP] Use shared tsconfig (#1393) 2022-01-17 15:53:19 +01:00
Oscar Hinton
12011bf4da
Add a shared tsconfig file (#609) 2022-01-17 13:21:20 +01:00
Vince Grassia
dad1a95fb0
Update Version Bump action to latest (#1238) 2022-01-14 13:32:16 -05:00
Vince Grassia
b6c8307437
Update Version Bump action to latest (#445) 2022-01-14 12:38:38 -05:00
Oscar Hinton
dfd62c7c3a
Fix webpack assets using wrong name (#1391) 2022-01-14 13:35:44 +01:00
github-actions[bot]
5b6e5fc4fa
Autosync the updated translations (#1236)
Co-authored-by: github-actions <>
2022-01-14 11:21:53 +01:00
github-actions[bot]
41d3bd8cf2
Autosync the updated translations (#1389)
Co-authored-by: github-actions <>
2022-01-14 11:21:40 +01:00
github-actions[bot]
c88f9a4140
Autosync the updated translations (#2268)
Co-authored-by: github-actions <>
2022-01-14 11:21:28 +01:00
Oscar Hinton
4644d03b28
Exclude dist-safari from prettier (#1234) 2022-01-13 18:10:59 +01:00
Matt Gibson
3b1ccb409e
Fix/lowdb no cache (#443)
* Add jslib prettier commit to client ignore hashes

* Remove lowdb caching

* Fix state service remove being set to null

* Await in-memory key retrieval

* Fix key loading and unlock requests.

* Linter fixes

* linter fixes

* linter fixes
2022-01-13 11:03:19 -06:00
Daniel James Smith
abede3e5af
Fix logging out of all accounts instead of one (#1231)
When logOut is triggered and the userId is not provided. Retrieve currentUserId
2022-01-13 15:43:00 +01:00
Daniel James Smith
7818ffc2fb
[Account Switching] Fix menus (#1232)
* Fix enabled/disabling menu items with locked state

* Fix the empty about menu (title)

Moved the items to the help menu
2022-01-13 14:29:49 +01:00
Oscar Hinton
b6117d6801
Re-add native dependencies to src/package.json (#1233) 2022-01-13 10:46:33 +01:00
Thomas Rittson
b962af303a
Fix always logging out instead of lock (#444) 2022-01-13 17:35:48 +10:00
Vince Grassia
3292d119fe
Update Version Bump action (#1388) 2022-01-12 16:06:50 -05:00
Thomas Rittson
ddcfe23367
Make lowdbStorageService wait until initialised (#605)
* Make lowdbStorageService wait until initialised

* Fix prettier
2022-01-13 06:18:54 +10:00
Addison Beck
653ff8f45f
[Bug] VaultTimeout incorrectly defaults to "Never" (#1230)
* [Bug] VaultTimeout incorrectly defaults to "Never"

The default desktop vault timeout value is "On Restart", but there is no default set for this in the state service and account model.
This commit extends the StateService and Account model to consider the special vault timeout default requirements needed for desktop.

* [style] Lint fixes

* [chore] Update jslib
2022-01-12 11:37:23 -05:00
Addison Beck
957e010036
[bug] Ensure neverLock vaults can be manually locked (#607)
The client side storage restructuring work incorrectly checks if a vault has ever been unlocked to determine neverLock scenerios, but production does the opposite.
This creates an inability to never manually lock neverLock vaults.
This commit sets that condition back to the way it was.
2022-01-12 11:32:45 -05:00
Daniel James Smith
71c2fee574
Close opened AccountSwitcher dropdown (#1228)
When a user clicks outside of an opened account switching dropdown, it should close automatically when clicking outside of the dropdown.
2022-01-12 17:20:19 +01:00
Daniel James Smith
d885e3296b
Do not switch accounts if it is already the active account (#1229) 2022-01-12 17:20:07 +01:00
Addison Beck
c7ccb997bd
[bug] Use the correct login url in lock guard (#606) 2022-01-12 10:15:39 -05:00