Remove old compile flags which should no longer be required, and may even cause issues. secretsManager: false hides the app switcher which is now used for more than just secrets manager.
* Replacing state service with state provider
* Documentation indicating the differences between the 2 states used.
* Creating key definition, updating comments, and modifying test cases
* Adding the key definitions tests
* Documenting the observables
* Fixing the test issue with the awaitAsync import
* Removing browser state service stuff for merge fix
* no need to redefine interface members
* Renaming to DefaultBrowserStateService
* Specify user clear events for event upload
* Specify generator clear events
* Specify clear events for user send data
* Specify generic clear on logout for encrypted secret state
* Allow `clearOn`event to be passed into secret state
* Match current data persistence rules
* Clear ui memory on lock + logout
Unit tests trim vertical pipes when appear in the data packer's JSON data, but electron is not as forgiving. It throws errors in this situation. This fixes the error by trimming the pipes before b64 decoding the result.
* create mp and kdf service
* update mp service interface to not rely on active user
* rename observable methods
* update crypto service with new MP service
* add master password service to login strategies
- make fake service for easier testing
- fix crypto service tests
* update auth service and finish strategies
* auth request refactors
* more service refactors and constructor updates
* setMasterKey refactors
* remove master key methods from crypto service
* remove master key and hash from state service
* missed fixes
* create migrations and fix references
* fix master key imports
* default force set password reason to none
* add password reset reason observable factory to service
* remove kdf changes and migrate only disk data
* update migration number
* fix sync service deps
* use disk for force set password state
* fix desktop migration
* fix sso test
* fix tests
* fix more tests
* fix even more tests
* fix even more tests
* fix cli
* remove kdf service abstraction
* add missing deps for browser
* fix merge conflicts
* clear reset password reason on lock or logout
* fix tests
* fix other tests
* add jsdocs to abstraction
* use state provider in crypto service
* inverse master password service factory
* add clearOn to master password service
* add parameter validation to master password service
* add component level userId
* add missed userId
* migrate key hash
* fix login strategy service
* delete crypto master key from account
* migrate master key encrypted user key
* rename key hash to master key hash
* use mp service for getMasterKeyEncryptedUserKey
* fix tests
In https://github.com/bitwarden/clients/pull/8133 the premium state changed to
be derived from observables, which means we can get rid of the `purchasePremium`
messages that are sent and instead rely directly on the observable to distribute
the state.
* introduce legacy generators
* introduce generator navigation service
* Introduce default options. These accept a userId so that they can be policy-defined
* replace `GeneratorOptions` with backwards compatible `GeneratorNavigation`
* Adding the key definitions and tests and initial send state service
* Adding the abstraction and implementing
* Planning comments
* Everything but fixing the send tests
* Moving send tests over to the state provider
* jslib needed name refactor
* removing get/set encrypted sends from web vault state service
* browser send state service factory
* Fixing conflicts
* Removing send service from services module and fixing send service observable
* Commenting the migrator to be clear on why only encrypted
* No need for service factories in browser
* browser send service is no longer needed
* Key def test cases to use toStrictEqual
* Running prettier
* Creating send test data to avoid code duplication
* Adding state provider and account service to send in cli
* Fixing the send service test cases
* Fixing state definition keys
* Moving to observables and implementing encryption service
* Fixing key def tests
* The cli was using the deprecated get method
* The observables init doesn't need to happen in constructor
* Missed commented out code
* If enc key is null get user key
* Service factory fix
* implementing the clients changes
* resolve pr comments on message.json
* moved the method to billing-api.service
* move the request and response files to billing folder
* remove the adding existing orgs
* resolve the routing issue
* resolving the pr comments
* code owner changes
* fix the assignedseat
* resolve the warning message
* resolve the error on update
* passing the right id
* resolve the unassign value
* removed unused logservice
* Adding the loader on submit button
* PM-5434 Initial work on migration
* PM-5434 Migration and tests
* PM-5434 Remove unnecessary comments
* PM-5434 Add unit tests
* PM-5434 Reverted last changes
* PM-5434 Added unit test for deserialize
* PM-5434 Minor changes
* PM-5434 Fix pr comments
* PM-5268 - Add DEVICE_TRUST_DISK to state definitions
* PM-5268 - DeviceTrustCryptoService - Get most of state provider refactor done - WIP - commented out stuff for now.
* PM-5268 - DeviceTrustCryptoServiceStateProviderMigrator - WIP - got first draft of migrator in place and working on tests. Rollback tests are failing for some reason TBD.
* PM-5268 - more WIP on device trust crypto service migrator tests
* PM-5268 - DeviceTrustCryptoServiceStateProviderMigrator - Refactor based on call with platform
* PM-5268 - DeviceTrustCryptoServiceStateProviderMigrator - tests passing
* PM-5268 - Update DeviceTrustCryptoService to convert over to state providers + update all service instantiations / dependencies to ensure state provider is passed in or injected.
* PM-5268 - Register new migration
* PM-5268 - Temporarily remove device trust crypto service from migrator to ease merge conflicts as there are 6 more migrators before I can apply mine in main.
* PM-5268 - Update migration numbers of DeviceTrustCryptoServiceStateProviderMigrator based on latest migrations from main.
* PM-5268 - (1) Export new KeyDefinitions from DeviceTrustCryptoService for use in test suite (2) Update DeviceTrustCryptoService test file to use state provider.
* PM-5268 - Fix DeviceTrustCryptoServiceStateProviderMigrator tests to use proper versions
* PM-5268 - Actually fix all instances of DeviceTrustCryptoServiceStateProviderMigrator test failures
* PM-5268 - Clean up state service, account, and login strategy of all migrated references
* PM-5268 - Account - finish cleaning up device key
* PM-5268 - StateService - clean up last reference to device key
* PM-5268 - Remove even more device key refs. *facepalm*
* PM-5268 - Finish resolving merge conflicts by incrementing migration version from 22 to 23
* PM-5268 - bump migration versions
* PM-5268 - DeviceTrustCryptoService - Implement secure storage functionality for getDeviceKey and setDeviceKey (to achieve feature parity with the ElectronStateService implementation prior to the state provider migration). Tests to follow shortly.
* PM-5268 - DeviceTrustCryptoService tests - getDeviceKey now tested with all new secure storage scenarios. SetDeviceKey tests to follow.
* PM-5268 - DeviceTrustCryptoService tests - test all setDeviceKey scenarios with state provider & secure storage
* PM-5268 - Update DeviceTrustCryptoService deps to actually use secure storage svc on platforms that support it.
* PM-5268 - Bump migration version due to merge conflicts.
* PM-5268 - Bump migration version
* PM-5268 - tweak jsdocs to be single line per PR feedback
* PM-5268 - DeviceTrustCryptoSvc - improve debuggability.
* PM-5268 - Remove state service as a dependency on the device trust crypto service (woo!)
* PM-5268 - Update migration test json to correctly reflect reality.
* PM-5268 - DeviceTrustCryptoSvc - getDeviceKey - add throw error for active user id missing.
* PM-5268 - Fix tests
* PM-5268 - WIP start on adding user id to every method on device trust crypto service.
* PM-5268 - Update lock comp dependencies across clients
* PM-5268 - Update login via auth request deps across clients to add acct service.
* PM-5268 - UserKeyRotationSvc - add acct service to get active acct id for call to rotateDevicesTrust and then update tests.
* PM-5268 - WIP on trying to fix device trust crypto svc tests.
* PM-5268 - More WIP device trust crypto svc tests passing
* PM-5268 - Device Trust crypto service - get all tests passing
* PM-5268 - DeviceTrustCryptoService.getDeviceKey - fix secure storage b64 to symmetric crypto key conversion
* PM-5268 - Add more tests and update test names
* PM-5268 - rename state to indicate it was disk local
* PM-5268 - DeviceTrustCryptoService - save symmetric key in JSON format
* PM-5268 - Fix lock comp tests by adding acct service dep
* PM-5268 - Update set device key tests to pass
* PM-5268 - Bump migration versions again
* PM-5268 - Fix user key rotation svc tests
* PM-5268 - Update web jest config to allow use of common spec in user-key-rotation-svc tests
* PM-5268 - Bump migration version
* PM-5268 - Per PR feedback, save off user id
* PM-5268 - bump migration version
* PM-5268 - Per PR feedback, remove unnecessary await.
* PM-5268 - Bump migration verson
* introduce `GeneratorHistoryService` abstraction
* implement generator history service with `LocalGeneratorHistoryService`
* cache decrypted data using `ReplaySubject` instead of `DerivedState`
* move Jsonification from `DataPacker` to `SecretClassifier` because the classifier
is the only component that has full type information. The data packer still handles
stringification.
We currently use a callback syntax for abstract services. This syntax isn't completely strict compliant and will fail the strictPropertyInitialization check. We also currently don't get any compile time errors if we forget to implement a function.
To that end this PR updates all platform owned services to use the appropriate abstract keyword for non implemented functions. I also updated the fields to be actual functions and not properties.
* PM-7092 - Fix CLI login via API key not working (it apparently receives an undefined refresh token which was rejected by setTokens)
* PM-7092 - Fix base login strategy tests
* PM-7092 - per discucssion with jake, refactor setTokens to accept optional refresh token instead of exposing setRefreshToken as public.
* Create tracker that can await until expected observables are received.
* Test dates are almost equal
* Remove unused class method
* Allow for updating active account in accout service fake
* Correct observable tracker behavior
Clarify documentation
* Transition config service to state provider
Updates the config fetching behavior to be lazy and ensure that any emitted value has been updated if older than a configurable value (statically compiled).
If desired, config fetching can be ensured fresh through an async.
* Update calls to config service in DI and bootstrapping
* Migrate account server configs
* Fix global config fetching
* Test migration rollback
* Adhere to implementation naming convention
* Adhere to abstract class naming convention
* Complete config abstraction rename
* Remove unnecessary cli config service
* Fix builds
* Validate observable does not complete
* Use token service to determine authed or unauthed config pull
* Remove superfluous factory config
* Name describe blocks after the thing they test
* Remove implementation documentation
Unfortunately the experience when linking to external documentation is quite poor. Instead of following the link and retrieving docs, you get a link that can be clicked to take you out of context to the docs. No link _does_ retrieve docs, but lacks indication in the implementation that documentation exists at all.
On the balance, removing the link is the better experience.
* Fix storybook
* PM-5263 - TokenSvc - WIP on access token secure storage refactor
* PM-5263 - Add key generation svc to token svc.
* PM-5263 - TokenSvc - more progress on encrypt access token work.
* PM-5263 - TokenSvc TODO cleanup
* PM-5263 - TokenSvc - rename
* PM-5263 - TokenSvc - decryptAccess token must return null as that is a valid case.
* PM-5263 - Add EncryptSvc dep to TokenSvc
* PM-5263 - Add secure storage to token service
* PM-5263 - TokenSvc - (1) Finish implementing accessTokenKey stored in secure storage + encrypted access token stored on disk (2) Remove no longer necessary migration flag as the presence of the accessTokenKey now serves the same purpose.
Co-authored-by: Jake Fink <jfink@bitwarden.com>
* PM-5263 - TokenSvc - (1) Tweak return structure of decryptAccessToken to be more debuggable (2) Add TODO to add more error handling.
* PM-5263 - TODO: update tests
* PM-5263 - add temp logs
* PM-5263 - TokenSvc - remove logs now that I don't need them.
* fix tests for access token
* PM-5263 - TokenSvc test cleanup - small tweaks / cleanup
* PM-5263 - TokenService - per PR feedback from Justin - add error message to error message if possible.
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
---------
Co-authored-by: Jake Fink <jfink@bitwarden.com>
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
* Fallback to Emitting `null` When No Active User
* Fix Tests
* Update Test Names to Follow Convention
Co-authored-by: Andreas Coroiu <acoroiu@bitwarden.com>
* Fix CLI Build
---------
Co-authored-by: Andreas Coroiu <acoroiu@bitwarden.com>
* PM-5263 - Update token svc state provider migration to avoid persisting secrets that shouldn't exist in local storage to state provider local storage using new migration helper type.
* PM-5263 - TokenSvc migration - tests TODO
* write tests for migration
* fix tests
---------
Co-authored-by: Jake Fink <jfink@bitwarden.com>
This enables it being shown as anm option with the language selector on the individual clients
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
* updated vault filter service to make use of collection service
* removed fix me
* reverted to use reload collections on org vault as collection admin service does not support state management yet
* fixed statement
* WIP: First Try at making DesktopSettingsService
Does not work, migrations are ran in renderer but the values are read in main.
* Update window$ retrieval
* Fix DesktopSettings
* Rename Migration
* Add Migration to Builder
* Cleanup
* Update Comments
* Update `migrate.ts`
* Catch Unawaited Promises
* Remove Comments
* Update Tests
* Rename Migration
* Add `alwaysOnTop`
* Make `init` async
* Fix Desktop Build
* Fix error on close due to context differences in background
Desktop background does not have active user information. Also, we want to delete _all_ prompt cancelled data, not just that for the active user. Storing this on global and manipulating observables to active achieves this without needing any user information in the background.
* Remove potentially orphaned data
* Throw nice error if prompt cancelled used without active user
* Register migration
* split prompt cancelled reset to user-specific and global