1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-07-16 13:55:52 +02:00
bitwarden-browser/apps/desktop
Justin Baur e1b5b83723
Add State Provider Framework (#6640)
* Add StateDefinition

Add a class for encapsulation information about state
this will often be for a domain but creations of this will
exist outside of a specific domain, hence just the name State.

* Add KeyDefinition

This adds a type that extends state definition into another sub-key
and forces creators to define the data that will be stored and how
to read the data that they expect to be stored.

* Add key-builders helper functions

Adds to function to help building keys for both keys scoped
to a specific user and for keys scoped to global storage.

Co-authored-by: Matt Gibson <MGibson1@users.noreply.github.com>

* Add updates$ stream to existing storageServices

Original commit by Matt: 823d9546fe
Co-authored-by: Matt Gibson <MGibson1@users.noreply.github.com>

* Add fromChromeEvent helper

Create a helper that creats an Observable from a chrome event
and removes the listener when the subscription is completed.

* Implement `updates$` property for chrome storage

Use fromChromeEvent to create an observable from chrome
event and map that into our expected shape.

* Add GlobalState Abstractions

* Add UserState Abstractions

* Add Default Implementations of User/Global state

Co-authored-by: Matt Gibson <MGibson1@users.noreply.github.com>

* Add Barrel File for state

Co-authored-by: Matt Gibson <MGibson1@users.noreply.github.com>

* Fix ChromeStorageServices

* Rework fromChromeEvent

Rework fromChromeEvent so we have to lie to TS less and
remove unneeded generics. I did this by caring less about
the function and more about the parameters only.

Co-authored-by: Matt Gibson <MGibson1@users.noreply.github.com>

* Fix UserStateProvider Test

* Add Inner Mock & Assert Calls

* Update Tests to use new keys

Use different key format

* Prefer returns over mutations in update

* Update Tests

* Address PR Feedback

* Be stricter with userId parameter

* Add Better Way To Determine if it was a remove

* Fix Web & Browser Storage Services

* Fix Desktop & CLI Storage Services

* Fix Test Storage Service

* Use createKey Helper

* Prefer implement to extending

* Determine storage location in providers

* Export default providers publicly

* Fix user state tests

* Name tests

* Fix CLI

* Prefer Implement In Chrome Storage

* Remove Secure Storage Option

Also throw an exception for subscribes to the secure storage observable.

* Update apps/browser/src/platform/browser/from-chrome-event.ts

Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com>

* Enforce state module barrel file

* Fix Linting Error

* Allow state module import from other modules

* Globally Unregister fromChromeEvent Listeners

Changed fromChromeEvent to add its listeners through the BrowserApi, so that
they will be unregistered when safari closes.

* Test default global state

* Use Proper Casing in Parameter

* Address Feedback

* Update libs/common/src/platform/state/key-definition.ts

Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com>

* Add `buildCacheKey` Method

* Fix lint errors

* Add Comment

Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com>

* Use Generic in callback parameter

* Refactor Out DerivedStateDefinition

* Persist Listener Return Type

* Add Ticket Link

---------

Co-authored-by: Matt Gibson <MGibson1@users.noreply.github.com>
Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com>
2023-11-09 17:06:42 -05:00
..
.vscode Multi root workspace tweaks (#2858) 2022-06-13 21:39:36 -05:00
config Individual Vault Item Encryption Feature (#6241) 2023-09-28 08:44:57 -04:00
desktop_native [BEEEP] [PM-565] Implement clipboard logic in rust (#4516) 2023-10-02 18:50:57 +02:00
native-messaging-test-runner Update dependency uuid to v9 (#5960) 2023-08-21 16:58:21 +00:00
resources Update Plist files for MAS (#2951) 2022-06-22 15:10:21 -04:00
scripts [PM-3996] Scaffolding for preload script (#6065) 2023-10-12 11:50:17 +02:00
src Add State Provider Framework (#6640) 2023-11-09 17:06:42 -05:00
stores Update year in copyrights (#4325) 2022-12-28 21:59:23 +01:00
.eslintrc.json [EC-184] Desktop cleanup (#2553) 2022-05-05 19:03:56 +02:00
.gitignore Simplify our gitignore files (#2925) 2022-06-17 15:33:51 +02:00
crowdin.yml Fix Crowdin Pull workflow (#2667) 2022-05-10 10:20:32 -04:00
electron-builder.json [PM-4300] downgrade electron to v25.9.1 (#6573) 2023-10-13 10:26:56 -04:00
installer.nsh Add NSIS custom installer script for UAC fix on Windows (#2856) 2022-06-08 08:47:10 -04:00
jest.config.js [PM-2328] Fix jest deprecations (#5483) 2023-05-22 20:19:16 +02:00
package.json Bumped desktop version to 2023.10.2 (#6833) 2023-11-08 11:17:35 -05:00
postcss.config.js [PM-2237] Add tailwind to desktop & browser (#5326) 2023-07-14 15:03:42 -04:00
README.md Update urls to match the contributing docs (#4192) 2022-12-06 11:20:27 +01:00
sign.js Move desktop into apps/desktop 2022-05-05 17:20:34 +02:00
tailwind.config.js [PM-2237] Add tailwind to desktop & browser (#5326) 2023-07-14 15:03:42 -04:00
test.setup.ts [SG-397] Configure jest for Desktop and add simple tests (#3467) 2022-09-15 12:31:15 -04:00
tsconfig.json [PM-4222] Make importer UI reusable (#6504) 2023-10-19 11:17:23 +02:00
tsconfig.renderer.json Add support for migrated jslib (#2826) 2022-06-03 18:01:07 +02:00
tsconfig.spec.json [SG-397] Configure jest for Desktop and add simple tests (#3467) 2022-09-15 12:31:15 -04:00
webpack.main.js [PM-3996] Scaffolding for preload script (#6065) 2023-10-12 11:50:17 +02:00
webpack.preload.js [PM-3996] Scaffolding for preload script (#6065) 2023-10-12 11:50:17 +02:00
webpack.renderer.js Noop notifications for dev (#6671) 2023-10-24 15:18:23 +02:00

Github Workflow build on master Crowdin Join the chat at https://gitter.im/bitwarden/Lobby

Bitwarden Desktop Application

Platforms

The Bitwarden desktop app is written using Electron and Angular. The application installs on Windows, macOS, and Linux distributions.

Desktop Vault

Documentation

Please refer to the Desktop section of the Contributing Documentation for build instructions, recommended tooling, code style tips, and lots of other great information to get you started.