1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-18 02:41:15 +02:00
Commit Graph

565 Commits

Author SHA1 Message Date
Matt Gibson
8ee1965832
Revert "Use global state for biometric prompt cancel storage (#8328)" (#8351)
This reverts commit 770f782a16.
2024-03-15 11:28:34 -04:00
Jonathan Prusik
ac7d80980d
remove unused services (#8334) 2024-03-15 14:11:16 +00:00
Matt Gibson
770f782a16
Use global state for biometric prompt cancel storage (#8328)
* 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
2024-03-15 09:07:22 -04:00
Justin Baur
1e921eb4f6
getUserState$ Helper Improvements (#8267)
* Block Sending Null to `getUser`

* Update Comments & Tests

Co-authored-by: Matt Gibson <mgibson@bitwarden.com>

* Update Comment

* Update Fake

---------

Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
2024-03-15 09:05:04 -04:00
Matt Gibson
e9a34ac5b8
Fix and test hasUserKey implementation (#8336) 2024-03-14 20:59:30 -04:00
Thomas Rittson
5506842623
[AC-2171] Member modal - limit admin access - editing self (#8299)
* If editing your own member modal, you cannot add new collections or groups
  * Update forms to prevent this
  * Add helper text
* Delete unused api method
2024-03-15 09:33:15 +10:00
Justin Baur
1d76e80afb
Refactor State Providers (#8273)
* Delete A Lot Of Code

* Fix Tests

* Create SingleUserState Provider Once

* Update Manual Instantiations

* Fix Service Factory

* Delete More

* Delete Unused `updatePromise`

* `postStorageSave` -> `doStorageSave`

* Update Comment

* Fix jslib-services
2024-03-14 16:38:22 -05:00
Jonathan Prusik
4f8fa57b9d
fix default value for autoCopyTotp (#8287) 2024-03-14 20:34:07 +00:00
rr-bw
65b7ca7177
[PM-5266] Create Avatar Service (#7905)
* rename file, move, and update imports

* refactor and implement StateProvider

* remove comments

* add migration

* use 'disk-local' for web

* add JSDoc comments

* move AvatarService before SyncService

* create factory

* replace old method with observable in story

* fix tests

* add tests for migration

* receive most recent avatarColor emission

* move logic to component

* fix CLI dependency

* remove BehaviorSubject

* cleanup

* use UserKeyDefinition

* avoid extra write

* convert to observable

* fix tests
2024-03-14 09:56:48 -07:00
SmithThe4th
ebf51ebaaf
[PM-5433] Migrate Showcards and Showidentities on current tab to state provider (#8252)
* added showCards and Identities to vault settings and then added migration file

* added migration file and removed fields from domain

* fixed merge conflicts
2024-03-14 11:37:57 -04:00
Matt Gibson
d28634b068
Log key when no active user found (#8326) 2024-03-13 17:21:33 -04:00
Matt Gibson
25f89e2a1c
[PM-6769] [SM-1158] Fix Translation pipe issues on main (#8319)
* Require init in i18n service.

this is needed to load translations and set translation locale

* No longer need to cast i18n

* Expose user preferred locale in i18nService

This is for correctly displaying `default` when no locale has been set in preferences components. The `locale$` observable should always resolve to the currently locale currently being translated to.
2024-03-13 11:35:46 -04:00
Justin Baur
e6fe0d1d13
[PM-5539] Migrate ThemingService (#8219)
* Update ThemingService

* Finish ThemingService

* Lint

* More Tests & Docs

* Refactor to ThemeStateService

* Rename File

* Fix Import

* Remove `type` added to imports

* Update InitServices

* Fix Test

* Remove Unreferenced Code

* Remove Unneeded Null Check

* Add Ticket Link

* Add Back THEMING_DISK

* Fix Desktop

* Create SYSTEM_THEME_OBSERVABLE

* Fix Browser Injection

* Update Desktop Manual Access

* Fix Default Theme

* Update Test
2024-03-13 15:25:39 +00:00
Justin Baur
8f8385d822
Reorder import (#8313) 2024-03-12 17:38:28 -05:00
Justin Baur
3175b20ca5
Add UserKeyDefinition to union (#8298) 2024-03-12 21:10:01 +00:00
Jonathan Prusik
0a595ea95e
[PM-5562] Implement Domain Settings state provider (#8226)
* create domain settings state provider

* replace callsites for defaultUriMatch and neverDomains with DomainSettingsService equivalents

* replace callsites for equivalentDomains with DomainSettingsService equivalents and clean up unused AccountSettingsSettings

* add migrations for domain settings state

* do not use enum for URI match strategy constants and types

* add getUrlEquivalentDomains test

* PR suggestions/cleanup

* refactor getUrlEquivalentDomains to return an observable

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

* update tests

* add UriMatchStrategy docs notes

* service class renames

* use service abstraction at callsites previously using service class directly

---------

Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
Co-authored-by:  Audrey  <ajensen@bitwarden.com>
2024-03-12 15:07:14 -04:00
Jake Fink
a0e0637bb6
[PM-5255, PM-3339] Refactor login strategy to use state providers (#7821)
* add key definition and StrategyData classes

* use state providers for login strategies

* serialize login data for cache

* use state providers for auth request notification

* fix registrations

* add docs to abstraction

* fix sso strategy

* fix password login strategy tests

* fix base login strategy tests

* fix user api login strategy tests

* PM-3339 add tests for admin auth request in sso strategy

* fix auth request login strategy tests

* fix webauthn login strategy tests

* create login strategy state

* use barrel file in common/spec

* test login strategy cache deserialization

* use global state provider

* add test for login strategy service

* fix auth request storage

* add recursive prototype checking and json deserializers to nested objects

* fix CLI

* Create wrapper for login strategy cache

* use behavior subjects in strategies instead of global state

* rename userApi to userApiKey

* pr feedback

* fix tests

* fix deserialization tests

* fix tests

---------

Co-authored-by: rr-bw <102181210+rr-bw@users.noreply.github.com>
2024-03-12 14:19:50 -04:00
rr-bw
790b310d22
[PM-5270] Update PasswordResetEnrollmentService to take dependency on AccountService (#8080)
* take dependency on AccountService

* update test
2024-03-12 10:11:42 -07:00
Matt Gibson
5feb9af051
[PM-6654] new app id service for angular (#8229)
* Improve state documentation

* Add namespace for application id

* Spec out behavior of app id service

* Use state providers for app ids

* Migrate app Id

* Add reactive interface
2024-03-12 11:12:40 -04:00
Matt Gibson
f4150ffda6
[PM-6511] New i18n for angular (#8122)
* Use state provider to store preferred language

* migrate preferred language

* Use new i18n provider to get LOCAL_ID

* Fix preloaded english i18n

This is a mock service that forces english translations, it doesn't need the i18n interface that allows changing of locales.

* PR improvements

* Fixup merge
2024-03-11 13:59:19 -04:00
Justin Baur
a803b67f4f
Consider Higher StateVersion "ready" (#8255) 2024-03-08 10:54:12 -05:00
Jonathan Prusik
f90de62adc
[PM-6382] Migrate disableContextMenuItem to Autofill Settings state (#8246)
* add enableContextMenu to autofillSettings and migrate disableContextMenuItem

* replace usages of disableContextMenuItem with autofill settings service global enableContextMenu
2024-03-08 15:34:07 +00:00
Matt Gibson
f83dcf2b24
Move fingerprint validated to biometric state povider (#8058) 2024-03-07 19:41:56 -06:00
Thomas Rittson
eedd6f0881
[AC-2008] [AC-2123] [Pt 2] Transition PolicyService to use StateProvider (#7977)
* fully wire up StateProvider within PolicyService
* migrate old policy data to new location
* minor update to existing interfaces
2024-03-08 10:26:00 +10:00
✨ Audrey ✨
c7318311af
[PM-5974] introduce ForwarderGeneratorStrategy (#8207)
* update defaults to include `website` parameter
* update utilities tests to include `website` parameter
2024-03-07 12:45:56 -05:00
Jonathan Prusik
c52456cbb6
[AC-2248][PM-5352] Bugfix - Fix non-working policy state in autofill settings service (#8156)
* fix broken policy state in autofill settings service

* cleanup and re-org

* move toast display tracking value and update to autofill settings state
2024-03-06 16:07:46 -05:00
Matt Gibson
c14091904b
Propose team as a first pass organization to state definitions (#8225) 2024-03-06 17:48:28 +00:00
Merissa Weinstein
5dcc035245
[PM-4882] Passkeys: funnel rp name or id to the cipher name on save (#7969)
* funnel rp name or id to the cipher name on save

* remove comment

* add rp name and id to addCipher function

---------

Co-authored-by: Merissa Weinstein <merissaweinstein@merissas-mbp-2.lan>
2024-03-06 11:30:12 -06:00
Shane Melton
940fd21ac4
[PM-6645] Update canAccessOrgAdmin helper to consider disabled organizations and owners explicitly (#8220) 2024-03-06 08:03:52 -08:00
Jason Ng
e2a543506a
PM-6558 Vault Onboarding Extension Check on Install (#8216)
updated browser runtime background to send hasBWInstalled message on installation
2024-03-06 10:48:27 -05:00
Addison Beck
101e1a4f2b
Migrate provider service to state provider (#8173)
* Migrate existing provider data to StateProvider

Migrate existing provider data to StateProvider

* Rework the ProviderService to call StateProvider

* Unit test the ProviderService

* Update DI to reflect ProviderService's new args

* Add ProviderService to logout chains across products

* Remove provider related stateService methods

* Update libs/common/src/state-migrations/migrations/28-move-provider-state-to-state-provider.spec.ts

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

* Cover up a copy/paste job

* Compare equality over entire array in a test

---------

Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
2024-03-05 19:35:12 +00:00
Justin Baur
c9b5125f74
Include Storage Location In Fake Cache Key (#8203) 2024-03-05 12:30:40 -05:00
Justin Baur
c3eba7f2c8
[PM-6404] Fully Integrate clearOn Events (#8134)
* Add New KeyDefinitionOption

* Add New Services

* Add WebStorageServiceProvider Tests

* Update Error Message

* Add `UserKeyDefinition`

* Fix Deserialization Helpers

* Fix KeyDefinition

* Add `UserKeyDefinition`

* Fix Deserialization Helpers

* Fix KeyDefinition

* Move `ClearEvent`

* Cleanup

* Fix Imports

* Integrate onClear Events

* Remove Accidental Addition

* Fix Test

* Add VaultTimeoutService Tests

* Only Register When Current State is Null

* Address Feedback
2024-03-04 20:33:25 +00:00
Jonathan Prusik
4ba2717eb4
[PM-5559] Implement User Notification Settings state provider (#8032)
* create user notification settings state provider

* replace state service get/set disableAddLoginNotification and disableChangedPasswordNotification with user notification settings service equivalents

* migrate disableAddLoginNotification and disableChangedPasswordNotification global settings to user notification settings state provider

* add content script messaging the background for enableChangedPasswordPrompt setting

* Implementing feedback to provide on PR

* Implementing feedback to provide on PR

* PR suggestions cleanup

---------

Co-authored-by: Cesar Gonzalez <cgonzalez@bitwarden.com>
2024-03-04 14:12:23 -05:00
✨ Audrey ✨
d87a8f9271
[PM-6523] generator service tuning (#8155)
* rename policy$ to evaluator$
* replace `ActiveUserState` with `SingleUserState`
* implement `SingleUserState<T>` on `SecretState`
2024-03-04 13:43:38 -05:00
Matt Gibson
b691b6b1d6
[PM-6484] Revert "[PM-5277] Migrate Sync Service to State Provider (#7680)" (#8157)
* Revert "[PM-5277] Migrate Sync Service to State Provider (#7680)"

This reverts commit 78008a9e1e.

Includes a noop migration builder that allows us to bridge over the deleted migration

* Prefer revert migrations to noop

this revert avoids the need to change behavior between released vs unreleased migrations and keeps some dangerous code out of the repo :success:

* Update ordering of badge settings migrator to be consistent with `rc`, which was cut with only up to version 25

* Fix missing type import
2024-03-04 09:34:22 -05:00
Thomas Rittson
ad21a1d160
[AC-2249] Remove StateService from PolicyApiService (#8106)
This was unused.
2024-03-01 15:59:45 -06:00
Matt Gibson
5677d6265e
Ps/pm 5537/move biometric unlock to state providers (#8099)
* Establish biometric unlock enabled in state providers

* Use biometric state service for biometric state values

* Migrate biometricUnlock

* Fixup Dependencies

* linter and import fixes

* Fix injection

* Fix merge

* Use boolean constructor as mapper

* Conform to documented test naming conventions

* Commit documentation suggestion

Co-authored-by: Andreas Coroiu <acoroiu@bitwarden.com>

* Fix merge commit

* Fix test names

---------

Co-authored-by: Andreas Coroiu <acoroiu@bitwarden.com>
2024-03-01 10:17:06 -05:00
Andreas Coroiu
7bbde647f4
[PM-5725] New passkeys should always return 0 as counter value (#8024)
* [PM-5725] feat: do not increment counter if is zero

* [PM-5725] feat: skip save to server when counter is 0
2024-03-01 13:58:55 +00:00
Alex Morask
7cfe862aa6
[PM-5971] Fix Payment Method Warning Bugs (#7923)
* Rework implementation of payment method warnings

* Move payment-method-warnings.component to module

* Moved timer/subscribe to app.component

* Remove unrelated refactoring

* Remaining feedback

* Add paymentMethodWarningsService tests

* Thomas' feedback

* fix tests

* Use barrel file imports

* Make banner work with new vault navigation

* Matt's feedback
2024-02-29 08:18:47 -05:00
Matt Gibson
ea0f5fa771
Fix clear keys state logic (#8143)
* Fix clear keys state logic

Disk state should only be cleared if memory only is not specified.

* Remove unnecessary zip from testing
2024-02-28 14:14:07 -05:00
Jonathan Prusik
5443ea2232
fix migration rollbacks (#8124) 2024-02-28 10:31:21 -05:00
Justin Baur
87c75e5ac8
[PM-6404] Initial Clear Events Code (#8029)
* Add New KeyDefinitionOption

* Add New Services

* Add WebStorageServiceProvider Tests

* Update Error Message

* Add `UserKeyDefinition`

* Fix Deserialization Helpers

* Fix KeyDefinition

* Add `UserKeyDefinition`

* Fix Deserialization Helpers

* Fix KeyDefinition

* Move `ClearEvent`

* Cleanup

* Fix Imports

* Remove `updateMock`

* Call Super in Web Implementation

* Use Better Type to Avoid Casting

* Better Error Docs

* Move StorageKey Creation to Function

* Throw Aggregated Error for Failures
2024-02-27 21:58:31 +00:00
Jonathan Prusik
929b5ebec3
[PM-5568] Implement Badge Settings state provider (#8112)
* create badge settings state provider

* replace state service get/set disableBadgeCounter with badge settings service equivalent

* migrate disableBadgeCounter account setting to badge settings state provider

* cleanup and address PR suggestions
2024-02-27 21:03:12 +00:00
✨ Audrey ✨
36116bddda
[PM-5614] introduce SecretState wrapper (#7823)
Matt provided a ton of help on getting the state interactions right. Both he 
and Justin collaborated with me to write the core of of the secret classifier.

Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
2024-02-27 11:40:32 -05:00
Thomas Rittson
0a5c9d3525
[AC-2008] [AC-2122] [Pt 1] Transition PolicyService to use StateProvider (#7959)
* Delete unnecessary StateDefinition

* Add StateProvider to PolicyService

* Add new getters using StateProvider (not exposed or used yet)
2024-02-27 08:51:10 +10:00
Alex Morask
f53af7c466
[AC-1863] Send initiationPath on organization or user signup (#7747)
* Sent initiation path for organization and user signups

* Rename organizationQueryParameter > organizationTypeQueryParameter

* Jared's feedback

* Split PM & SM initiation path
2024-02-26 14:20:11 -05:00
Justin Baur
632598d804
[PM-6404] Add UserKeyDefinition (#8052)
* Add `UserKeyDefinition`

* Fix Deserialization Helpers

* Fix KeyDefinition

* Move `ClearEvent`

* Address PR Feedback

* Feedback
2024-02-26 11:28:40 -05:00
Jake Fink
1435203e12
[PM-5499] Create Auth Request Service (#8056)
* create auth request service

* copy methods from auth crypto service

* register new auth request service

* remove refs to auth request crypto service

* remove auth request crypto service

* remove passwordless login method from login strategy service

* add docs to auth request service
2024-02-26 10:07:08 -05:00
Justin Baur
d02651583f
Extend Cleanup Delay (#8076) 2024-02-26 14:20:15 +00:00