1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-19 02:51:14 +02:00
Commit Graph

987 Commits

Author SHA1 Message Date
Cesar Gonzalez
7e6d76e50c
[PM-6426] Changing the name of the state definition for the TaskScheduler 2024-04-01 16:07:19 -05:00
Cesar Gonzalez
638554e164
[PM-6426] Ensuring that we await clearing an established scheduled task for the notification service 2024-04-01 16:05:10 -05:00
Cesar Gonzalez
f52849d159
[PM-6426] Refactoring small detail for how we identify the clear clipboard timeout in SystemService 2024-04-01 16:00:50 -05:00
Cesar Gonzalez
c365de4747
[PM-6426] Fixing dependency references in services.module.ts 2024-04-01 15:35:41 -05:00
Cesar Gonzalez
ada03c656d
[PM-6426] Renaming the scheduleNextSync alarm name 2024-04-01 15:27:38 -05:00
Cesar Gonzalez
83cb105b49
[PM-6426] Merging main into branch 2024-04-01 15:18:50 -05:00
Jared Snider
c202c93378
Auth/PM-5268 - DeviceTrustCryptoService state provider migration (#7882)
* 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
2024-04-01 16:02:58 -04:00
Justin Baur
94843bdd8b
[PM-5956] Delete Unused State (#8439)
* Delete Unused State

* Delete One More

* Add Migration to Delete InstalledVersion

* Update Error
2024-04-01 15:36:39 -04:00
Jake Fink
bd7c10705d
add clarification around null in state provider (#8567)
* add clarification around null in state provider

* Update libs/common/src/platform/state/user-state.ts

Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>

---------

Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
2024-04-01 15:32:11 -04:00
Justin Baur
45f9f5695e
Add Custom ErrorHandler (#8543) 2024-04-01 15:29:04 -04:00
Matt Gibson
136226b6be
Observable auth statuses (#8537)
* Observable has token

* Allow access to user key state observable

* Create observable auth status

* Fix DI
2024-04-01 19:15:54 +00:00
Cesar Gonzalez
52f914bead
[PM-6426] Adding jest tests for the base TaskSchedulerService class 2024-04-01 14:11:58 -05:00
Cesar Gonzalez
2ebce58f28
[PM-6426] Implementing eventUploadInterval using TaskScheduler 2024-04-01 12:12:04 -05:00
Cesar Gonzalez
752df0612d
[PM-6426] Implementing sessionTimeout for LoginStrategyService using TaskSchedulerService 2024-04-01 12:08:16 -05:00
Cesar Gonzalez
1965d0e048
[PM-6426] Implementing reconnect timer timeout for NotificationService using the TaskSchedulerService 2024-04-01 12:02:28 -05:00
Cesar Gonzalez
5d41e8b627
[PM-6426] Implementing reconnect timer timeout for NotificationService using the TaskSchedulerService 2024-04-01 12:00:46 -05:00
Cesar Gonzalez
f60a37fe2c
[PM-6426] Implementing abortTimeout for Fido2ClientService using TaskSchedulerService 2024-04-01 11:56:35 -05:00
Cesar Gonzalez
0444489053
[PM-6426] Implementing systemClearClipboard using TaskScheduler 2024-04-01 10:13:47 -05:00
Cesar Gonzalez
66ebdc04c8
[PM-6426] Create TaskSchedulerService and update usage of long lived timeouts 2024-04-01 09:28:19 -05:00
rr-bw
2e51d96416
[PM-5264] Implement StateProvider in LoginEmailService (#7662)
* setup StateProvider in LoginService

* replace implementations

* replace implementation

* remove stateService

* change storage location for web to 'disk-local'

* implement migrate() method of Migrator

* add RememberedEmailMigrator to migrate.ts

* add rollback

* add tests

* replace implementation

* replace implementation

* add StateProvider to Desktop services

* rename LoginService to RememberEmailService

* update state definition

* rename file

* rename to storedEmail

* rename service to EmailService to avoid confusion

* add jsdocs

* refactor login.component.ts

* fix typos

* fix test

* rename to LoginEmailService

* update factory

* more renaming

* remove duplicate logic and rename method

* convert storedEmail to observable

* refactor to remove setStoredEmail() method

* move service to libs/auth/common

* address floating promises

* remove comment

* remove unnecessary deps in service registration
2024-03-30 11:00:27 -07:00
SmithThe4th
3a830789ba
[PM-5884] Allow deletion of passkey from edit view - clients (#8500)
* add remove button for passkeys during edit

* added live region to announce when a passkey is removed

* removed announce passkey removed by SR

* removed unused variable
2024-03-29 10:06:50 -04:00
Jared Snider
ebe5a46b57
PM-5263 - Clear all tokens on logout (#8536) 2024-03-28 16:56:02 -04:00
Ike
3d19e3489c
[PM-5269] Key Connector state migration (#8327)
* key connector migration initial

* migrator complete

* fix dependencies

* finalized tests

* fix deps and sync main

* clean up definition file

* fixing tests

* fixed tests

* fixing CLI, Browser, Desktop builds

* fixed factory options

* reverting exports

* implemented UserKeyDefinition clearOn

* Update KeyConnector MIgration

* updated migrator and tests to match profile object

* removed unused service and updated clear

* dep fix

* dep fixes

* clear usesKeyConnector on logout
2024-03-28 12:50:24 -04:00
✨ Audrey ✨
df058ba399
[PM-6146] generator history (#8497)
* 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.
2024-03-28 12:19:12 -04:00
Victoria League
65353ae71d
[CL-215] Fix broken icon stories and clarify usage (#8484) 2024-03-28 10:26:26 -04:00
Jake Fink
bd6b3266d4
move auth request notification to service (#8451)
- cleanup hanging promises
2024-03-28 09:34:21 -04:00
Oscar Hinton
2edc156dd6
[STRICT TS] Migrate platform abstract services functions (#8527)
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.
2024-03-28 12:01:09 +01:00
Thomas Rittson
d10c14791d
[AC-2329] [BEEEP] Use safeProvider in desktop services module (#8457) 2024-03-27 18:44:08 -04:00
Thomas Rittson
b3b344866e
[AC-2278] [AC-2296] Use SafeProvider in browser services module (#8418) 2024-03-28 08:28:51 +10:00
Thomas Rittson
5cb2e99b2f
[AC-1724] Remove BulkCollectionAccess feature flag (#8502) 2024-03-28 08:08:28 +10:00
Jared Snider
8cdc94076e
Auth/PM-7092 - Fix CLI login via API key not working due to TokenService changes (#8499)
* 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.
2024-03-27 17:46:56 -04:00
Jake Fink
d9bec7f984
send captcha bypass token on 2fa token request (#8511) 2024-03-27 17:22:56 -04:00
Jake Fink
aaa745ec36
Return correct master password hash from login strategies (#8518) 2024-03-27 17:17:17 -04:00
Jake Fink
5de2177175
only initialize user decryption options if present on response obj (#8508) 2024-03-27 13:27:44 -04:00
Matt Gibson
62ad39e697
Ps/pm 5965/better config polling (#8325)
* 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
2024-03-27 10:03:09 -07:00
Daniel James Smith
64d6f6fef3
Move export.component from @bitwarden/angular to @bitwarden/vault-export-ui (#8514)
Move export.component
Export from @bitwarden/vault-export-ui
Fix imports on browser, desktop and web

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-03-27 17:02:56 +00:00
Shane Melton
3f6a567122
[AC-2351] Call filterCollections within the organizations$ subscription to avoid race condition (#8498) 2024-03-27 08:47:23 -07:00
Jared Snider
a66e224d32
Auth/PM-7072 - Token Service - Access Token Secure Storage Refactor (#8412)
* 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>
2024-03-26 18:41:14 -04:00
Jason Ng
7f55833974
[AC-2285] Edit Unassigned Ciphers in AC Bug (#8410)
* check if cipher is unassigned and call the proper service between cipherService get and apiService get. also check for custom user permissions
2024-03-26 15:22:35 -04:00
Justin Baur
f7014a973c
[PM-7071] Fallback to Emitting null When No Active User (#8486)
* 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>
2024-03-26 12:06:33 -04:00
Jake Fink
7f14ee4994
add back call to verify by PIN (#8495) 2024-03-26 12:00:30 -04:00
Jake Fink
a46767dee2
add auth status to auth service (#8377)
* add auth status to auth service

* fix auth service factory
2024-03-26 13:56:20 +00:00
✨ Audrey ✨
d000f081da
[PM-6556] reintroduce policy reduction for multi-org accounts (#8409) 2024-03-26 07:59:45 -04:00
Jared Snider
899172722a
Auth/PM-5263 - TokenService State provider migration bug fix to avoid persisting tokens in local storage (#8413)
* 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>
2024-03-25 16:26:27 -04:00
aj-rosado
b180463cc0
Changed logic to validate if cipher has a collection on targetSelector method (#8422)
Added tests to import.service.spec.ts that test if the collectionRelationship and folderRelationship properly adapts
2024-03-25 18:10:40 +00:00
Justin Baur
908d3d165e
[PM-6965] Add type Property to MigrationHelper (#8411)
* Add `type` Property to `MigrationHelper`

* Fix Tests

* Make `type` parameter required

* Fix mockHelper.type

* Remove `readonly` from `type`
2024-03-25 14:28:42 +00:00
Daniel James Smith
eea4d5407d
Add the missing languages to the translation.service (#8459)
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>
2024-03-25 11:12:32 +01:00
Shane Melton
bac0874dc0
[PM-2383] Bulk collection assignment (#8429)
* [PM-2383] Add bulkUpdateCollectionsWithServer method to CipherService

* [PM-2383] Introduce bulk-collection-assignment-dialog.component

* [PM-2383] Add bulk assign collections option to org vault
2024-03-22 13:16:29 -07:00
Oscar Hinton
51f46e797c
[PM-5571] Migrate enableDDG to state provider framework (#8384)
Migrate enableDuckDuckGo to state provider framework.
2024-03-22 13:32:03 -04:00
Victoria League
0f375c3a0e
[CL-146] Add kitchen sink story (#8310) 2024-03-22 10:17:00 -04:00