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

1155 Commits

Author SHA1 Message Date
Cesar Gonzalez
3b0005b48c
[PM-8518] Autofill scripts do not inject into sub frames on install (#9459)
* [PM-8518] Autofill scripts do not inject into sub-frames on install

* [PM-8518] Implementing jest tests for added BrowserApi methods

* [PM-8518] Adding generic typing to tabSendMessage call
2024-06-11 15:50:03 -05:00
Cesar Gonzalez
fe82dbe2b9
[PM-8510] Implement collect page details observable (#9452)
* Working through a POC of a collectPageDetails observable

* Implementing collect page details observable

* [PM-8510] Implement collectPageDetails observable

* [PM-8510] Adding documentation to newly created collectPageDetailsFromTab method

* [PM-8510] Removing unnecessary file

* [PM-8510] Implementing Jest tests for the collectPageDetailsFromTab$ method

* [PM-8510] Implementing Jest tests for the collectPageDetailsFromTab$ method

* [PM-8510] Implementing Jest tests for the collectPageDetailsFromTab$ method

* [PM-8510] Implementing Jest tests for the collectPageDetailsFromTab$ method

* [PM-8510] Removing unnecessary property

* [PM-8510] Adding subscription reference to current tab component

* [PM-8510] Fixing jest tests
2024-06-11 20:00:05 +00:00
Nick Krantz
cbc34950fb
add check for PersonalOwnershipPolicy in vault filters (#9570) 2024-06-10 14:25:21 -05:00
Jason Ng
841edc1058
[PM-7102] Create Add/Edit container for Item v2 work (#9541)
* set up new add-edit-v2 component
2024-06-10 14:23:29 -04:00
Shane Melton
19f2d2aefc
[PM-8379] Update vault popup items service to track loading state (#9528) 2024-06-10 09:55:12 -07:00
Cesar Gonzalez
d30b947dd7
[PM-8498] Moving content script-specific FIDO2 code from Vault to Autofill ownership (#9431)
* [PM-8498] Moving content script-specific FIDO2 code from Vault to Autofill ownership

* [PM-8498] Adjusting jest test reference for webauth-utils
2024-06-07 08:47:38 -05:00
Daniel James Smith
28e8f8f364
[PM-7240] Create new export component [UI changes] (#9285)
* Move/replace submit and userVerification logic from web into the BaseExportComponent

Add "@bitwarden/auth" as dependency to the vault-export-ui package
New submit logic also checks for password-encrypted exports which will be need for future UI updates on browser and desktop

* Move/replace submit and userVerification logic from web into the BaseExportComponent

Add "@bitwarden/auth" as dependency to the vault-export-ui package
New submit logic also checks for password-encrypted exports which will be need for future UI updates on browser and desktop

* Create export-browser-v2 component

Copy existing `export-browser`-component
Add `popup-page` and -`header` and -`footer`
Add missing imports as page is marked as standalone
Route to new page when feature flag enabled

* Remove duplicate verifyUser methods

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-06-07 09:17:00 -04:00
github-actions[bot]
8361c0bd29
Autosync the updated translations (#9543)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2024-06-07 10:21:13 +00:00
Shane Melton
c8b2807487
[PM-8665] Show toast when favorite is toggled (#9537) 2024-06-06 14:25:23 -07:00
Nick Krantz
3457941634
show family icon for free orgs in filter chips (#9532) 2024-06-06 15:30:02 -05:00
Nick Krantz
a5591dc4bc
[PM-8592] Deactivated state not showing (#9533)
* refactor vault state observables into a single variable to remove multiple subscriptions

* add clarification comment

* fix comment to be accurate
2024-06-06 15:28:29 -05:00
Shane Melton
79968c2d32
[PM-8335] Show autofill suggestion when no autofill login items present (#9521) 2024-06-06 10:43:55 -07:00
Nick Krantz
a7b45a44e3
[PM-8594] use singular version of the copy for filters (#9509)
* use singular for collection and type

* use singular verbiage for cipher type

* use type translations for singularity
2024-06-06 09:39:21 -05:00
Will Martin
472a7a9d4d
[CL-302] respect bottom padding in scrollable popup-layout (#9514) 2024-06-05 17:17:24 -04:00
Cesar Gonzalez
ce69b25d54
[PM-8519] Inline menu fails to update credentials after saving credentials when unlocking extension (#9462)
* Add Back Foreground & Background Derived State

* Do Dependency Injection

* Defend `map` Calls

* Remove Folder Change

* Add Helper For Preparing a Record For Use in `forkJoin`

* Update & Test CryptoService Changes

* Delete Unused Code

* Update DeviceTrustService

* Update CipherService

* Make `userPublicKey$` Public

* Rename convertValues File

* Switch to `MonoTypeOperatorFunction`

* Remove Unnecessary `async`

* Remove Unnecessary Mock

* Update libs/common/src/platform/abstractions/crypto.service.ts

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

* Add `convertValues` Tests

* Add Doc Comments

* Convert to `function`'s

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

* Fix Test Typos

* Add param doc

* Update Test Name

* Add `@throws` Docs

* [PM-8519] Inline Menu fails to Update Credentials After Saving New Cipher When Unlocking Extension

* Revert "Merge branch 'reintroduce-foreground-background-derived' into autofill/pm-8519-inline-menu-fails-to-update-credentials-after-saving-credentials-when-unlocking-extension"

This reverts commit 53b060dac1, reversing
changes made to 15b9a237b8.

---------

Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
Co-authored-by: Andreas Coroiu <acoroiu@bitwarden.com>
2024-06-05 15:14:34 -05:00
Victoria League
d3f1992ad5
[CL-294] Make section-header work across clients (#9386) 2024-06-05 15:07:00 -04:00
Shane Melton
1cfbcf4ee0
[PM-8334] Sort ciphers after autofill (#9511)
* [PM-8334] Add localData$ to CipherService and watch it for updates

* Fix leftover tw-fixed class

* [PM-8334] Fix tests
2024-06-05 08:10:36 -07:00
Justin Baur
1aaa88a64d
[PM-7837] Move SyncService to Platform Ownership (#9055)
* Move

* Update  References In Unowned Files

* Update  References In Vault Files

* Update Web AppComponent

* Add Import
2024-06-05 10:48:12 -04:00
Jason Ng
cb0927ac5d
[PM-8553] browser v2 search bar defects (#9506)
* update no results icon and no results scrolling
* update v2 search so the term persist when the user clicks into an item and exits the item
2024-06-05 10:06:52 -04:00
Shane Melton
f059d136b2
[PM-8485] [PM-7683] Dynamic list items - Org Details (#9466)
* [PM-7683] Add fullAddressForCopy helper to identity.view

* [PM-7683] Introduce CopyCipherFieldService to the Vault library

- A new CopyCipherFieldService that can be used to copy a cipher's field to the user clipboard
- A new appCopyField directive to make it easy to copy a cipher's fields in templates
- Tests for the CopyCipherFieldService

* [PM-7683] Introduce item-copy-actions.component

* [PM-7683] Fix username value in copy cipher directive

* [PM-7683] Add title to View item link

* [PM-8456] Introduce initial item-more-options.component

* [PM-8456] Add logic to show/hide login menu options

* [PM-8456] Implement favorite/unfavorite menu option

* [PM-8456] Implement clone menu option

* [PM-8456] Hide launch website instead of disabling it

* [PM-8456] Ensure cipherList observable updates on cipher changes

* [PM-7683] Move disabled logic into own method

* [PM-8456] Cleanup spec file to use Angular testbed

* [PM-8456] Fix more options tooltip

* [PM-8485] Introduce new PopupCipherView

* [PM-8485] Use new PopupCipherView in items service

* [PM-8485] Add org icon for items that belong to an organization

* [PM-8485] Fix tests

* [PM-8485] Remove share operator from cipherViews$
2024-06-04 14:34:48 -07:00
Nick Krantz
d0c1325f0c
update icons for folder & collection filters (#9508) 2024-06-04 16:26:39 -05:00
Shane Melton
6eb94078f6
[PM-8456] [PM-7683] Dynamic list items - 3 dot menu (#9422)
* [PM-7683] Add fullAddressForCopy helper to identity.view

* [PM-7683] Introduce CopyCipherFieldService to the Vault library

- A new CopyCipherFieldService that can be used to copy a cipher's field to the user clipboard
- A new appCopyField directive to make it easy to copy a cipher's fields in templates
- Tests for the CopyCipherFieldService

* [PM-7683] Introduce item-copy-actions.component

* [PM-7683] Fix username value in copy cipher directive

* [PM-7683] Add title to View item link

* [PM-8456] Introduce initial item-more-options.component

* [PM-8456] Add logic to show/hide login menu options

* [PM-8456] Implement favorite/unfavorite menu option

* [PM-8456] Implement clone menu option

* [PM-8456] Hide launch website instead of disabling it

* [PM-8456] Ensure cipherList observable updates on cipher changes

* [PM-7683] Move disabled logic into own method

* [PM-8456] Cleanup spec file to use Angular testbed

* [PM-8456] Fix more options tooltip
2024-06-04 14:21:14 -07:00
Shane Melton
d1a9d6f613
[PM-8455] [PM-7683] Dynamic list items - Copy Action (#9410)
* [PM-7683] Add fullAddressForCopy helper to identity.view

* [PM-7683] Introduce CopyCipherFieldService to the Vault library

- A new CopyCipherFieldService that can be used to copy a cipher's field to the user clipboard
- A new appCopyField directive to make it easy to copy a cipher's fields in templates
- Tests for the CopyCipherFieldService

* [PM-7683] Introduce item-copy-actions.component

* [PM-7683] Fix username value in copy cipher directive

* [PM-7683] Add title to View item link

* [PM-7683] Move disabled logic into own method
2024-06-04 14:09:09 -07:00
Bitwarden DevOps
99639b537f
Bumped client version(s) (#9486) 2024-06-03 18:10:48 +00:00
Jared Snider
9d35a8895e
Auth/PM-8367 - Email Verification - Integrate Registration Self Hosted Env Selector + new Self Hosted Env Settings Dialog into Registration Start (#9361)
* PM-8367 - WIP - initial comp creation

* PM-8367 - Majority of new registration self hosted env config dialog working

* PM-8367 - RegistrationEnvSelectorComponent - add method handleSelfHostedEnvConfigDialogResult and add toast for happy path.

* PM-8367 - Add validation TODO

* PM-8367 - RegistrationSelfHostedEnvConfigDialogComponent - Add validator

* PM-8367 - RegEnvSelector - Only show self hosted if the client is browser or desktop since we will be using the selector on web as well.

* PM-8367 - Registration start comp - add env selector

* PM-8367 - Registration start - add proper import for standalone comps.

* PM-8367 - Registration Start - get storybook fixed with registration env selector

* PM-8367 - Add self hosted server to web translations only for storybook

* PM-8367 - Add more storybook examples and update docs (WIP - need to test self hosted selection)

* PM-8367 - Registration Start - update stories

* PM-8367 - Env Selector now emits selected region so that parent comps can listen to it if needed.

* PM-8367 - Registration Start - wire up handler for selectedRegionChange so that the parent comp can successfully track isSelfHost and hide / show the terms / privacy policy checkbox

* PM-8367 - TODO cleanup

* PM-8367 - Registration start docs - stage gate is two words.

* PM-8367 - Per working session with Will, move top level provided services to app level instead of module level to solve dialog null injector errors.

* PM-8367 - Storybook working for self hosted env dialog

* PM-8367 - Add dialog scroll feature to bitDialog and implement in self hosted env dialog.

* PM-8367 - Revert bit dialog changes and scroll implementation.

* PM-8367 - Tweak registration start docs

* PM-8367 - Remove unused changeDetectorRef

* PM-8367 - Add docs per PR feedback
2024-06-03 13:05:27 -04:00
Jared Snider
f691854387
Auth - PM-7392 & PM-7436 - Token Service - Desktop - Add disk fallback for secure storage failures (#8913)
* PM-7392 - EncryptSvc - add new method for detecting if a simple string is an enc string.

* PM-7392 - TokenSvc - add checks when setting and retrieving the access token to improve handling around the access token encryption.

* PM-7392 - (1) Clean up token svc (2) export access token key type for use in tests.

* PM-7392 - Get token svc tests passing; WIP more tests to come for new scenarios.

* PM-7392 - Access token secure storage to disk fallback WIP but mostly functional besides weird logout behavior.

* PM-7392 - Clean up unnecessary comment

* PM-7392 - TokenSvc - refresh token disk storage fallback

* PM-7392 - Fix token service tests in prep for adding tests for new scenarios.

* PM-7392 - TokenSvc tests - Test new setRefreshToken scenarios

* PM-7392 - TokenSvc - getRefreshToken should return null or a value - not undefined.

* PM-7392 - Fix test name.

* PM-7392 - TokenSvc tests - clean up test names that reference removed refresh token migrated flag.

* PM-7392 - getRefreshToken tests done.

* PM-7392 - Fix error quote

* PM-7392 - TokenSvc tests - setAccessToken new scenarios tested.

* PM-7392 - TokenSvc - getAccessToken - if secure storage errors add error to log.

* PM-7392 - TokenSvc tests - getAccessToken - all new scenarios tested

* PM-7392 - EncryptSvc - test new stringIsEncString method

* PM-7392 - Main.ts - fix circ dep issue.

* PM-7392 - Main.ts - remove comment.

* PM-7392 - Don't re-invent the wheel and simply use existing isSerializedEncString static method.

* PM-7392 - Enc String - (1) Add handling for Nan in parseEncryptedString (2) Added null handling to isSerializedEncString. (3) Plan to remove encrypt service implementation

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

* PM-7392 - Remove encrypt service method

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

* PM-7392 - Actually fix circ dep issues with Justin. Ty!

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

* PM-7392 - TokenSvc - update to use EncString instead of EncryptSvc + fix tests.

* PM-7392 - TokenSvc - (1) Remove test code (2) Refactor decryptAccessToken method to accept access token key and error on failure to pass required decryption key to method.

* PM-7392 - Per PR feedback and discussion, do not log the user out if hte refresh token cannot be found. This will allow users to continue to use the app until their access token expires and we will error on trying to refresh it. The app will then still work on a fresh login for 55 min.

* PM-7392 - API service - update doAuthRefresh error to clarify which token cannot be refreshed.

* PM-7392 - Fix SetRefreshToken case where a null input would incorrectly trigger a fallback to disk.

* PM-7392 - If the access token cannot be refreshed due to a missing refresh token or API keys, then surface an error to the user and log it so it isn't a silent failure + we get a log.

* PM-7392  - Fix CLI build errors

* PM-7392 - Per PR feedback, add missing tests (thank you Jake for writing these!)

Co-authored-by: Jake Fink <jfink@bitwarden.com>

* PM-7392 - Per PR feedback, update incorrect comment from 3 releases to 3 months.

* PM-7392 - Per PR feedback, remove links.

* PM-7392 - Per PR feedback, move tests to existing describe.

* PM-7392 - Per PR feedback, adjust all test names to match naming convention.

* PM-7392 - ApiService - refreshIdentityToken - log error before swallowing it so we have a record of it.

* PM-7392 - Fix copy for errorRefreshingAccessToken

* PM-7392 - Per PR feedback, move error handling toast responsibility to client specific app component logic reached via messaging.

* PM-7392 - Swap logout reason from enum to type.

* PM-7392 - ApiService - Stop using messaging to trigger toast to let user know about refresh access token errors; replace with client specific callback logic.

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

* PM-7392 - Per PR feedback, adjust enc string changes and tests.

* PM-7392 - Rename file to be type from enum

* PM-7392 - ToastService - we need to await the activeToast.onHidden observable so return the activeToast from the showToast.

* PM-7392 - Desktop AppComp - cleanup messaging

* PM-7392 - Move Logout reason custom type to auth/common

* PM-7392 - WIP - Enhancing logout callback to consider the logout reason + move show toast logic into logout callback

* PM-7392 - Logout callback should simply pass along the LogoutReason instead of handling it - let each client's message listener handle it.

* PM-7392 - More replacements of expired with logoutReason

* PM-7392 - More expired to logoutReason replacements

* PM-7392 - Build new handlers for displaying the logout reason for desktop & web.

* PM-7392 - Revert ToastService changes

* PM-7392 - TokenSvc - Replace messageSender with logout callback per PR feedback.

* PM-7392 - Desktop App comp - replace toast usage with simple dialog to guarantee users will see the reason for them being logged out.

* PM-7392 - Web app comp - fix issue

* PM-7392 - Desktop App comp - don't show cancel btn on simple dialogs.

* PM-7392 - Desktop App comp - Don't open n simple dialogs.

* PM-7392 - Fix browser build

* PM-7392 - Remove logout reason from CLI as each logout call handles messaging on its own.

* PM-7392 - Previously, if a security stamp was invalid, the session was marked as expired. Restore that functionality.

* PM-7392 - Update sync service logoutCallback to include optional user id.

* PM-7392 - Clean up web app comp

* PM-7392 - Web - app comp - only handle actually possible web logout scenarios.

* PM-7392 - Browser Popup app comp - restore done logging out message functionality + add new default logout message

* PM-7392 - Add optional user id to logout callbacks.

* PM-7392 - Main.background.ts - add clarifying comment.

* PM-7392 - Per feedback, use danger simple dialog type for error.

* PM-7392 - Browser Popup - add comment clarifying expectation of seeing toasts.

* PM-7392 - Consolidate invalidSecurityStamp error handling

* PM-7392 - Per PR feedback, REFRESH_ACCESS_TOKEN_ERROR_CALLBACK can be completely sync. + Refactor to method in main.background.

* PM-7392 - Per PR feedback, use a named callback for refreshAccessTokenErrorCallback in CLI

* PM-7392 - Add TODO

* PM-7392 - Re-apply bw.ts changes to new service-container.

* PM-7392 - TokenSvc - tweak error message.

* PM-7392 - Fix test

* PM-7392 - Clean up merge conflict where I duplicated dependencies.

* PM-7392 - Per discussion with product, change default logout toast to be info

* PM-7392 - After merge, add new logout reason to sync service.

* PM-7392 - Remove default logout message per discussion with product since it isn't really visible on desktop or browser.

* PM-7392 - address PR feedback.

---------

Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
Co-authored-by: Jake Fink <jfink@bitwarden.com>
Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
2024-06-03 12:36:45 -04:00
Nick Krantz
748eb00223
[PM-6826] Vault filter refresh (#9365)
* add initial type filter

- use `bit-select` while the chip component is being developed

* get cipherTypes$ from service

- integrate with user settings

* initial add of folder selection

* initial add of vault selection

* initial add of collections filter

* update `VaultPopupListFilterService` to `VaultPopupListFiltersService`

* integrate hasFilterApplied$

* intermediate commit of integration to the filters component

* do not return the tree when the value is null

* return null when the updated option is null

* update vault-popup-list to conform to the chip select structure

* integration of bit-chip-select

* move "no folder" option to the end of the list

* show danger icon for deactivated organizations

* show deactivated warning when the filtered org is disabled

* update documentation

* use pascal case for constants

* store filter values as full objects rather than just id

- This allows secondary logic to be applied when filters are selected

* move filter form into service to be the source of truth

* fix tests after adding "jest-preset-angular/setup-jest"

* remove logic to have dynamic cipher type filters

* use ProductType enum

* invert conditional for less nesting

* prefer `decryptedCollections$` over getAllDecrypted

* update comments

* use a `filterFunction$` observable rather than having to pass filters back to the service

* fix children testing

* remove check for no folder

* reset filter form when filter component is destroyed

* add takeUntilDestroyed for organization valueChanges

* allow takeUntilDestroyed to use internal destroy ref

- The associated unit tests needed to be configured with TestBed rather than just `new Service()` for this to work

* use controls object for type safety
2024-06-03 09:20:14 -05:00
github-actions[bot]
f172612b19
Autosync the updated translations (#9470)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2024-06-02 09:30:49 +00:00
Nick Krantz
00c305dff3
Browser - Add jest-preset-angular (#9412)
* add "jest-preset-angular/setup-jest" to browser app

* use flushPromises rather than await a dummy promise

* move the import of `page-script` into beforeAll rather than the describe scope

* invoke the sendMessage callback rather than relying on a promise comparison
2024-05-31 13:21:45 -05:00
Bitwarden DevOps
f3e780a678
Bumped client version(s) (#9458) 2024-05-31 14:30:37 +00:00
github-actions[bot]
0dc51baf79
Autosync the updated translations (#9449)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2024-05-31 06:31:27 +00:00
Daniel James Smith
41fbac7151
[PM-7173] Update autofill settings [Nav changes] (#9318)
* Introduce additional options heading

Text will be needed for the UI changes later on anyway

* Move enableContextMenuItem from options.component to autofill.component

* Move copy TOTP automatically from options.component to autofill.component

* Move clearClipboard from options.component to autofill.component

* Move showCardsCurrentTab from options.component to autofill.component

* Move showIdentitiesCurrentTab from options.component to autofill.component

* Remove options.component as all controls have been migrated

Delete options.component
Import within AppModule
Delete obsolete route
Remove animation/page transition
Remove button from settings.component.html

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-05-30 21:12:43 +02:00
Cesar Gonzalez
f79d1dac92
[PM-8480] Rename ambiguous Jest testing method (#9417) 2024-05-30 08:39:19 -05:00
Bernd Schoolmann
f6942dde74
[PM-3050] Add sync on unlock, logout when account is deleted (#9288)
* Add sync on unlock, logout when account is deleted

* Update libs/common/src/vault/services/sync/sync.service.ts

Co-authored-by: SmithThe4th <gsmith@bitwarden.com>

* Fix failing unit tests

* Fix incorrect merge

---------

Co-authored-by: SmithThe4th <gsmith@bitwarden.com>
2024-05-30 11:10:03 +02:00
Daniel James Smith
e318ac0ddf
[PM-2516][PM-8298] Add password protected export on browser/Export managed collection (#9284)
* Move/replace submit and userVerification logic from web into the BaseExportComponent

Add "@bitwarden/auth" as dependency to the vault-export-ui package
New submit logic also checks for password-encrypted exports which will be need for future UI updates on browser and desktop

* Create export-browser component using shared recipe

- Create new export component that uses the shared export.component from @bitwarden/vault-export-ui

* Update imports within AppModule

* Switch to route to the new component

* Add missing entries to messages.json

* Delete old export.component

* Remove duplicate verifyUser-method

* Change placeholder example

* Add documentation to protected members of ExportBrowserComponent

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-05-29 23:58:04 +02:00
github-actions[bot]
8656ec5417
Autosync the updated translations (#9419)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2024-05-29 20:16:31 +00:00
Cesar Gonzalez
a7aaa140fd
[PM-8322] Firefox Inline Autofill Menu Not Propagating Correctly When Switching Tabs (#9300)
* [PM-8322] Firefox Inline Autofill Menu Not Propagation Correctly When Switching Tabs

* [PM-8322] Firefox Inline Autofill Menu Not Propagation Correctly When Switching Tabs

* Add missing RouterModule to the CurrentAccountComponent (#9295)

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>

* [PM-6825] Browser Refresh - Initial List Items (#9199)

* [PM-6825] Add temporary vault page header

* [PM-6825] Expose cipherViews$ observable

* [PM-6825] Refactor getAllDecryptedForUrl to expose filter functionality for reuse

* [PM-6825] Introduce VaultPopupItemsService

* [PM-6825] Introduce initial VaultListItem and VaultListItemsContainer components

* [PM-6825] Add VaultListItems to VaultV2 component

* [PM-6825] Introduce autofill-vault-list-items.component to encapsulate autofill logic

* [PM-6825] Add temporary Vault icon

* [PM-6825] Add empty and no results states to Vault tab

* [PM-6825] Add unit tests for vault popup items service

* [PM-6825] Negate noFilteredResults placeholder

* [PM-6825] Cleanup new Vault components

* [PM-6825] Move new components into its own module

* [PM-6825] Fix missing button type

* [PM-6825] Add booleanAttribute to showAutofill input

* [PM-6825] Replace empty refresh BehaviorSubject with Subject

* [PM-6825] Combine *ngIfs for vault list items container

* [PM-6825] Use popup-section-header component

* [PM-6825] Use small variant for icon buttons

* [PM-6825] Use anchor tag for vault items

* [PM-6825] Consolidate vault-list-items-container to include list item component functionality directly

* [PM-6825] Add Tailwind classes to new Vault icon

* [PM-6825] Remove temporary header comment

* [PM-6825] Fix auto fill suggestion font size and padding

* [PM-6825] Use tailwind for vault icon styling

* [PM-6825] Add libs/angular to tailwind.config content

* [PM-6825] Cleanup missing i18n

* [PM-6825] Make VaultV2 standalone and cleanup Browser App module

* [PM-6825] Use explicit type annotation

* [PM-6825] Use property binding instead of interpolation

* [PM-7076] Create settings-v2.component (#9213)

* Create settings-v2.component

Create new settings page
Add routing based on extension refresh flag

* Wrap anchors around the icons

* Add account-switcher to settings page

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>

* [PM-8289] Inline menu content script does not update when user updates setting (#9279)

* [PM-8289] Inline menu content script does not update whne user updates setting

* [PM-8289] Fixing issue present within Jest tests

* [PM-8289] Triggering a reload of autofill scripts when a user logs into their account

---------

Co-authored-by: Daniel James Smith <2670567+djsmith85@users.noreply.github.com>
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
Co-authored-by: Shane Melton <smelton@bitwarden.com>
2024-05-29 11:35:17 -05:00
Justin Baur
a6df923416
[PM-8292] Fixup ForegroundSyncService (#9292)
* Change `object` to `Record<string, unknown>`

* Change `object` to `Record<string, unknown>` Pt. 2

* Update ForegroundSyncService

- Manage finish message in the listener to more gaurantee a message back
- Make the timeout much longer
- Allow it to throw if the background sync service threw

---------

Co-authored-by: Cesar Gonzalez <cesar.a.gonzalezcs@gmail.com>
2024-05-29 12:12:58 -04:00
Bitwarden DevOps
42784b39f1
Bumped client version(s) (#9406) 2024-05-28 22:19:50 +00:00
Jason Ng
4ef9497bc5
[PM-6824] Browser V2 Search (#9343)
*browser v2 search - can search for terms and items filtered in their respective groups
2024-05-28 17:08:25 -04:00
Jake Fink
bc170f5207
use valid userId when logging out (#9334) 2024-05-28 15:17:30 -04:00
Cesar Gonzalez
e14e2627ad
[PM-8447] Autofill On Load Causes Extension to Hang After Browser Startup (#9400) 2024-05-28 14:05:24 -05:00
Daniel James Smith
49b59840a8
Create import-browser-v2 component (#9214)
Copy existing `import-browser`-component
Add `popup-page` and -`header` and -`footer`
Add missing imports as page is marked as standalone
Fix no-floating-promise
Change to route OnSuccess to `vault-settings` instead of old `settings`-page

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-05-28 16:47:35 +02:00
Matt Gibson
93b9eba769
Separate browser foreground and background memory space (#9315)
* Separate browser foreground and background memory space

* Prefer inherited DI providers
2024-05-27 08:54:24 -04:00
Matt Gibson
2e6280ce88
Prefer UserKeyDefinition for user-scoped data (#9349) 2024-05-27 08:12:53 -04:00
Matt Gibson
c61ba41b97
Use User Key Definitions for user-scoped data (#9348) 2024-05-27 08:12:28 -04:00
Jared Snider
89d7e96b25
Auth/PM-5086 - Email Verification - Registration Start + Environment Selector components (#9342)
* PM-5086 - WIP start on registration start component

* PM-5086 - more WIP progress on registration start comp

* PM-5086 - Setup secondary component

* PM-5086 - (1) Validation working (2) States implemented (3) 2nd state for check email mostly completed except for correct icon

* PM-5086 - Registration Start - check email state - update icon to be correct from figma.

* PM-5086 - Refactor self hosted conditional + actually hide the checkbox if it is self hosted.

* PM-5086 - WIP good progress on getting browser & desktop creating account on logic working.

* PM-5086 - Accessibility pass + WIP on region selector

* PM-5086 - Accessibility pass with Danielle

* PM-5086 - Migrate env selector logic to own component.

* PM-5086 - Update AnonLayoutWrapperComp import

* PM-5086 - Remove unncessary focus.

* PM-5086 - WIP first draft of registration env selector; name might change to differentiate it from existing env selector.

* PM-5086 - Rename env selector to be more clear and use registration-env-selector instead.

* PM-5086 - (1) Export registration env selector (2) Change comp name not just file name.

* PM-5086 - Create new registration page stub

* PM-5086 - Fix build issue where select module was missing from new registration env selector.

* PM-5086 - Registration --> registration start.

* PM-5086 - Add missing translation from registration-start-secondary-component to desktop & browser.

* PM-5086 - Add missing translations

* PM-5086 - Registration Env Selector - forms require form groups. duh.

* PM-5086 - Registration Env Selector - working now.

* PM-5086 - Registration Start desktop mostly working with env selector issues.

* PM-5086 - Registration start - get self hosted env dialog to close on close click. Backdrop click doesn't work but escape does still.

* PM-5086 - TODO: figure out if there is a better way to get the dialog to close.

* PM-5086 - Registration start - get goBack working to properly re-show env selector

* PM-5086 - Self Hosted Env Comp - re-emit current env on close so that select based env selectors can reset

* PM-5086 - RegistrationEnvSelector - Refactor init logic to also listen for env updates so that the user's choices on the self hosted settings dialog get communicated to this comp

* PM-5086 - Registration Start Desktop - Don't allow users to close dialog via escape as we need them to either close or save to get the env service to set the env correctly.

* PM-5086 - Browser Registration Start Page stub

* PM-5086 - Registration Start comp - storybook added

* PM-5086 - Remove links to start-registration as we aren't ready to implement that yet.

* PM-5086 - Revert environment comp changes.

* PM-5086 - Delete registration start pages.

* PM-5086 - Test removing PreloadedEnglishI18nModule to see if it fixes test failures

* PM-5086 - Try to resolve issues w/ importing PreloadedEnglishI18nModule into RegistrationStartComponent storybook stories file.

* PM-5086 - Allow translations to be imported for all libs.

* PM-5086 - Remove comment from JSON

* PM-5086 - TODO cleanup

* PM-5086 - Per PR feedback, fix display issues by using correct classes.

* PM-5086 - Fix SVG per PR feedback

* PM-5086 - Remove unnecessary methods

* PM-5086 - RegistrationEnvSelectorComponent - per PR feedback, properly type null in form group
2024-05-24 15:43:29 -04:00
Daniel James Smith
34a766f346
[PM-7178] Update about and more-from-bitwarden pages [UI changes] (#9322)
* Remove button to launch contact form from about-page

* Remove button to launch community forums from about-page

* Create about-page-v2 component

Copy existing about-page.component
Add missing imports as page is marked as standalone
Add popup-page and -header
Migrate navigation items to use bit-items and bit-item-content
Route to new page when feature flag enabled

* Create more-from-bitwarden-page-v2 component

Copy existing more-from-bitwarden-page.component
Add missing imports as page is marked as standalone
Add popup-page and -header
Migrate navigation items to use bit-items and bit-item-content
Route to new page when feature flag enabled

* Add speedbump for rate the extension button

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-05-24 17:17:24 +02:00
github-actions[bot]
ab809d915d
Autosync the updated translations (#9352)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2024-05-24 12:13:20 +00:00
Victoria League
08a6f91411
[CL-221] Add chip-select component (#9021)
---------

Co-authored-by: William Martin <contact@willmartian.com>
2024-05-23 16:30:55 -04:00
Cesar Gonzalez
bbf1473022
[PM-5295] Improve autofill collection of page details performance (#9063)
* [PM-5295] Improve autofill collection of page details performance

* [PM-5295] Reworking implementation to leverage requestIdleCallback instead of requestAnimationFrame

* [PM-5295] Reworking implementation to leverage requestIdleCallback instead of requestAnimationFrame

* [PM-5295] Incorporating documentation for added methods

* [PM-5295] Reworking how we handle collection of shadowRoot elements

* [PM-5295] Fixing jest tests relating to the defined pseudo selector

* [PM-5295] Fixing jest tests relating to the defined pseudo selector

* [PM-5295] Refactoring

* [PM-5295] Refactoring

* [PM-5295] Refactoring

* [PM-5295] Starting the work to set up the tree walker strategy under a feature flag

* [PM-5295] Incorporating methodology for triggering a fallback to the TreeWalker API if issues arise with the deepQuery approach

* [PM-5295] Fixing jest test
2024-05-23 18:30:37 +00:00
Shane Melton
75975dd71f
[PM-8333] Autofill refresh button for sidebar popup (Firefox) (#9314)
* [PM-8333] Ensure title suffix is aligned with title

* [PM-8333] Add refresh button for autofill list items section for FF sidebar

* [PM-8333] Add button type
2024-05-23 09:11:16 +01:00
Daniel James Smith
d6f78f2225
[PM-7737] Create about-page and more-from-bitwarden page [Nav changes] (#9233)
* Move help-and-feedback to tools and rename to about-page

Moved help-and-feedback.component to ..tools
Renamed it to about-page
Changed the title to about
Changed the settings button to about
Updated routes
Updates transition animation

* Move button to open AboutDialog from settings to about-page

* Move launch web-vault to about-page

* Move rate extension from settings to about-page

* Fix no-floating-promises

* Remove icons from about-page entries

* Make about-page standalone

* Create MoreFromBitwardenPage component

Create new component
Add button to navigate to new component from about-page
Add routing for new component

* Add new speedbumps to help-center and web-app links

* Add link to Bitwarden Authenticator page

Include speedbump explaing some functionality about the the authenticator

* Add link to Secrets Manager page

Include speedbump explaining some functionality of Secrets Manager

* Add link to Passwordless.dev page

Include speedbump explaining some functionality of Passwordless.dev

* Move learnFromOrg over to more-from-bitwarden

Include speedbump that explains Bitwarden for business

* Clean-up settings.component

Some left-over clean-up from https://github.com/bitwarden/clients/pull/8840
- Removing import and export methods

* Move premium-link to more-from-bitwarden

Hide link if user already has premium

* Add popout-button to about-page

* Remove unneeded headings

* Move popout-button on setting to the right

* Add Free Bitwarden Families link

Include speedbump explaining Free Bitwarden Families

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-05-22 17:00:40 +00:00
Shane Melton
594a6f1daf
[PM-6825] Fix app icon styling in Browser (#9311)
* [PM-6825] Add style override for app icon in the extension to match desktop

* [PM-6825] Add Ids to favorites and allItems list containers for easier testing automations
2024-05-22 09:27:05 -07:00
✨ Audrey ✨
6ca836f31d
fix clear when account unavailable error (#9299)
* fix clear when account unavailable error
* remove explicit password history clear on logout
2024-05-22 10:03:17 -04:00
Jonathan Prusik
91ccb5ff93
fix typo (#9296) 2024-05-22 10:02:46 -04:00
Cesar Gonzalez
8ea3b79512
[PM-8289] Inline menu content script does not update when user updates setting (#9279)
* [PM-8289] Inline menu content script does not update whne user updates setting

* [PM-8289] Fixing issue present within Jest tests

* [PM-8289] Triggering a reload of autofill scripts when a user logs into their account
2024-05-21 22:28:10 +00:00
Daniel James Smith
10ab556b67
[PM-7076] Create settings-v2.component (#9213)
* Create settings-v2.component

Create new settings page
Add routing based on extension refresh flag

* Wrap anchors around the icons

* Add account-switcher to settings page

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-05-21 23:32:22 +02:00
Shane Melton
3d0e0d261e
[PM-6825] Browser Refresh - Initial List Items (#9199)
* [PM-6825] Add temporary vault page header

* [PM-6825] Expose cipherViews$ observable

* [PM-6825] Refactor getAllDecryptedForUrl to expose filter functionality for reuse

* [PM-6825] Introduce VaultPopupItemsService

* [PM-6825] Introduce initial VaultListItem and VaultListItemsContainer components

* [PM-6825] Add VaultListItems to VaultV2 component

* [PM-6825] Introduce autofill-vault-list-items.component to encapsulate autofill logic

* [PM-6825] Add temporary Vault icon

* [PM-6825] Add empty and no results states to Vault tab

* [PM-6825] Add unit tests for vault popup items service

* [PM-6825] Negate noFilteredResults placeholder

* [PM-6825] Cleanup new Vault components

* [PM-6825] Move new components into its own module

* [PM-6825] Fix missing button type

* [PM-6825] Add booleanAttribute to showAutofill input

* [PM-6825] Replace empty refresh BehaviorSubject with Subject

* [PM-6825] Combine *ngIfs for vault list items container

* [PM-6825] Use popup-section-header component

* [PM-6825] Use small variant for icon buttons

* [PM-6825] Use anchor tag for vault items

* [PM-6825] Consolidate vault-list-items-container to include list item component functionality directly

* [PM-6825] Add Tailwind classes to new Vault icon

* [PM-6825] Remove temporary header comment

* [PM-6825] Fix auto fill suggestion font size and padding

* [PM-6825] Use tailwind for vault icon styling

* [PM-6825] Add libs/angular to tailwind.config content

* [PM-6825] Cleanup missing i18n

* [PM-6825] Make VaultV2 standalone and cleanup Browser App module

* [PM-6825] Use explicit type annotation

* [PM-6825] Use property binding instead of interpolation
2024-05-21 17:05:02 -04:00
Daniel James Smith
3ba19d8c9d
Add missing RouterModule to the CurrentAccountComponent (#9295)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-05-21 22:58:37 +02:00
Daniel James Smith
983a82c0ba
[PM-7611] Create a new vault settings component [UI changes] (#9220)
* Create vault-settings-v2 component

- Copy existing vault-settings component
- Make new component standalone
- Replace app-header with popup-header
- Replace nav-buttons with bit-item

- Register route to show new component when extension refresh flag is enabled

* Move sync functionality to vault-settings-v2

* Use anchors instead of buttons when navigating to a sub-page

* Removed unneeded component within routing

* Use new ToastService instead of PlatformUtils

* Remove unused MessagingService

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-05-21 20:13:40 +00:00
Matt Gibson
dff44b02e2
Retrieve auth status when updating overlay ciphers. (#9282)
* Retrieve auth status when updating overlay ciphers.

We are experiencing a hang due to e8ed4f38f4/apps/browser/src/background/main.background.ts (L1218) and the fact that the auth status is not updated during account switch for this service. Ideally, the service would just use latest everywhere, but this is sufficient for this bug fix.

Account-switcher changes avoid multiple updates for the same event.

* Avoid loop

* Test fixes

Co-authored-by: Cesar Gonzalez <cesar.a.gonzalezcs@gmail.com>

---------

Co-authored-by: Cesar Gonzalez <cesar.a.gonzalezcs@gmail.com>
2024-05-21 10:46:46 -04:00
Daniel James Smith
a3d69047c7
[PM-8252] Use new user-verification for exports on all clients (#9244)
* Move/replace submit and userVerification logic from web into the BaseExportComponent

Add "@bitwarden/auth" as dependency to the vault-export-ui package
New submit logic also checks for password-encrypted exports which will be need for future UI updates on browser and desktop

* Remove import/passing of the unneeded UserVerificationService

* Remove app-user-verification from browser and desktop components as the new UI is opened as a self-contained dialog

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-05-21 13:02:16 +02:00
Jonathan Prusik
e00f3e10c0
do not show the inline menu when there are no active users (#9273) 2024-05-20 17:08:35 -04:00
Cesar Gonzalez
ac633687ec
[PM-8276] Edge Cannot Copy to Clipboard When Using Mv3 (#9266)
* [PM-8276] Edge Cannot Copy to Clipboard When Using Mv3

* [PM-8276] Fixing jest tests

* [PM-8276] Fixing jest tests

* [PM-8276] Fixing jest tests
2024-05-20 14:37:55 -05:00
✨ Audrey ✨
a16dc84a0a
[PM-6819] Credential generator MV3 integration (#8998)
* replace `PasswordGeneratorService` with `legacyPasswordGenerationServiceFactory`
* replace `UsernameGeneratorService` with `legacyUsernameGenerationServiceFactory`
* migrate generator options and history
* apply policy immediately once available
* suppress duplicate policy emissions
* run password generation response code in `ngZone`
2024-05-20 18:08:49 +01:00
Daniel James Smith
fe81470f36
[PM-6195] Refactor injection of services in browser services module (Pt2) (#8849)
* Remove UsernameGenerationService from popup/services.module

* Remove PasswordGenerationService from popup/services.module

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-05-20 09:49:47 -04:00
Will Martin
034227d993
[CL-290] make popup layout grow to full height (#9237)
* add tw-h-full to popup layout template

* add story
2024-05-20 13:38:14 +02:00
github-actions[bot]
4131aa9803
Autosync the updated translations (#9255)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2024-05-20 08:39:05 +00:00
Matt Gibson
a0efc78a52
Remove deprecated factory methods (#9077)
Note: Some of the init code here will be usable in the future for a different dependency framework.
2024-05-20 09:07:39 +10:00
Jonathan Prusik
82d98b8ff1
defer badge and menu state updates (#9223) 2024-05-17 15:00:37 -04:00
Matt Gibson
7d29b3be13
Wait for account to switch before proceeding (#9229) 2024-05-17 14:47:21 -04:00
github-actions[bot]
48921d4bac
Autosync the updated translations (#9227)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2024-05-17 14:17:43 +00:00
Matt Gibson
7819dbdd56
PM-8197 Do not allow browser biometric for locked account (#9216)
Process reload is the means by which we protect user keys in memory. once an account locks, it triggers a process reload (assuming no other accounts are unlocked), that frees renderer memory.

However, if the user is not unlocked, it is not protected by the process reload, so we may keep user keys in memory.
2024-05-17 14:54:19 +02:00
Daniel James Smith
9db2495de3
Make app-current-account a standalone component (#9215)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-05-17 13:07:00 +02:00
Matt Gibson
ee690cd1ef
Use account service for getting account profile data. (#9133)
* Use account service for getting account profile data.

* desktop build fixes

* CLI build fixes

* Remove state service methods
2024-05-17 00:21:00 +02:00
Matt Gibson
4afe5de87b
Revert "[PM-7810] Handle Multithread Decryption Through Offscreen API (#8978)" (#9221)
This reverts commit f51042f813.
2024-05-16 15:48:03 -04:00
Nick Krantz
bed8239c92
[PM-6823] Vault Header Refresh (#9197)
* add V2 variant to pop-out component

* Add V2 version of the vault header

* refactor IconButtonModule import

* refactor IconButtonModule import

* use feature flag to drive pop out redesign

* use an anchor rather than a button

* remove VaultFilterService and add todo comment

* remove no-decoration class will be fixed by component library

* bring back constructor
2024-05-16 14:30:44 -05:00
Daniel James Smith
86a5b99b31
Fix the back navigation on the popup-header component (#9218)
Wire up the button click to execute `back()`

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-05-16 14:37:32 -04:00
Nick Krantz
ff19514c27
[PM-7878] PopupSectionHeader component (#9107)
* add PopupSectionHeaderComponent

* refactor to shorter imports + format

* use title as an input

* use small icon buttons for section header
2024-05-15 19:57:59 -05:00
Matt Gibson
e55e3d5b9b
[PM-8159] [PM-8158] [PM-8156] Swallow multiple offscreen document errors (#9195)
* Swallow multiple offscreen document errors

The API has race issues with determining if an offscreen document exists (https://groups.google.com/a/chromium.org/g/chromium-extensions/c/s2Wp55bjySE/m/SnjJu1MdAAAJ). However, there are no negative effects of attempting to open multiple other than this throw.

* Resolve circular dependency
2024-05-15 17:41:04 -04:00
Justin Baur
25f55e1368
[PM-7978] Create ForegroundSyncService For Delegating fullSync Calls (#9192)
* Create ForegroundSyncService For Delegating `fullSync` calls to the background

* Relax `isExternalMessage` to Allow For Typed Payload

* Null Coalesce The `startListening` Method

* Filter To Only External Messages
2024-05-15 12:11:06 -04:00
Matt Gibson
426bacfd67
Ps/pm-8003/handle-dekstop-invalidated-message-encryption (#9181)
* Do not initialize symmetric crypto keys with null

* Require new message on invalid native message encryption

Handling of this error is to require the user to retry, so the promise needs to resolve.
2024-05-15 10:45:40 -04:00
Matt Gibson
94b57687f5
[PM-7926] Handle complex user logout events (#9115)
* Update activity when switching users

* Clear data of designated user

* Do not switchMap to null, always to Promise or Observable

* handle uninitialized popup services

* Switch to new account immediately and log out as inactive.

Split up done logging out and navigation so we can always display expire warning.

* Do not navigate in account switcher, main.background takes care of it

* Ignore storage updates from reseed events

* Remove loading on cancelled logout

* Catch missed account switch errors

* Avoid usage of active user state in sync service

Send service does not currently support specified user data
manipulation, so we ensure that the notification was sent to the
active user prior to processing the notification.

* Clear sequentialize caches on account switch

These caches are used to ensure that rapid calls to an async method are not repeated. However, the cached promises are valid only within a given userId context and must be cleared when that context changes.

* Revert `void` promise for notification reconnect

* Update libs/angular/src/services/jslib-services.module.ts

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

* Handle switch account routing through messaging background -> app

* Use account switch status to handle unlocked navigation case.

* Revert "Handle switch account routing through messaging background -> app"

This reverts commit 8f35078ecb.

---------

Co-authored-by: Cesar Gonzalez <cesar.a.gonzalezcs@gmail.com>
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
2024-05-14 16:27:43 -04:00
Andreas Coroiu
7f91e84456
[PM-6400] Move core FIDO2 code from vault to platform ownership (#8044)
* [PM-6400] Move core FIDO2 code from vault to platform ownership

- lib/common/vault/abstractions/fido2 -> lib/common/platform/abstractions/fido2
- lib/common/vault/services/fido2 -> lib/common/platform/services/fido2

* [PM-6400] fix: wrong imports
2024-05-14 14:08:41 +00:00
Jared Snider
66f5d90803
PM-5501 - VaultTimeoutSettingsSvc State Provider Migration - Small bugfixes (#9164)
* PM-5501 - VaultTimeoutSettingsSvc - fix setVaultTimeoutOptions condition which needed to use never instead of null.

* PM-5501 - Fix browser and desktop not showing the never lock warning

* PM-5501 - Use true equality.
2024-05-13 17:04:26 -04:00
Jared Snider
473c5311fa
Auth/PM-5501 - VaultTimeoutSettingsService State Provider Migration (#8604)
* PM-5501 - VaultTimeoutSettingsSvc - refactor var names in getVaultTimeoutAction

* PM-5501 - Add state definitions and key definitions + test deserialization of key defs.

* PM-5501 - Add state provider dep to VaultTimeoutSettingsSvc

* PM-5501 - Refactor getVaultTimeout

* PM-5501 - VaultTimeoutSettingsService - Build getMaxVaultTimeoutPolicyByUserId helper

* PM-5501 - (1) Update state definitions (2) convert KeyDefs to UserKeyDefs (2) Remove everBeenUnlocked as we won't need it

* PM-5501 - VaultTimeoutSettingsSvc - POC for getVaultTimeoutActionByUserId$ method + new private determineVaultTimeoutAction helper.

* PM-5501 - VaultTimeoutSettingsSvc - build set and observable get methods for vault timeout settings

* PM-5501 - Update web references to use new vault timeout setting service methods

* PM-5501 - VaultTimeoutSettingsSvc - write up abstraction js docs

* PM-5501 - VaultTimeoutSettingsSvc abstraction - finish tweaks

* PM-5501 - VaultTimeoutSettingsSvc - add catchError blocks to observables to protect outer observables and prevent cancellation in case of error.

* PM-5501 - Remove vault timeout settings from state service implementation.

* PM-5501 - VaultTimeoutSettingsServiceStateProviderMigrator first draft

* PM-5501 - WIP - replace some state service calls with calls to vault timeout settings svc.

* PM-5501 - Replace state service calls in login strategies to get vault timeout settings data with VaultTimeoutSettingsService calls.

* PM-5501 - Fix login strategy tests

* PM-5501 - Update login strategy tests to pass

* PM-5501 - CryptoSvc - share VaultTimeout user key def to allow crypto svc access to the vault timeout without creating a circular dep.

* PM-5501 - Fix dependency injections.

* PM-5501 - ApiSvc - replace state svc with vault timeout settings svc.

* PM-5501 - VaultTimeoutSettingsServiceStateProviderMigrator more cleanup

* PM-5501 - Test VaultTimeoutSettingsServiceStateProviderMigrator

* PM-5501 - VaultTimeoutSettingsSvc tests updated

* PM-5501 - Update all setVaultTimeoutOptions references

* PM-5501 - VaultTimeoutSettingsSvc - Update setVaultTimeoutOptions to remove unnecessary logic and clean up clearTokens condition.

* PM-5501 - Fix vault timeout service tests

* PM-5501 - Update VaultTimeoutSettings state tests to pass

* PM-5501 - Desktop - system svc - fix build by replacing use of removed method.

* PM-5501 - Fix CLI by properly configuring super class deps in NodeApiService

* PM-5501 - Actually finish getitng deps fixed to get CLI to build

* PM-5501 - VaultTimeoutSettingsSvc.determineVaultTimeoutAction - pass userId to getAvailableVaultTimeoutActions to prevent hang waiting for an active user.

* PM-5501 - VaultTimeoutSettingSvc test - enhance getVaultTimeoutActionByUserId$ to also test PIN scenarios as an unlock method

* PM-5501 - bump migration version

* PM-5501 - Refactor migration to ensure the migration persists null vault timeout values.

* PM-5501 - Bump migration version

* PM-5501 - Fix web build issues introduced by merging main.

* PM-5501 - Bump migration version

* PM-5501 - PreferencesComponent - revert dep change from InternalPolicyService to standard PolicyService abstraction

* PM-5501 - Address all PR feedback from Jake

Co-authored-by: Jake Fink <jfink@bitwarden.com>

* PM-5501 - VaultTimeoutSettingsSvc tests - add tests for setVaultTimeoutOptions

* PM-5501 - VaultTimeoutSettingsSvc - setVaultTimeoutOptions - Update tests to use platform's desired syntax.

* PM-5501 - Fix tests

* PM-5501 - Create new VaultTimeout type

* PM-5501 - Create new DEFAULT_VAULT_TIMEOUT to allow each client to inject their default timeout into the VaultTimeoutSettingService

* PM-5501 - Migrate client default vault timeout to new injection token

* PM-5501 - Update VaultTimeoutSettingsSvc to use VaultTimeout type and apply default vault timeout if it is null.

* PM-5501 - Update vaultTimeout: number to be vaultTimeout: VaultTimeout everywhere I could find it.

* PM-5501 - More changes based on changing vaultTimeout from number to VaultTimeout type.

* PM-5501 - VaultTimeoutSvc - Update shouldLock logic which previously checked for null (never) or any negative values (any strings except never) with a simple string type check.

* PM-5501 - More cleanup of vaultTimeout type change - replacing null checks with "never" checks

* PM-5501 - VaultTimeoutSettingsSvc - refactor determineVaultTimeout to properly treat string and numeric vault timeouts.

* PM-5501 - Update vault timeout settings service tests to reflect new VaultTimeout type.

* PM-5501 - VaultTimeoutSettingsService - add more test cases for getVaultTimeoutByUserId

* PM-5501 - (1) Remove "immediately" as 0 is numerically meaningful and can be used with Math.min (2) Add VaultTimeoutOption interface for use in all places we show the user a list of vault timeout options.

* PM-5501 - VaultTimeoutSettingSvc - update tests to use 0 as immediately.

* PM-5501 - VaultTimeoutInputComp - Add new types and update applyVaultTimeoutPolicy logic appropriately.

* PM-5501 - Add new types to all preferences and setting components across clients.

* PM-5501 - Fix bug on web where navigating to the preferences page throws an error b/c the validatorChange function isn't defined.

* PM-5501 - WIP on updating vault timeout setting migration and rollback + testing it.

* PM-5501 - Update VaultTimeoutSettingsSvc state provider migration and tests to map existing possible values into new VaultTImeout type.

* PM-5501 - Fix vault timeout settings state tests by changing number to new VaultTimeout type.

* PM-5501 - Fix crypto svc auto key refresh test to use "never" instead of null.

* PM-5501 - Add clarifying comment to vaulttimeout type

* PM-5501 - Desktop app comp - replace systemTimeoutOptions with vault timeout type.

* PM-5501 - Update vault timeout service tests to use VaultTimeout type.

* PM-5501 - VaultTimeoutSettingsSvc - (1) Fix bug where vault timeout action didn't have a default like it did before (2) Fix bug in userHasMasterPassword where it would incorrectly return the active user stream for a given user id as a fallback. There is no guarantee the given user would match the active user so the paths are mutually exclusive.

* PM-5501 - Login Strategy fix - Move retrieval of vault timeout settings and setting of the tokens until after account init and user decryption options set as those opts are needed to properly determine the user's available vault timeout actions.

* PM-5501 - Fix vault timeout settings svc tests

* PM-5501 - VaultTimeoutSettingSvc - move default logic to determine methods + refactor default vault timeout action to properly default to lock in scenarios the user has lock available.

* Update libs/angular/src/components/settings/vault-timeout-input.component.ts

Co-authored-by: Cesar Gonzalez <cesar.a.gonzalezcs@gmail.com>

* PM-5501 - Per PR feedback, cleanup commented out vault timeout options

* PM-5501 - Fix vault timeout input comp lint issues

* PM-5501 - Per PR feedback from Cesar, update VaultTimeout type to use const so we can avoid any magic string usage. Awesome.

Co-authored-by: Cesar Gonzalez <cesar.a.gonzalezcs@gmail.com>

* PM-5501 - CLI - use "never" as default vault timeout instead of null.

* PM-5501 - Fix broken tests

* PM-5501 - Bump migration version

* PM-5501 - Fix build errors after merging main.

* PM-5501 - Update mockMigrationHelper to pass along client type so tests will respect it.

* PM-5501 - Update VaultTimeoutSettingsServiceStateProviderMigrator and tests to use new CLI client type to convert undefined values to never so that CLI users don't lose their session upon running this migration.

* PM-5501 - Bump migration version

* PM-5501 - Fix migration tests to use new authenticated user format

* PM-5501 Update rollback tests

* PM-5501 - Adjust migration based on feedback.

* PM-5501 - Per Jake's find, fix missed -2

Co-authored-by: Jake Fink <jfink@bitwarden.com>

* PM-5501 - Add user id to needsStorageReseed.

Co-authored-by: Jake Fink <jfink@bitwarden.com>

* PM-5501 - Per PR feedback, setVaultTimeoutOptions shouldn't accept null for vault timeout anymore.

* PM-5501 - Per PR feedback, add null checks for set methods for setting vault timeout or vault timeout action.

* PM-5501 - Per PR feedback, add more context as to why we need vault timeout settings to persist after logout.

* PM-5501 - Per PR feedback, fix userHasMasterPassword

* PM-5501 - VaultTimeoutSettingsService - fix userHasMasterPassword check by checking for null decryption options.

* PM-5501 - Remove state service from vault timeout settings service (WOOO)

* PM-5501 - Bump migration version

* PM-5501 - Account Security comp - refactor to consider ease of debugging.

* PM-5501 - (1) Add checks for null vault timeout and vault timeout actions (2) Add tests for new scenarios.

* PM-5501 - VaultTimeoutSettingsSvc - setVaultTimeoutOptions - fix bug where nullish check would throw incorrectly if immediately (0) was picked as the timeout.

* PM-5501 - Per PR feedback, clean up remaining token service methods which accept null for timeout and add tests. .

* PM-5501 - Fix nit

---------

Co-authored-by: Jake Fink <jfink@bitwarden.com>
Co-authored-by: Cesar Gonzalez <cesar.a.gonzalezcs@gmail.com>
2024-05-13 15:56:04 -04:00
✨ Audrey ✨
5092151b54
add i18n messages used by forwarders (#9158) 2024-05-13 12:11:15 -04:00
github-actions[bot]
800892e1f3
Autosync the updated translations (#9113)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2024-05-13 12:39:47 +00:00
Justin Baur
657807c96a
[PM-7985] Add & Use InlineDerivedStateProvider (#9131)
* Add & Use InlineDerivedStateProvider

* Remove Comment

* Delete Foreground & Background Derived State
2024-05-13 07:42:29 -04:00
Daniel James Smith
fb3766b6c1
[CL-282] Make app-pop-out standalone (#9106)
* Move pop-out.component into platform ownership

* Make pop-out.component standalone

* Fix no-floating-promises

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-05-09 22:36:42 +02:00
SmithThe4th
acc4251372
[PM-4577] Enhance passkey user verification to use configured unlock methods (#8746)
* initial commit

* fixed issue with clearing search index state

* clear user index before account is totally cleaned up

* added logout clear on option

* removed redundant clear index from logout

* Implemented user verification logic for the different use cases, added functions to pompt for user to set pin

* added missing await and removed else if conditionals

* fixed no return after user sets pin

* added comment to further explain user verification when user is coming from lock screen

* [PM-7836] UV not properly used when creating an item from [+] or Save passkey as new item (#8993)

* added user verification using the save new login button and + button

* removed commented out code

* [PM-7808][PM-7848] UV Preferred/Required, Item has MP reprompt, user without MP incorrectly bypasses UV and When UV = discouraged, cannot save passkey to item using [+] button (#9015)
2024-05-09 14:18:02 -04:00
Jake Fink
c69cc37716
[PM-7747] add timeout to safari sendMessageWithResponse (#9082)
* add timeout to safari sendMessageWithResponse

* change to query views instead of sending message
2024-05-09 10:54:05 -04:00
Daniel James Smith
da144410e8
Remove settings from options.component which had been moved to notifications.component (#9093)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-05-09 06:30:43 -04:00
Daniel James Smith
2227fd1190
Rename about.component to about-dialog.component (#9094)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-05-09 06:29:51 -04:00
Daniel James Smith
37d409578a
[PM-7740] Create notifications settings component (navigational changes) (#8919)
* Move about.component into tools ownership

* Split out account security settings

Move settings.component.ts to auth/popup/settings and rename to account-security.component.ts
Move controls from settings.component.html and create account-security.component.html
Move settings.component.html to tools/popup/settings.component.html
Create settings.component.ts under tools/popup/settings
Fixup module imports and routing
Add new strings to en/message.json

* Move vault-timeout-input.component to auth

* Move await-desktop-dialog.component to auth

* Add transition for account-security

* Create notifications settings component

* Move excluded-domains component over to be owned by team-autofill

* Add notifications entry to settings screen

* Move excluded domains from settings to notifications settings screen

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-05-08 15:04:41 -04:00
rr-bw
a42de41587
[PM-5363] PinService State Providers (#8244)
* move pinKeyEncryptedUserKey

* move pinKeyEncryptedUserKeyEphemeral

* remove comments, move docs

* cleanup

* use UserKeyDefinition

* refactor methods

* add migration

* fix browser dependency

* add tests for migration

* rename to pinService

* move state to PinService

* add PinService dep to CryptoService

* move protectedPin to state provider

* update service deps

* renaming

* move decryptUserKeyWithPin to pinService

* update service injection

* move more methods our of crypto service

* remove CryptoService dep from PinService and update service injection

* remove cryptoService reference

* add method to FakeMasterPasswordService

* fix circular dependency

* fix desktop service injection

* update browser dependencies

* add protectedPin to migrations

* move storePinKey to pinService

* update and clarify documentation

* more jsdoc updates

* update import paths

* refactor isPinLockSet method

* update state definitions

* initialize service before injecting into other services

* initialize service before injecting into other services (bw.ts)

* update clearOn and do additional cleanup

* clarify docs and naming

* assign abstract & private methods, add clarity to decryptAndMigrateOldPinKeyEncryptedMasterKey() method

* derived state (attempt)

* fix typos

* use accountService to get active user email

* use constant userId

* add derived state

* add get and clear for oldPinKeyEncryptedMasterKey

* require userId

* move pinProtected

* add clear methods

* remove pinProtected from account.ts and replace methods

* add methods to create and store pinKeyEncryptedUserKey

* add pinProtected/oldPinKeyEncrypterMasterKey to migration

* update migration tests

* update migration rollback tests

* update to systemService and decryptAndMigrate... method

* remove old test

* increase length of state definition name to meet test requirements

* rename 'TRANSIENT' to 'EPHEMERAL' for consistency

* fix tests for login strategies, vault-export, and fake MP service

* more updates to login-strategy tests

* write new tests for core pinKeyEncrypterUserKey methods and isPinSet

* write new tests for pinProtected and oldPinKeyEncryptedMasterKey methods

* minor test reformatting

* update test for decryptUserKeyWithPin()

* fix bug with oldPinKeyEncryptedMasterKey

* fix tests for vault-timeout-settings.service

* fix bitwarden-password-protected-importer test

* fix login strategy tests and auth-request.service test

* update pinService tests

* fix crypto service tests

* add jsdoc

* fix test file import

* update jsdocs for decryptAndMigrateOldPinKeyEncryptedMasterKey()

* update error messages and jsdocs

* add null checks, move userId retrievals

* update migration tests

* update stateService calls to require userId

* update test for decryptUserKeyWithPin()

* update oldPinKeyEncryptedMasterKey migration tests

* more test updates

* fix factory import

* update tests for isPinSet() and createProtectedPin()

* add test for makePinKey()

* add test for createPinKeyEncryptedUserKey()

* add tests for getPinLockType()

* consolidate userId verification tests

* add tests for storePinKeyEncryptedUserKey()

* fix service dep

* get email based on userId

* use MasterPasswordService instead of internal

* rename protectedPin to userKeyEncryptedPin

* rename to pinKeyEncryptedUserKeyPersistent

* update method params

* fix CryptoService tests

* jsdoc update

* use EncString for userKeyEncryptedPin

* remove comment

* use cryptoFunctionService.compareFast()

* update tests

* cleanup, remove comments

* resolve merge conflict

* fix DI of MasterPasswordService

* more DI fixes
2024-05-08 11:34:47 -07:00
Daniel James Smith
c2812fc21d
[PM-7176] Create appearance settings component (navigational changes) (#8911)
* Move about.component into tools ownership

* Split out account security settings

Move settings.component.ts to auth/popup/settings and rename to account-security.component.ts
Move controls from settings.component.html and create account-security.component.html
Move settings.component.html to tools/popup/settings.component.html
Create settings.component.ts under tools/popup/settings
Fixup module imports and routing
Add new strings to en/message.json

* Move vault-timeout-input.component to auth

* Move await-desktop-dialog.component to auth

* Add transition for account-security

* Create appearance settings component

* Add entry in settings to navigate to the appearance settings page

* Add transition animation for settings to appearance and back

* Remove settings from options that are now under appearance

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-05-08 19:25:24 +02:00
Matt Gibson
7d5575882e
Allow selecting of version numbers for copy-pasting in issues (#9078)
* Allow selecting of version numbers for copy-pasting in issues

* Simplify user-select override

Expands selectable area to labels of versions
2024-05-08 11:34:07 -04:00
Jason Ng
6c05aacbba
[PM-6822] Create new Vault V2 component for extension refresh (#9065)
* created v2 component. added it to app routing
2024-05-08 10:18:19 -04:00
Daniel James Smith
5682e38384
[PM-7175] Create vault settings component (navigational changes) (#8840)
* Move about.component into tools ownership

* Split out account security settings

Move settings.component.ts to auth/popup/settings and rename to account-security.component.ts
Move controls from settings.component.html and create account-security.component.html
Move settings.component.html to tools/popup/settings.component.html
Create settings.component.ts under tools/popup/settings
Fixup module imports and routing
Add new strings to en/message.json

* Move vault-timeout-input.component to auth

* Move await-desktop-dialog.component to auth

* Move folder.component to vault/popup/settings

* Move sync.component to vault/popup/settings

* Create vault settings component

Move controls from settings.component.html to vault-settings.component.html
Register VaultSettingsComponent within app.module
Register route for VaultSettingsComponent
Add new string in en/messages.json

* Fix routing for back navigation on child pages of vault settings

* Add transitions to vault-settings sub-pages

* Add transition for account-security

* Add an await to popping out the extension

* Use "Vault" instead of "Vault settings" as title

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-05-07 17:58:31 -04:00
Matt Gibson
ea7d1ff6ed
Handle error object for biometric lock (#9070) 2024-05-07 14:43:42 -07:00
Daniel James Smith
7bb37877ee
Fix test after session-removal with https://github.com/bitwarden/clients/pull/9024 (#9076)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-05-07 17:04:17 -04:00
Daniel James Smith
29bd03e64e
[PM-7172] Create account security settings component (navigational changes) (#8817)
* Move about.component into tools ownership

* Split out account security settings

Move settings.component.ts to auth/popup/settings and rename to account-security.component.ts
Move controls from settings.component.html and create account-security.component.html
Move settings.component.html to tools/popup/settings.component.html
Create settings.component.ts under tools/popup/settings
Fixup module imports and routing
Add new strings to en/message.json

* Move vault-timeout-input.component to auth

* Move await-desktop-dialog.component to auth

* Add transition for account-security

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-05-07 16:23:03 -04:00
Will Martin
27d4178287
[PS] fix broken local Storybook (#9075)
* add disableRoutesGraph to compdocArgs

* fix popup-layout story routes
2024-05-07 14:48:23 -04:00
Matt Gibson
de0852431a
[PM-7917] Remove session sync (#9024)
* Remove session sync and MemoryStorageService

* Fix merge
2024-05-07 13:25:49 -04:00
Shane Melton
c241aba025
[AC-2555] Cipher collections dialog merge fixes (#9036)
* [AC-2555] Fix missing feature flags in CollectionsComponent

* [AC-2555] Do not filter collections when opening the cipher collections dialog in the org vault
2024-05-07 10:00:47 -07:00
Bitwarden DevOps
af6a63c10b
Bumped browser,cli,desktop,web version to (#9064) 2024-05-06 22:37:46 +00:00
Jonathan Prusik
6c21223466
[PM-7662] Suppress welcome window on install when extension is in dev mode (#8864)
* suppress welcome window on install when extension is in dev mode

* use platformUtilsService.isDev instead of process.env.ENV

* use devFlags.skipWelcomeOnInstall instead of platformUtilsService.isDev

* update old dev_flags casing in base configs
2024-05-06 15:25:41 -04:00
Shane Melton
ff3021129e
[PM-6827] Browser Extension Refresh - Tabs Routing (#9004)
* [PM-6827] Add componentRouteSwap util function

* [PM-6827] Add extension-refresh feature flag

* [PM-6827] Add extension-refresh route swap utils

* [PM-6827] Add the TabsV2 component

* [PM-6827] Add the TabsV2 to routing module

* [PM-6827] Fix route prefixes in popup-tab-navigation component
2024-05-06 09:14:47 -07:00
Jake Fink
09ff12fc02
[PM-7919] Add more tde logging (#9035)
* adds additional logging to TDE service

* remove base catch swallowing errors

* add dependency to cli

* fix comment
2024-05-06 11:15:33 -04:00
github-actions[bot]
b223e62c06
Autosync the updated translations (#9051)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2024-05-06 14:54:09 +00:00
Justin Baur
e4ef7d362e
[PM-7838] [PM-7864] Ensure AuthStatus Changes Before Exiting (#9018)
* Ensure AuthStatus Changes Before Exiting

* Do Not Display Account Without Name Or Email

* Fix Environment Selectors

* Add AccountService.clean to Web
2024-05-03 16:43:42 -04:00
Matt Gibson
a4d5717283
Use account service for account enumeration. (#9023) 2024-05-03 14:24:30 -04:00
github-actions[bot]
f5012e39ef
Autosync the updated translations (#9026)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2024-05-03 07:14:45 +00:00
Daniel James Smith
e774089d0e
Make premium.component to be owned by team-billing-dev (#8935)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-05-02 15:04:38 -04:00
Cesar Gonzalez
6b286e9d9e
[PM-7874] Fix lost state when adding a vault item on the current tab view (#9020) 2024-05-02 11:39:48 -05:00
Cesar Gonzalez
f51042f813
[PM-7810] Handle Multithread Decryption Through Offscreen API (#8978)
* [PM-7810] Handle Multithread Decryption through Offscreen API

* [PM-7810] Handle Multithread Decryption through Offscreen API

* Use a service to track when to open and close offscreen document

There some strangeness around maintaining the offscreen document for more callbacks, that need not have the same reasons and justifications as the original.

We'd need to test, but perhaps the intent is something closer to maintaining a work queue ourselves and creating the offscreen page for only a single reason as it comes in, then waiting for that page to close before opening another.

* [PM-7810] Handle Multithread Decryption through Offscreen API

* [PM-7810] Handle Multithread Decryption through Offscreen API

* [PM-7810] Handle Multithread Decryption through Offscreen API

* [PM-7810] Handle Multithread Decryption through Offscreen API

* [PM-7810] Implementing jest tests for OffscreenDocument and BrowserMultithreadEncryptServiceImplementation

* [PM-7810] Separating out the process by which we get decrypted items from the web worker to ensure we do not do duplicate effort

* [PM-7810] Separating out the process by which we get decrypted items from the web worker to ensure we do not do duplicate effort

* Prefer builtin promise flattening

* [PM-7810] Introducing a fallback to the MultithreadEncryptServiceImplementation to ensure we can fallback to single thread decryption if necessary

* [PM-7810] Updating documentation

* [PM-7810] Fixing implementation to leverage the new OffscreenDocumentService

---------

Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
2024-05-02 16:12:41 +00:00
Jonathan Prusik
26988730b1
[PM-7627] [MV3] Do not run fido2 content scripts on browser settings or extension pages (#8863)
* do no run fido2 content scripts on browser settings or extension background pages

* remove unneeded overlay visibility setting state guard

* only filter content script and page script and update test

* handle content script host permission errors

* add activeTab to mv3 permissions

* allow other browser inject errors to throw
2024-05-02 11:19:00 -04:00
Daniel James Smith
8b28eee3a7
[PM-7701] Clean up services module (#8907)
* Remove usage of getBgService for CipherService

With CipherService using StateProviders: https://github.com/bitwarden/clients/pull/8314 - we should no longer need CipherService

* Remove usage of getBgService for CollectionService

With CollectionService using StateProviders: https://github.com/bitwarden/clients/pull/7732 - we should no longer need CollectionService

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-05-02 15:46:32 +02:00
Matt Gibson
ee2f96d3c4
Use a service to track when to open and close offscreen document (#8977)
* Use a service to track when to open and close offscreen document

There some strangeness around maintaining the offscreen document for more callbacks, that need not have the same reasons and justifications as the original.

We'd need to test, but perhaps the intent is something closer to maintaining a work queue ourselves and creating the offscreen page for only a single reason as it comes in, then waiting for that page to close before opening another.

* Prefer builtin promise flattening

* Await anything and everything

---------

Co-authored-by: Cesar Gonzalez <cesar.a.gonzalezcs@gmail.com>
2024-05-02 09:10:06 +02:00
Justin Baur
4b42ff7171
[PM-3483] Remove migrateKeyForNeverLockIfNeeded Logic (#8953)
* Remove `migrateKeyForNeverLockIfNeeded` Logic

* Fix Test

* Remove `migrateAutoKeyIfNeeded`
2024-05-01 15:50:40 -04:00
Matt Gibson
7e9ab6a15b
[PM-7807][PM-7617] [PM-6185] Firefox private mode out of experimentation (#8921)
* Remove getbgService for crypto service

* Remove special authentication for state service

* Use synced memory storage

popup contexts use foreground, background contexts use background. Simple

* Remove private mode warnings
2024-05-01 07:59:30 -04:00
Matt Gibson
b4631b0dd1
Ps/improve-log-service (#8989)
* Match console method signatures in logService abstraction

* Add a few usages of improved signature

* Remove reality check test

* Improve electron logging
2024-04-30 12:58:16 -04:00
Justin Baur
3acbffa072
[PM-6144] Basic auth autofill in Manifest v3 (#8975)
* Add Support for autofilling Basic Auth to MV3

* Remove `any`
2024-04-30 12:35:36 -04:00
Will Martin
e7416384dc
[CL-220] item components (#8870) 2024-04-30 10:27:47 -04:00
Matt Gibson
c70a5aa024
[PM-6688] Use AccountService as account source (#8893)
* Use account service to track accounts and active account

* Remove state service active account Observables.

* Add email verified to account service

* Do not store account info on logged out accounts

* Add account activity tracking to account service

* Use last account activity from account service

* migrate or replicate account service data

* Add `AccountActivityService` that handles storing account last active data

* Move active and next active user to account service

* Remove authenticated accounts from state object

* Fold account activity into account service

* Fix builds

* Fix desktop app switch

* Fix logging out non active user

* Expand helper to handle new authenticated accounts location

* Prefer view observable to tons of async pipes

* Fix `npm run test:types`

* Correct user activity sorting test

* Be more precise about log out messaging

* Fix dev compare errors

All stored values are serializable, the next step wasn't necessary and was erroring on some types that lack `toString`.

* If the account in unlocked on load of lock component, navigate away from lock screen

* Handle no users case for auth service statuses

* Specify account to switch to

* Filter active account out of inactive accounts

* Prefer constructor init

* Improve comparator

* Use helper methods internally

* Fixup component tests

* Clarify name

* Ensure accounts object has only valid userIds

* Capitalize const values

* Prefer descriptive, single-responsibility guards

* Update libs/common/src/state-migrations/migrate.ts

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

* Fix merge

* Add user Id validation

activity for undefined was being set, which was resulting in requests for the auth status of `"undefined"` (string) userId, due to key enumeration. These changes stop that at both locations, as well as account add for good measure.

---------

Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
2024-04-30 09:13:02 -04:00
Jared Snider
20de053770
Auth/PM-7811 - Refactor User Auto Unlock Key Hydration Process To Remove Race Conditions (#8979)
* PM-7811 - Refactor UserKeyInitService to UserAutoUnlockKeyService - remove active account listening logic as it introduced race conditions with user key memory retrieval happening before the user auto unlock key was set into memory.

* PM-7811 - CLI - (1) Fix deps (2) On CLI init (pre command execution), if there is an active account, then set the user key in memory from the user auto unlock key.

* PM-7811 - Browser Extension / desktop - (1) Update deps (2) Sets user key in memory if the auto unlock key is set on account switch and background init (must act on all accounts so that account switcher displays unlock status properly).

* PM-7811 - Web - (1) Update deps (2) Sets user key in memory if the auto unlock key is set on init

* PM-7811 - Fix account switcher service changes not being necessary.
2024-04-29 17:43:14 -04:00
Justin Baur
3caa6cb635
[PM-7766] Add clientType to MigrationHelper (#8945)
* Add `clientType` to MigrationHelper

* PM-7766 - Fix migration builder tests to take new clientType into account.

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

* PM-7766 - Add client type to migration builder tests.

* PM-7766 - Fix migration-helper.spec tests.

* PM-7766 - Fix migrator.spec.ts

---------

Co-authored-by: Jared Snider <jsnider@bitwarden.com>
2024-04-29 07:28:58 -04:00
findseat
72f411b6e3
Signed-off-by: findseat <penglili@outlook.com> (#8636)
Signed-off-by: findseat <penglili@outlook.com>
2024-04-27 15:15:27 +00:00
Jake Fink
3282b9b775
add error handling to runtime.background messaging (#8949) 2024-04-27 10:51:43 -04:00
Jake Fink
6ae086f89a
pass userId when logging out and add error handling if one isn't found in background (#8946) 2024-04-26 18:02:45 -04:00
Matt Gibson
089f251a0c
Remove memory storage cache from derived state. Use observable cache and port messaging (#8939) 2024-04-26 15:08:39 -04:00
Justin Baur
b482a15d34
Bandaid Folders Not Emitting (#8934)
* Bandaid Folders Not Emitting

* Remove VaultFilterComponent Change
2024-04-26 14:41:57 -04:00
Matt Gibson
a4f1a3f13d
Use unique port names for derived states (#8938) 2024-04-26 16:17:34 +00:00
Matt Gibson
4c1c09f07f
Use unique port names for derived states (#8937) 2024-04-26 11:21:42 -04:00
Justin Baur
a7958c1a56
Display version_name in AboutComponent (#8931) 2024-04-26 10:23:11 -04:00
Victoria League
ec37e5e4d3
[CL-219][CL-218][CL-217] Add new extension layout components (#8728) 2024-04-26 09:35:32 -04:00
github-actions[bot]
11ba8d188d
Autosync the updated translations (#8925)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2024-04-26 11:06:19 +00:00
Oscar Hinton
14b2eb99a2
[PM-2282] Make feature flags type safe (#8612)
Refactors the feature flags in ConfigService to be type safe. It also moves the default value to a centralized location rather than the caller defining it. This ensures consistency across the various places they are used.
2024-04-26 12:57:26 +02:00
Cesar Gonzalez
c3d4c7aa3d
[PM-7710] Avoid re-indexing ciphers on current tab component and re-setting null storage values for popup components (#8908)
* [PM-7710] Avoid re-indexing ciphers on current tab component and re-setting null storage values for popup components

* [PM-7710] Avoid re-indexing ciphers on current tab component and re-setting null storage values for popup components
2024-04-25 16:47:20 -05:00
Jake Fink
2ff3fa92fb
[PM-7702] Remove extra content script being injected (#8922)
* remove extra content script being injected that results in multiple messages

* add conditional logic for when to add script
2024-04-25 17:27:43 -04:00
Jake Fink
8afe915be1
[PM-7564] Move 2fa and login strategy service to popup and add state providers to 2fa service (#8820)
* remove 2fa from main.background

* remove login strategy service from main.background

* move 2fa and login strategy service to popup, init in browser

* add state providers to 2fa service
- add deserializer helpers

* use key definitions for global state

* fix calls to 2fa service

* remove extra await

* add delay to wait for active account emission in popup

* add and fix tests

* fix cli

* really fix cli

* remove timeout and wait for active account

* verify expected user is active account

* fix tests

* address feedback
2024-04-25 16:45:23 -04:00
Matt Gibson
e516eec200
Reintroduce null object remove rerouting (#8920)
* Reintroduce null object remove rerouting

* Test remove redirect
2024-04-25 14:55:45 -04:00
Ike
1e4158fd87
[PM-5735] Create kdf Service (#8715)
* 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

* Initial Kdf Service Changes

* rename and account setting kdfconfig

* fixing tests and renaming migration

* fixed DI ordering for browser

* rename and fix DI

* Clean up Migrations

* fixing migrations

* begin data structure changes for kdf config

* Make KDF more type safe; co-author: jlf0dev

* fixing tests

* Fixed CLI login and comments

* set now accepts userId and test updates

---------

Co-authored-by: Jake Fink <jfink@bitwarden.com>
2024-04-25 11:26:01 -07:00
Justin Baur
a6755f5f20
[PM-7687] Fix reloadPopup Recursion (#8902)
* Fix Message Sending Recursion

* Remove Change That Didn't Help

* Prefer `isExternalMessage` Guard

* Rollback Compare Change

---------

Co-authored-by: Cesar Gonzalez <cesar.a.gonzalezcs@gmail.com>
2024-04-24 16:54:16 -04:00
Jared Snider
5dc83cd34c
PM-6787 - Rename DeviceTrustCryptoService to DeviceTrustService (#8819) 2024-04-24 12:54:54 -04:00
Jared Snider
a12c140792
Revert "Revert "Auth/PM-6689 - Migrate Security Stamp to Token Service and St…" (#8889)
This reverts commit 100b43dd8f.
2024-04-24 12:37:19 -04:00
Justin Baur
94fe9bd053
Remove StateService useAccountCache (#8882)
* Remove Account Cache from StateService

* Remove Extra Change

* Fix Desktop Build
2024-04-24 11:20:13 -04:00
Justin Baur
493b79b888
Only Run Migrations in True Background (#8548)
* Only Run Migrations in True Background

* Use `isPrivateMode`

* Use `popupOnlyContext`
2024-04-24 11:14:53 -04:00
github-actions[bot]
bc43f3f78f
Autosync the updated translations (#8886)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2024-04-23 19:22:48 +00:00
Daniel James Smith
242ee306cf
Shorten extension description to 112 characters as that is a limit setup by Apple (#8884)
Safari extension description is limited to 112 chars
Add that restriction within the description

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-04-23 13:34:02 -05:00
github-actions[bot]
ca38a5bc1f
Autosync the updated translations (#8878)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2024-04-23 15:29:47 +00:00
Bitwarden DevOps
714ca66f33
Bumped browser,cli,desktop,web version to (#8875) 2024-04-23 11:32:09 +00:00
Justin Baur
4afb5d04f0
Remove alarms Permission (#8866) 2024-04-22 17:14:14 -04:00
Justin Baur
33dae77a4d
Revert "Stop CryptoService from using getBgService (#8843)" (#8867)
This reverts commit e297798757.
2024-04-22 21:11:30 +00:00
Justin Baur
e297798757
Stop CryptoService from using getBgService (#8843) 2024-04-22 16:54:41 -04:00
Cesar Gonzalez
29d4f1aad5
[PM-7660] Master Password Re-Prompt from Autofill Not Working (#8862) 2024-04-22 12:58:20 -05:00
Jared Snider
100b43dd8f
Revert "Auth/PM-6689 - Migrate Security Stamp to Token Service and State Prov…" (#8860)
This reverts commit 91f1d9fb86.
2024-04-22 12:06:43 -04:00
Matt Gibson
300b17aaeb
[PM-7653] Do not store disk-backed sessions as single blobs (#8852)
* Implement a lazy value class

This will be used as a source for composing key-protected storage from a single key source.

* Simplify local-backed-session-storage

The new implementation stores each value to a unique location, prefixed with `session_` to help indicate the purpose.

I've also removed the complexity around session keys, favoring passing in a pre-defined value that is determined lazily once for the service worker. This is more in line with how I expect a key-protected storage would work.

* Remove decrypted session flag

This has been nothing but an annoyance. If it's ever added back, it needs to have some way to determine if the session key matches the one it was written with

* Remove unnecessary string interpolation

* Remove sync Lazy

This is better done as a separate class.

* Handle async through type

* prefer two factory calls to incorrect value on races.

* Fix type

* Remove log

* Update libs/common/src/platform/misc/lazy.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-22 10:14:38 -04:00
Matt Gibson
b5362ca1ce
Browser MV3: Default store values to session storage (#8844)
* Introduce browser large object storage location.

This location is encrypted and serialized to disk in order to allow for storage of uncountable things like vault items that take a significant amount of time to prepare, but are not guaranteed to fit within session storage.

however, limit the need to write to disk is a big benefit, so _most_ things are written to storage.session instead, where things specifically flagged as large will be moved to disk-backed memory

* Store derived values in large object store for browser

* Fix AbstractMemoryStorageService implementation
2024-04-22 08:55:19 -04:00
Jared Snider
91f1d9fb86
Auth/PM-6689 - Migrate Security Stamp to Token Service and State Provider (#8792)
* PM-6689 - Add security stamp to Token state

* PM-6689 - Remove Security Stamp from account and state service

* PM-6689 - Add security stamp get and set to token service + abstraction + tests

* PM-6689 - Add migration for security stamp, test it, and register it with migrator

* PM-6689 - Update sync service + deps to use token service.

* PM-6689 - Cleanup missed usages of account tokens which has been removed.

* PM-6689 - Per PR feedback, remove unnecessary data migration as the security stamp is only in memory and doesn't need to be migrated.
2024-04-19 16:44:24 -04:00
Cesar Gonzalez
14cb4bc5aa
[PM-7581] Validate cache state from external contexts within LocalBackedSessionStorage (#8842)
* [PM-7581] Validate cache state from external contexts within LocalBackedSessionStorage

* [PM-7581] Continuing with exploring refining the LocalBackedSessionStorage

* [PM-7558] Fix Vault Load Times

* [PM-7558] Committing before reworking LocalBackedSessionStorage to function without extending the MemoryStorageService

* [PM-7558] Working through refinement of LocalBackedSessionStorage

* [PM-7558] Reverting some changes

* [PM-7558] Refining implementation and removing unnecessary params from localBackedSessionStorage

* [PM-7558] Fixing logic for getting the local session state

* [PM-7558] Adding a method to avoid calling bypass cache when a key is known to be a null value

* [PM-7558] Fixing tests in a temporary manner

* [PM-7558] Removing unnecessary chagnes that affect mv2

* [PM-7558] Removing unnecessary chagnes that affect mv2

* [PM-7558] Adding partition for LocalBackedSessionStorageService

* [PM-7558] Wrapping duplicate cache save early return within isDev call

* [PM-7558] Wrapping duplicate cache save early return within isDev call

* [PM-7558] Wrapping duplicate cache save early return within isDev call
2024-04-19 19:55:34 +00:00
github-actions[bot]
a2fc666823
Autosync the updated translations (#8838)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2024-04-19 19:40:56 +00:00
Jonathan Prusik
ec1af0cf9f
[PM-7610] [MV3] Guard overlay visibility and autofill on page load settings from awaiting indefinitely when there is no active account (#8833)
* guard overlay visibility and autofill on page load settings from awaiting indefinitely when there is no active account

* cleanup
2024-04-19 15:21:54 -04:00
Justin Baur
395ed3f5d4
[PM-7489] Introduce MessageSender & MessageListener (#8709)
* Introduce MessageSender

* Update `messageSenderFactory`

* Remove Comment

* Use BrowserApi

* Update Comment

* Rename to CommandDefinition

* Add More Documentation to MessageSender

* Add `EMPTY` helpers and remove NoopMessageSender

* Calm Down Logging

* Limit Logging On Known Errors

* Use `messageStream` Parameter

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

* Add eslint rules

* Update Error Handling

Co-authored-by: Cesar Gonzalez <cesar.a.gonzalezcs@gmail.com>

* Delete Lazy Classes In Favor of Observable Factories

* Remove Fido Messages

---------

Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
Co-authored-by: Cesar Gonzalez <cesar.a.gonzalezcs@gmail.com>
2024-04-19 15:02:40 -04:00
Matt Gibson
d55d240b18
Update host permission to all urls (#8831)
Discussions on this permission here: https://github.com/bitwarden/clients/pull/5985
2024-04-19 13:23:42 -04:00
Jared Snider
fffef95c5e
Auth/PM-7235 - Refactor AuthService.getAuthStatus, deprecate everBeenUnlocked, and handle initialization of auto user key on client init (#8590)
* PM-7235 - AuthSvc - Refactor getAuthStatus to simply use the cryptoService.hasUserKey check to determine the user's auth status.

* PM-7235 - CryptoSvc - getUserKey - remove setUserKey side effect if auto key is stored. Will move to app init

* PM-7235 - For each client init service, add setUserKeyInMemoryIfAutoUserKeySet logic

* PM-7235 - CryptoSvc tests - remove uncessary test.

* PM-7235 - Create UserKeyInitService and inject into all init services with new listening logic to support acct switching.

* PM-7235 - UserKeyInitSvc - minor refactor of setUserKeyInMemoryIfAutoUserKeySet

* PM-7235 - Add test suite for UserKeyInitService

* PM-7235 - Remove everBeenUnlocked as it is no longer needed

* PM-7235 - Fix tests

* PM-7235 - UserKeyInitSvc - per PR feedback, add error handling to protect observable stream from being cancelled in case of an error

* PM-7235 - Fix tests

* Update libs/common/src/platform/services/user-key-init.service.ts

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

* Update libs/common/src/platform/services/user-key-init.service.ts

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

* PM-7235 - AuthSvc - Per PR review, for getAuthStatus, only check user key existence in memory.

* PM-7235 - remove not useful test per PR feedback.

* PM-7235 - Per PR feedback, update cryptoService.hasUserKey to only check memory for the user key.

* PM-7235 - Per PR feedback, move user key init service listener to main.background instead of init service

* PM-7235 - UserKeyInitSvc tests - fix tests to plass

---------

Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
2024-04-19 11:20:13 -04:00
Joseph Flinn
8cb16fb406
Make extension copy updates for Marketing (#8822) 2024-04-19 07:02:48 -07:00
github-actions[bot]
ec1973b334
Autosync the updated translations (#8826)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2024-04-19 10:39:43 +00:00
Will Martin
d5f503a0d6
[CL-18] toast component and service (#6490)
Update toast styles and new service to CL.
2024-04-18 13:23:35 -04:00
Cesar Gonzalez
9277465951
[PM-5744] Adjust Fido2 Content Script Injection to Meet mv3 Requirements (#8222)
* [PM-5876] Adjust LP Fileless Importer to Suppress Download with DOM Append in Manifest v3

* [PM-5876] Incorporating jest tests for affected logic

* [PM-5876] Fixing jest test that leverages rxjs

* [PM-5876] Updating documentation within BrowserApi.executeScriptInTab

* [PM-5876] Implementing jest tests for the new LP suppress download content scripts

* [PM-5876] Adding a change to webpack to ensure we do not package the mv2 side script for `lp-suppress-import-download.mv2.ts` if building the extension for mv3

* [PM-5876] Implementing changes based on feedback during code review

* [PM-5876] Implementing changes based on feedback during code review

* [PM-5876] Implementing changes based on feedback during code review

* [PM-5876] Implementing changes based on feedback during code review

* [PM-5876] Implementing a configuration to feed the script injection of the Fileless Importer CSV download supression script

* [PM-5744] Adjust injection of `page-script.ts` within FIDO 2 implementation to ensure mv3 compatibility

* [PM-5744] Adjusting structure of manifest.json to clean up implementation and ensure consistency between mv2 and mv3

* [PM-5744] Reverting inclusion of the ConsoleLogService

* [PM-4791] Injected content scripts prevent proper XML file display and disrupt XML responses

* [PM-5744] Adjust FIDO2 content script injection methodology to be compatible with manifest v3

* [PM-5744] Adjusting references to Fido2Service to mirror change of name to Fido2Background

* [PM-5744] Migrating runtime background messages that are associated with Fido2 into Fido2Background

* [PM-5744] Fixing named reference within Fido2Background

* [PM-5744] Migrating all Fido2 messages from the runtime.background.ts script to the fido2.background.ts script

* [PM-5744] Removing unnecessary dependency from runtime background

* [PM-5744] Removing unnecessary dependency from runtime background

* [PM-5744] Reworking how we handle init of Fido2Background

* [PM-5744] Reworking page-script.ts to ensure that it can destory its global values on unload

* [PM-5744] Reworking page-script.ts to ensure that it can destory its global values on unload

* [PM-5744] Implementing separated injection methodology between manifest v2 and v3

* [PM-4791] Adjsuting reference for Fido2 script injection to ensure it only triggers on https protocol types

* [PM-5744] Removing unnecessary message and handling reload of content scripts based on updates on observable

* [PM-5744] Refactoring content-script implementation for fido2

* [PM-5744] Refactoring content-script implementation for fido2

* [PM-5744] Reworking implementation to avoid having multiple contenType checks within the FIDO2 content scripts

* [PM-5744] Re-implementing the messageWithResponse within runtime.background.ts

* [PM-5744] Reverting change to autofill.service.ts

* [PM-5744] Removing return value from runtime.background.ts process message call

* [PM-5744] Reworking how we handle injection of the fido2 page and content script elements

* [PM-5744] Adjusting how we override the navigator.credentials request/reponse structure

* [PM-5744] Working through jest tests for the fido2Background implementation

* [PM-5744] Finalizing jest tests for the Fido2Background implementation

* [PM-5744] Stubbing out jest tests for content-script and page-script

* [PM-5744] Implementing a methodology that allows us to dynamically set and unset content scripts

* [PM-5744] Applying cleanup to page-script.ts to lighten the footprint of the script

* [PM-5744] Further simplifying page-script implementation

* [PM-5744] Reworking Fido2Utils to remove references to the base Utils methods to allow the page-script.ts file to render at a lower file size

* [PM-5744] Reworking Fido2Utils to remove references to the base Utils methods to allow the page-script.ts file to render at a lower file size

* [PM-5744] Implementing the `RegisterContentScriptPolyfill` as a separately compiled file as opposed to an import

* [PM-5744] Implementing methodology to ensure that the RegisterContentScript polyfill is not built in cases where it is not needed

* [PM-5744] Implementing methodology to ensure that the RegisterContentScript polyfill is not built in cases where it is not needed

* [PM-5744] Reverting package-lock.json

* [PM-5744] Implementing a methodology to ensure we can instantiate the RegisterContentScript polyfill in a siloed manner

* [PM-5744] Migrating chrome extension api calls to the BrowserApi class

* [PM-5744] Implementing typing information within the RegisterContentScriptsPolyfill

* [PM-5744] Removing any eslint-disable references within the RegisterContentScriptsPolyfill

* [PM-5744] Refactoring polyfill implementation

* [PM-5744] Refactoring polyfill implementation

* [PM-5744] Fixing an issue where Safari was not resolving the await chrome proxy

* [PM-5744] Fixing jest tests for the page-script append method

* [PM-5744] Fixing an issue found where collection of page details can trigger a context invalidated message when the extension is refreshed

* [PM-5744] Implementing jest tests for the added BrowserApi methods

* [PM-5744] Refactoring Fido2Background implementation

* [PM-5744] Refactoring Fido2Background implementation

* [PM-5744] Adding enums to the implementation for the Fido2 Content Scripts and working through jest tests for the BrowserApi and Fido2Background classes

* [PM-5744] Adding comments to the FIDO2 content-script.ts file

* [PM-5744] Adding jest tests for the Fido2 content-script.ts

* [PM-5744] Adding jest tests for the Fido2 content-script.ts

* [PM-5744] Adding jest tests for the Fido2 page-script.ts

* [PM-5744] Working through an attempt to jest test the page-script.ts file

* [PM-5744] Finalizing jest tests for the page-script.ts implementation

* [PM-5744] Applying stricter type information for the passed params within fido2-testing-utils.ts

* [PM-5744] Adjusting documentation

* [PM-5744] Adjusting implementation of jest tests to use mock proxies

* [PM-5744] Adjusting jest tests to simply implementation

* [PM-5744] Adjust jest tests based on code review feedback

* [PM-5744] Adjust jest tests based on code review feedback

* [PM-5744] Adjust jest tests based on code review feedback

* [PM-5744] Adjusting jest tests to based on feedback

* [PM-5744] Adjusting jest tests to based on feedback

* [PM-5744] Adjusting jest tests to based on feedback

* [PM-5744] Adjusting conditional within page-script.ts

* [PM-5744] Removing unnecessary global reference to the messager

* [PM-5744] Updating jest tests

* [PM-5744] Updating jest tests

* [PM-5744] Updating jest tests

* [PM-5744] Updating jest tests

* [PM-5744] Updating how we export the Fido2Background class

* [PM-5744] Adding duplciate jest tests to fido2-utils.ts to ensure we maintain functionality for utils methods pulled from platform utils

* [PM-5189] Addressing code review feedback

* [PM-5744] Applying code review feedback, reworking obserable subscription within fido2 background

* [PM-5744] Reworking jest tests to avoid mocking `firstValueFrom`

* [PM-5744] Reworking jest tests to avoid usage of private methods

* [PM-5744] Reworking jest tests to avoid usage of private methods

* [PM-5744] Implementing jest tests for the ScriptInjectorService and updating references within the Browser Extension to use the new service

* [PM-5744] Converting ScriptInjectorService to a dependnecy instead of a static class

* [PM-5744] Reworking typing for the ScriptInjectorService

* [PM-5744] Adjusting implementation based on feedback provided during code review

* [PM-5744] Adjusting implementation based on feedback provided during code review

* [PM-5744] Adjusting implementation based on feedback provided during code review

* [PM-5744] Adjusting implementation based on feedback provided during code review

* [PM-5744] Adjusting how the ScriptInjectorService accepts the config to simplify the data structure

* [PM-5744] Updating jest tests to cover edge cases within ScriptInjectorService

* [PM-5744] Updating jest tests to reference the ScriptInjectorService directly rather than the underlying ExecuteScript api call

* [PM-5744] Updating jest tests to reflect provided feedback during code review

* [PM-5744] Updating jest tests to reflect provided feedback during code review

* [PM-5744] Updating documentation based on code review feedback

* [PM-5744] Updating how we extend the abstract ScriptInjectorService

* [PM-5744] Updating reference to the frame property on the ScriptInjectionConfig
2024-04-18 16:05:16 +00:00
Daniel García
912b7c136e
[PM-5796] Improve desktop biometric browser integration error handling (#7727)
* Re-register native messaging host integrations on startup

* Check for errors when generating the manifests

* Add log to component

* Switch to Promise.all

* Add injectable service
2024-04-18 17:40:39 +02:00
Thomas Rittson
e448168002
[AC-2444] Add deep links to unassigned items banner (#8720)
* Add link to Admin Console
* update date on self-hosted banner
2024-04-17 13:00:00 -04:00
aj-rosado
28a89ddb86
[PM-7304] Add missing i18n keys for import errors (#8743)
* Add static error message when import fails

* Adding missing string on CLI for unassigned items

* Added missing string on setImportTarget

* fixed tests
2024-04-17 16:19:06 +01:00
Tom
3179867310
[PM-7352] - Browser Send Type Groupings Fix (#8727)
* Removed type counts and just calculated counts off the sends

* Fixing key spec test case
2024-04-17 16:39:15 +02:00
Justin Baur
0c557c6ab8
Guard Background Only and MV2 Only Actions (#8773) 2024-04-17 10:13:05 -04:00
Daniel James Smith
cbb7e1840d
[PM-2570] [PM-4649] Update change master password UI (#8416)
* Update the change master password dialog on browser
Change text to remove the mention of the bitwarden.com web vault
Change icon to show it's external link

Changes based on Figma attached to PM-2570

* Update the change master password dialog on desktop
Change text to remove the mention of the bitwarden.com web vault

Changes based on Figma attached to PM-2570 and to replicate what is done on browser

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-04-16 19:39:31 +02:00
Carlos Gonçalves
06acdefa91
[PM-5273] Migrate state in CipherService (#8314)
* PM-5273 Initial migration work for localData

* PM-5273 Encrypted and Decrypted ciphers migration to state provider

* pm-5273 Update references

* pm5273 Ensure prototype on cipher

* PM-5273 Add CipherId

* PM-5273 Remove migrated methods and updated references

* pm-5273 Fix versions

* PM-5273 Added missing options

* Conflict resolution

* Revert "Conflict resolution"

This reverts commit 0c0c2039ed.

* PM-5273 Fix PR comments

* Pm-5273 Fix comments

* PM-5273 Changed decryptedCiphers to use ActiveUserState

* PM-5273 Fix tests

* PM-5273 Fix pr comments
2024-04-16 17:37:03 +01:00
github-actions[bot]
0765240886
Autosync the updated translations (#8740)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2024-04-15 17:56:11 +00:00
Jake Fink
576431d29e
[PM-5499] auth request service migrations (#8597)
* move auth request storage to service

* create migrations for auth requests

* fix tests

* fix browser

* fix login strategy

* update migration

* use correct test descriptions in migration
2024-04-15 12:34:30 -04:00
github-actions[bot]
6f31f42755
Autosync the updated translations (#8716)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2024-04-12 19:52:02 +00:00
Thomas Rittson
d026087bfd
[AC-2443] Update unassigned items banner text for self-hosted (#8719)
* Update banner text for self-hosted environments

* Fix tests

* Fix web vault wording

* Actually fix web vault wording
2024-04-12 06:57:17 -05:00
Matt Gibson
8d698d9d84
[PM-7169][PM-5267] Remove auth status from account info (#8539)
* remove active account unlocked from state service

* Remove status from account service `AccountInfo`

* Fixup lingering usages of status

Fixup missed factories

* Fixup account info usage

* fixup CLI build

* Fixup current account type

* Add helper for all auth statuses to auth service

* Fix tests

* Uncomment mistakenly commented code

* Rework logged out account exclusion tests

* Correct test description

* Avoid getters returning observables

* fixup type
2024-04-12 09:25:45 +02:00
SmithThe4th
c2b91d2d46
[PM-4700] Fixed issue with clearing search index state (#8686)
* fixed issue with clearing search index state

* Decrease snap description character length to reach 128 limit (#8687)

* clear user index before account is totally cleaned up

* [AC-2436] Fix flashing unassigned items banner (#8689)

* Fix flashing banner for users who shouldn't see it

* Emit the right value the first time

* simplify further

* restore comment

* added logout clear on option

* removed redundant clear index from logout

---------

Co-authored-by: Joseph Flinn <58369717+joseph-flinn@users.noreply.github.com>
Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
2024-04-11 17:53:16 +01:00
Justin Baur
16c289d680
Prefer Passed In UserId (#8602) 2024-04-10 17:55:20 -05:00
Cesar Gonzalez
e4720de62a
[PM-7353] Autofill item selection not working from within current tab view in vault (#8670)
* [PM-7353] Fix autofill not working from current tab component

* [PM-7353] Fix autofill not working from current tab component

* [PM-7353] Fix autofill not working from current tab component
2024-04-10 22:06:34 +00:00
Bitwarden DevOps
4607ae73c0
Bumped browser,desktop version to (#8684) 2024-04-10 21:45:31 +00:00
Thomas Rittson
98ed744ae8
[AC-2436] Show unassigned items banner in browser (#8656)
* Boostrap basic banner, show for all admins

* Remove UI banner, fix method calls

* Invert showBanner -> hideBanner

* Add api call

* Minor tweaks and wording

* Change to active user state

* Add tests

* Fix mixed up names

* Simplify logic

* Add feature flag

* Do not clear on logout

* Show banner in browser as well

* Update apps/browser/src/_locales/en/messages.json

* Update copy

---------

Co-authored-by: Addison Beck <github@addisonbeck.com>
Co-authored-by: Addison Beck <hello@addisonbeck.com>
2024-04-10 12:13:37 -07:00
rr-bw
4a3cd24510
instantiate service (#8671) 2024-04-10 10:30:09 -07:00
Cesar Gonzalez
1e7329d1ef
[PM-7370] Remove usage of BrowserMessagingPrivateModeBackgroundService and MultithreadEncryptService from manifest v3 (#8654) 2024-04-10 16:23:02 +00:00
Cesar Gonzalez
05f22b9cbc
[PM-7388] Fix AutofillService dependency reference to TotpService within poppup services module (#8668) 2024-04-10 10:35:17 -05:00
SmithThe4th
2bce6c538c
[PM-6194] Refactor injection of services in browser services module (#8380)
* refactored injector of services on the browser service module

* refactored the search and popup serach service to use state provider

* renamed back to default

* removed token service that was readded during merge conflict

* Updated search service construction on the cli

* updated to use user key definition

* Reafctored all components that refernce issearchable

* removed commented variable

* added uncommited code to remove dependencies not needed anymore

* added uncommited code to remove dependencies not needed anymore
2024-04-10 14:02:46 +01:00
Matt Gibson
560033cb88
Remove usages of chrome.storage (#8664)
* Enable clearing and retrieving all values from local storage

I didn't add these methods to the base abstract class because we don't currently have a use case for them. If we develop one, we can just lift it up.

* Use new browser local storage methods for reseed task

* Remove the now dangerous methods enabling usage of `chrome.storage`

Any direct reference to chrome storage needs to handle serialization tags, which is best dealt with through the classes implementing `AbstractChromeStorageService`
2024-04-10 08:01:34 -05:00
Jake Fink
9d10825dbd
[PM-5362] Add MP Service (attempt #2) (#8619)
* 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

* fix user key decryption logic

* add clear methods to mp service

* fix circular dep and encryption issue

* fix test

* remove extra account service call

* use EncString in state provider

* fix tests

* return to using encrypted string for serialization
2024-04-09 20:50:20 -04:00
github-actions[bot]
aefea43fff
Autosync the updated translations (#8646)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2024-04-09 09:29:09 +00:00
Oscar Hinton
7064b595da
[SM-1031] Remove SecretsManager & showDDG compile flags (#8610)
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.
2024-04-08 17:46:24 +02:00
Matt Gibson
d1a0a20daa
[PM-7341] Force serialization of data in chrome storage api (#8621)
* Force serialization of data in chrome storage api

* Test chrome api storage serialization

* Update apps/browser/src/platform/services/abstractions/abstract-chrome-storage-api.service.ts

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

---------

Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com>
2024-04-08 17:41:45 +02:00
Tom
3d052242df
[PM-5578] [PM-5579] [PM-5580] [PM-5581] Send Browser State Provider (#8232)
* 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
2024-04-08 10:30:39 -04:00
Oscar Hinton
759e48728e
Remove unused broadcaster service reference (#8420) 2024-04-08 13:18:39 +02:00