Commit Graph

95 Commits

Author SHA1 Message Date
Justin Baur e6fe0d1d13
[PM-5539] Migrate ThemingService (#8219)
* Update ThemingService

* Finish ThemingService

* Lint

* More Tests & Docs

* Refactor to ThemeStateService

* Rename File

* Fix Import

* Remove `type` added to imports

* Update InitServices

* Fix Test

* Remove Unreferenced Code

* Remove Unneeded Null Check

* Add Ticket Link

* Add Back THEMING_DISK

* Fix Desktop

* Create SYSTEM_THEME_OBSERVABLE

* Fix Browser Injection

* Update Desktop Manual Access

* Fix Default Theme

* Update Test
2024-03-13 15:25:39 +00:00
Justin Baur 531ae3184f
Remove Unnecessary Module Entries (#8320) 2024-03-13 14:18:04 +00:00
Matt Gibson 1f41d7871c
Ps/pm-6636/angular-specific-browser-platform-utils (#8211)
* Remove Unused services

* Split platform utils between foreground and background

* Respond to clipboard clearing and biometric unlock

* Use new browser platform utils

* Fix folder name

* Fix imports

* biometrics is supported only on windows and mac

* Reject native messaging with errors

We're now going through the runtime background, which expects error objects in message failures
2024-03-12 11:25:03 -04:00
Matt Gibson 5feb9af051
[PM-6654] new app id service for angular (#8229)
* Improve state documentation

* Add namespace for application id

* Spec out behavior of app id service

* Use state providers for app ids

* Migrate app Id

* Add reactive interface
2024-03-12 11:12:40 -04:00
Matt Gibson 2181a6d91a
Remove duplicate provider (#8296)
Co-authored-by: Justin Baur <justindbaur@users.noreply.github.com>
2024-03-11 20:46:58 -04:00
Matt Gibson 51df81393d
Use local storage for browser's secure storage (#8231)
UI warns the user whenever using secure storage in browser that it's
insecure. This is not a change from the current background behavior,
just uses the already existing services in each context.
2024-03-11 17:51:09 -04:00
Matt Gibson f4150ffda6
[PM-6511] New i18n for angular (#8122)
* Use state provider to store preferred language

* migrate preferred language

* Use new i18n provider to get LOCAL_ID

* Fix preloaded english i18n

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

* PR improvements

* Fixup merge
2024-03-11 13:59:19 -04:00
Matt Gibson 2d49a79854
Remove usage of `getBgService` (#8217) 2024-03-07 19:43:19 -06:00
Thomas Rittson eedd6f0881
[AC-2008] [AC-2123] [Pt 2] Transition PolicyService to use StateProvider (#7977)
* fully wire up StateProvider within PolicyService
* migrate old policy data to new location
* minor update to existing interfaces
2024-03-08 10:26:00 +10:00
Matt Gibson 0f9acf50f7
Remove usage of `getBgService` from browser services (#8234) 2024-03-07 14:58:58 -05:00
Matt Gibson bdaa95bd7f
Remove unneeded provider override (#8230) 2024-03-07 19:53:59 +00:00
Cesar Gonzalez 8e3a723908
[PM-5879] Remove `backgroundWindow` reference used for determing system theme preference in Safari (#7859)
* [PM-5879] Removing `backgroundWindow` reference used for determing system theme preference in Safari

* [PM-5879] Removing `backgroundWindow` reference used for determing system theme preference in Safari

* [PM-5879] Reworking factory logic within ThemingService factory
2024-03-05 19:42:16 +00:00
Addison Beck 101e1a4f2b
Migrate provider service to state provider (#8173)
* Migrate existing provider data to StateProvider

Migrate existing provider data to StateProvider

* Rework the ProviderService to call StateProvider

* Unit test the ProviderService

* Update DI to reflect ProviderService's new args

* Add ProviderService to logout chains across products

* Remove provider related stateService methods

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

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

* Cover up a copy/paste job

* Compare equality over entire array in a test

---------

Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
2024-03-05 19:35:12 +00:00
Matt Gibson 7bb24d5fad
Remove Unused services (#8210) 2024-03-05 10:38:49 -05:00
Jonathan Prusik 4ba2717eb4
[PM-5559] Implement User Notification Settings state provider (#8032)
* create user notification settings state provider

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

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

* add content script messaging the background for enableChangedPasswordPrompt setting

* Implementing feedback to provide on PR

* Implementing feedback to provide on PR

* PR suggestions cleanup

---------

Co-authored-by: Cesar Gonzalez <cgonzalez@bitwarden.com>
2024-03-04 14:12:23 -05:00
Thomas Rittson ad21a1d160
[AC-2249] Remove StateService from PolicyApiService (#8106)
This was unused.
2024-03-01 15:59:45 -06:00
Matt Gibson c8e36b6c24
Deprecate getBgService (#8144)
We can't grab background pages in MV3, we need to migrate off of this.
2024-02-28 17:05:03 -05:00
Todd Martin 745a0c987a
Updated CryptoService DI to use getBgService again (#8146) 2024-02-28 16:08:44 -05:00
Todd Martin 668980ad38
Added DI for SsoLoginService (#8132) 2024-02-28 10:58:58 -05:00
Justin Baur bbd50abd94
Fix DI (#8125) 2024-02-28 00:28:44 +00:00
Thomas Rittson 0a5c9d3525
[AC-2008] [AC-2122] [Pt 1] Transition PolicyService to use StateProvider (#7959)
* Delete unnecessary StateDefinition

* Add StateProvider to PolicyService

* Add new getters using StateProvider (not exposed or used yet)
2024-02-27 08:51:10 +10:00
Jake Fink 1435203e12
[PM-5499] Create Auth Request Service (#8056)
* create auth request service

* copy methods from auth crypto service

* register new auth request service

* remove refs to auth request crypto service

* remove auth request crypto service

* remove passwordless login method from login strategy service

* add docs to auth request service
2024-02-26 10:07:08 -05:00
Jake Fink a31e3bf842
Add key generation service to deps (#8070)
* add missing arg to browser crypto

* add key generation service to deps

* initialize key generation service after deps in main background
2024-02-23 11:52:50 -05:00
Jake Fink fa43d8c55e
add missing arg to browser crypto (#8068) 2024-02-23 10:19:15 -05:00
Jake Fink 19a373d87e
[PM-6211] Create key generation service (#7939)
* create key generation service

* replace old key generation service and add references

* use key generation service in key connector service

* use key generation service in send service

* user key generation service in access service

* use key generation service in device trust service

* fix tests

* fix browser

* add createKeyFromMaterial and tests

* create ephemeral key

* fix tests

* rename method and add returns docs

* ignore material in destructure

* modify test

* specify material as key material

* pull out magic strings to properties

* make salt optional and generate if not provided

* fix test

* fix parameters

* update docs to include link to HKDF rfc
2024-02-23 08:48:15 -05:00
Matt Gibson 56bffb04bb
Ps/pm 5533/migrate decrypted user key (#7970)
* Move user key memory state to state providers

Note: state service observable change is because these updates are no longer internal to the class, but reporter directly to account service through crypto service on update of a user key

* remove decrypted user key state

Note, we're going to move the encrypted cryptoSymmetric key (and associated master key encrypted user keys)  as part of the master key service creation. Crypto service will no longer be responsible for the encrypted forms of user key.

* Deprecate notices belong on abstraction

* Allow for single-direction status updates

This is necessary since we don't want to have to guarantee that the update to logged out occurs after the update to locked.

* Remove deprecated subject

It turns out the set for cryptoMasterKey was also unused 🎉
2024-02-22 15:07:26 -05:00
SmithThe4th 5b652092cd
[PM-5272] Migrate CollapsedGroupings to State Provider (#7954) 2024-02-16 12:53:24 -05:00
Justin Baur 1ff7bdd014
[PM-6172] Run `localStorage` migrations for web (#7900)
* Create MigrationRunner

- Create MigrationRunner Service for running migrations in StateService
- Create web override so that migrations also run against `localStorage`

* Fix Web StateService

* Fix WebMigrationRunner

* Fix CLI

* Fix ElectronStateService

* Update Comment

* More Common Scenarios
2024-02-14 08:52:13 -05:00
Daniel James Smith 9980c3feb9
[PM-5459] Move libs/exporter to libs/tools/ (#7380)
* Move libs/exporter into libs/tools/*

Migrating all files from libs/exporter over to libs/tools/export/vault-export/vault-export-core
Rename package to vault-export-core
Fix all file paths

* Update libs and tsconfig imports

* Fix client imports

* Fix eslint, jest and package-lock.json

* Update CODEOWNERS

* Add README.md to whitelist-capital-letters

* Fix vault-export-service tests not running

* Update libs/tools/export/vault-export/README.md

Co-authored-by: Vincent Salucci <26154748+vincentsalucci@users.noreply.github.com>

* Fix types imports

* Export types from vault-export-core

* Fixed content of README

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
Co-authored-by: Vincent Salucci <26154748+vincentsalucci@users.noreply.github.com>
2024-02-13 14:22:37 -05:00
Jonathan Prusik c65e92f769
[PM-5560] Implement Autofill Settings state provider (#7767)
* Begin migration of autofill settings

Co-authored-by: Cesar Gonzalez <cagonzalezcs@users.noreply.github.com>
Co-authored-by: Thomas Avery <Thomas-Avery@users.noreply.github.com>
Co-authored-by: Jonathan Prusik <jprusik@users.noreply.github.com>
Co-authored-by: Colton Hurst <coltonhurst@users.noreply.github.com>

* add browser dependency for AutofillSettingsService

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

* update autofill settings service

* replace usages of stateService get/set autofillOnPageLoad with autofillSettingsService

* replace usages of stateService get/set autofillOnPageLoadDefault with autofillSettingsService

* replace usages of stateService get/set autoCopyTotp with autofillSettingsService

* replace usages of stateService get/set autoFillOnPageLoadCalloutIsDismissed with autofillSettingsService

* replace usages of stateService get/set activateAutoFillOnPageLoadFromPolicy with autofillSettingsService

* replace usages of get/set autoFillOverlayVisibility with autofillSettingsService

* inlineMenuVisibility should use global state

* add the AutofillSettingsService to background scripts

* fix typing

* replace additional usages of get/set autoFillOverlayVisibility and disableAutoTotpCopy with autofillSettingsService equivalents

* replace additional usages of get/set autofillOnPageLoadDefault with autofillSettingsService equivalent

* replace additional usages of get/set activateAutoFillOnPageLoadFromPolicy with autofillSettingsService equivalent

* remove additional deprecated and unused state service calls

* improve naming conventions and consistency

* fix missing mock for policy service test

* replace missing overlay background tests

* cleanup

* fix double inversion

* fix reference to wrong setter

* move handleActivateAutofillPolicy out of BrowserPolicyService

* create state migration script

* resolve linting issues

* remove migrated setting properties

* add AutofillSettingsSErvice to jslib-services

* handle conditional content script loading via autofillOnPageLoad check

* add deprecated note to getFromLocalStorage

* add jsdoc decorators to new autofill service methods

* handle undefined globalState

* move autofill settings out of BrowserPolicyService

* Move autofill settings code out of policyService

* fix tests

* fix typo in state definition

---------

Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
Co-authored-by: Cesar Gonzalez <cagonzalezcs@users.noreply.github.com>
Co-authored-by: Thomas Avery <Thomas-Avery@users.noreply.github.com>
Co-authored-by: Colton Hurst <coltonhurst@users.noreply.github.com>
Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
2024-02-12 17:11:04 -05:00
Matt Gibson b0edcb81af
Ps/run-foreground-derived-state-in-zone (#7861)
* Sync derived state through memory storage

* Run foreground derived state in NgZone

* fix tests
2024-02-08 14:04:38 -05:00
Addison Beck 82cb52a938
Properly set up StateProvider dependency for OrganizationService (#7841) 2024-02-07 10:28:14 -06:00
Addison Beck b3135403e8
Wire up key definitions for OrganizationService (#7781)
* Wire up key definitions for OrganizationService

[`AC-2009`: Transition OrganizationService to use StateProvider](
https://bitwarden.atlassian.net/browse/AC-2009)

In order to support the new `StateProvider` APIs for managing
application state this commit modifies `OrganizationService` in the following
ways:

1. Adding a `KeyDefinition` object to `OrganizationService` to store the
   `organization` record in `StateProvider`.
1. Injecting `StateProvider` and wiring up `OrganizationService` to read
   from the `organizations` key definition for the active user account.
1. Expanding the capabilities of `OrganizationData` to be able to read
   itself from a JSON string. Previously this was handled directly by
   `StateService`.
1. Updating tests to include requirements for testing against
   `StateProvider`.
1. Marking the existing `StateService`-backed `organizations`
   `Observable` and `BehaviorSubject` as deprecated.

This is largely unimplemented code with no intended visible effects to
the system. Implementing getting & updating the `organizations` value
from `StateProvider` will the next step in this work.

* Rework null check on OrganizationData

* Remove deprecation signals for the time being

* Move key definition inline with its service

* Create date objects when deserialzing json from state
2024-02-06 18:48:34 -06:00
SmithThe4th 7e00ece092
[PM-5276] Migrate FolderService to state providers (#7682)
* added state definitionand key definition for folder service

* added data migrations

* created folder to house key definitions

* deleted browser-folder-service and added state provider to the browser

* exposed decrypt function so it can be used by the key definition, updated folder service to use state provider

* removed memory since derived state is now used

* updated test cases

* updated test cases

* updated migrations after merge conflict fix

* added state provider to the folder service constructor

* renamed migration file

* updated comments

* updated comments

* removed service registartion from browser service module and removed unused set and get encrypted folders from state service

* renamed files

* added storage location overides and removed extra methods
2024-02-06 14:51:02 -05:00
Jake Fink 816bcf4f39
[PM-5255] Create login strategy service (#7750)
* refactor login strategies into own service

* create login service factory

* replaces instances of authService with loginStrategyService

* replace more instances of authService

* move logout back to auth service

* add browser dependencies

* fix desktop dependencies

* fix cli dependencies

* fix lint and test files

* fix anonymous hub deps

* fix webauthn-login service deps

* add loginstrategyservice to bg

* move login strategy service and models to auth folder

* revert changes to tsconfig

* use alias for imports

* fix path

---------

Co-authored-by: rr-bw <102181210+rr-bw@users.noreply.github.com>
2024-02-05 14:26:41 -05:00
Will Martin cb8849c355
Add eslint rule no-floating-promises (#7789)
* add eslint rule no-floating-promises

* add eslint-disable comment to offending lines
2024-02-02 15:13:37 -05:00
Justin Baur c1d5351075
[PM-5535] Migrate Environment Service to StateProvider (#7621)
* Migrate EnvironmentService

* Move Migration Test Helper

* Claim StateDefinition

* Add State Migration

* Update StateServices

* Update EnvironmentService Abstraction

* Update DI

* Update Browser Instantiation

* Fix BrowserEnvironmentService

* Update Desktop & CLI Instantiation

* Update Usage

* Create isStringRecord helper

* Fix Old Tests

* Use Existing AccountService

* Don't Rely on Parameter Mutation

* Fix Conflicts
2024-01-24 14:21:50 -05:00
Matt Gibson 06affa9654
Rework derived state (#7290)
* Remove derived state from state classes

* Create provider for derived state

Derived state is automatically stored to memory storage, but can be derived from any observable.

* Fixup state provider method definitions

* Test `DefaultDerivedState`

* remove implementation notes

* Write docs for derived state

* fixup derived state provider types

* Implement buffered delayUntil operator

* Move state types to a common module

* Move mock ports to centra location

* Alias DerivedStateDependency type

* Add dependencies to browser

* Prefer internal rxjs operators for ref counting

* WIP

* Ensure complete on subjects

* Foreground/background messaging for browser

Defers work for browser to the background

* Test foreground port behaviors

* Inject foreground and background derived state services

* remove unnecessary class field

* Adhere to required options

* Add dderived state to CLI

* Prefer type definition in type parameters to options

* Prefer instance method

* Implements factory methods for common uses

* Remove nothing test

* Remove share subject reference

Share manages connector subjects internally and will reuse them until
refcount is 0 and the cleanup time has passed. Saving our own reference
just risks memory leaks without real testability benefits.

* Fix interaction state
2024-01-04 14:47:49 -05:00
Matt Gibson 4644392d5c
Clear vault filter on account switch (#7227) 2023-12-15 12:55:11 +00:00
Oscar Hinton cf0c6e8896
[PM-4349] Migrate hasPremium and debounceNavigation to be functional (#6591)
Class based router guards are deprecated as of Angular 15.2, per angular.io/guide/deprecations#router-class-and-injection-token-guards. To simplify future angular upgrades we need to resolve these deprecations.

This PR migrates the HasPremium and DebounceNavigationService guards to use the new functional pattern.
2023-12-11 14:22:34 +00:00
renovate[bot] 28de9439be
[deps] Autofill: Update prettier to v3 (#7014)
* [deps] Autofill: Update prettier to v3

* prettier formatting updates

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Prusik <jprusik@classynemesis.com>
2023-11-29 16:15:20 -05:00
Oscar Hinton a5e3432f85
Assign ownership to many libs files (#6928)
Assign ownership to many of the remaining libs/common files.

Criteria for ownership:
* Files used by a single team, is now owned by that team.
* Files related to a domain owned by a team is now owned by that team.
* Where ownership is unclear the "lowest level" service takes ownership.
2023-11-27 20:59:44 +00:00
Matt Gibson 24c240d0d4
Ps/pm 2910/add browser storage services (#6849)
* Allow for update logic in state update callbacks

* Prefer reading updates to sending in stream

* Inform state providers when they must deserialize

* Update DefaultGlobalState to act more like DefaultUserState

* Fully Implement AbstractStorageService

* Add KeyDefinitionOptions

* Address PR feedback

* Prefer testing interactions for ports

* Synced memory storage for browser

* Fix port handling

* Do not stringify port message data

* Use messaging storage

* Initialize new foreground memory storage services

This will need to be rethought for short-lived background pages, but for
now the background is the source of truth for memory storage

* Use global state for account service

* Use BrowserApi listener to avoid safari memory leaks

* Fix build errors: debugging and missed impls

* Prefer bound arrow functions

* JSON Stringify Messages

* Prefer `useClass`

* Use noop services

* extract storage observable to new interface

This also reverts changes for the existing services to use
foreground/background services. Those are now used only in state
providers

* Fix web DI

* Prefer initializing observable in constructor

* Do not use jsonify as equality operator

* Remove port listener to avoid memory leaks

* Fix logic and type issues

---------

Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
2023-11-21 16:35:37 -05:00
Cesar Gonzalez b622c38c6f
[PM-4229] Autofill Overlay MVP (#6507)
* [PM-3914] Refactor Browser Extension Popouts

* [PM-3914] Refactor Browser Extension Popouts

* [PM-3914] Refactor Browser Extension Popouts

* [PM-3914] Adding enums for the browser popout type

* [PM-3914] Making the methods for getting a window in a targeted manner public

* [PM-3914] Refactoing implementation

* [PM-3914] Updating deprecated api call

* [PM-3914] Fixing issues found when testing behavior

* [PM-3914] Reimplementing behavior based on feedback from platform team

* [PM-3914] Adding method of ensuring previously opened single action window is force closed for vault item password reprompts

* [PM-3914] Taking into consideration feedback regarding the browser popup utils service and implementating requested changes

* [PM-3914] Removing unnecesssary class dependencies

* [PM-3914] Adding method for uniquely setting up password reprompt windows

* [PM-3914] Modifying method

* [PM-3914] Adding jest tests and documentation for AuthPopoutWindow util

* [PM-3914] Adding jest tests and documentation for VaultPopoutWindow

* [PM-3914] Adding jest tests for the debouncing method within autofill service

* [PM-3914] Adding jest tests for the new BrowserApi methods

* [PM-3914] Adding jest tests to the BrowserPopupUtils class

* [PM-3914] Updating inPrivateMode reference

* [PM-3914] Updating inPrivateMode reference

* [PM-3914] Modifying comment

* [PM-3914] Moviing implementation for openCurrentPagePopout to the BrowserPopupUtils

* [PM-3914] Applying feedback

* [PM-3914] Applying feedback

* [PM-3914] Applying feedback

* [PM-3983] Refactoring implementation of `setContentScrollY` to facilitate having a potential delay

* [PM-3914] Applying feedback regarding setContentScrollY to the implementation

* [PM-3914] Modifying early return within the run method of the ContextMenuClickedHandler

* [PM-3914] Adding test for VaultPopoutWindow

* [PM-4229] Autofill Overlay MVP

* [PM-2855] Add Settings to Enable Autofill Overlay (#6509)

* [PM-2855] Add Settings to Enable Autofill Overlay

* [PM-2855] Removing unnecessary key

* [PM-3914] Applying work done within PM-4366 to facilitate opening the popout window as a popup rather than a normal window

* [PM-3914] Updating the BrowserApi.removeTab method to leverage a callback structure for the promise rather than an async away structure

* [PM-3036] Adding jest tests for added passkeys popout windows

* [PM-3914] Adjsuting logic for turning off the warning when FIDO2 credentials are saved

* [PM-3914] Fixing height to design

* [PM-3914] Fixing call to Fido2 Popout

* [PM-3914] Fixing add/edit from fido2 popout

* [PM-3914] Fixing add/edit from fido2 popout

* [PM-3914] Fixing jest tests for updated elements

* [PM-3914] Reverting how context menu actions are passed to the view component

* [PM-3914] Reverting re-instantiation of config service within main.background.ts

* [PM-3914] Adding jest test for BrowserAPI removeTab method

* [PM-3914] Adding method to handle parsing the popout url path

* [PM-3914] Removing JSDOC comment elements

* [PM-3914] Removing await from method call

* [PM-3914] Simplifying implementation on add/edit

* [PM-3032] Adding more direct reference to view item action in context menus

* [PM-3034] Modify Autofill Callout to Consider Autofill Overlay Visibility (#6510)

* [PM-2855] Add Settings to Enable Autofill Overlay

* [PM-2855] Removing unnecessary key

* [PM-3034] Modify Autofill Callout to Consider Autofill Overlay Visibility

* [PM-3034] Adding translated strings

* [PM-3034] Updating boolean logic for showing the callout to remove unnecessary negation of boolean statement

* [PM-3914] Adjusting routing on Fido2 component to pass the singleActionPopout param to the route when opening the add-edit component

* [PM-3914] Adding singleActionPopout param to the fido2 component routing

* [PM-3914] Updating implementation details for how we build the extension url path

* [PM-3914] Reworking implementation for isSingleActionPopoutOpen to clean up iterative logic

* [PM-3914] Merging work from master and fixing merge conflicts

* [PM-3914] Fixing merge conflict introduced from master

* [PM-3914] Reworking closure of single action popouts to ensure they close the window instead of attempting to close the tab

* [PM-3036] Implement Autofill Overlay Unlock State (#6514)

* [PM-2855] Add Settings to Enable Autofill Overlay

* [PM-2855] Removing unnecessary key

* [PM-3034] Modify Autofill Callout to Consider Autofill Overlay Visibility

* [PM-3034] Adding translated strings

* [PM-3034] Add Autofill Overlay Vault Locked State

* [PM-3036] Bootstrap Autofill Overlay implementation and add locked vault state

* [PM-3032] Removing add/edit cipher message

* [PM-3036] Fixing lint error found within overlay background

* [PM-3036] Setting properties within the autofill component method to be protected

* [PM-3034] Updating boolean logic for showing the callout to remove unnecessary negation of boolean statement

* [PM-3036] Applying feedback from browser popout refactor PR

* [PM-3036] Adding ownership over the website icon service file to the autofill team

* [PM-3036] Updating the `autoFillOverlayVisibility` setting to be a client-scoped setting rather than account-scoped

* [PM-3036] Reworking jest setup implementation to facilitate approach recommended within code review

* [PM-3036] Updating WebsiteIconService to act as a single function reference and moving it to be under the vault team as codeowners

* [PM-3032] Show Matching Logins When User Interacts with Field (#6516)

* [PM-3032] Show Matching Logins When User Interacts with Field

* [PM-3032] Fixing issue found when changing pages

* [PM-3032] Addressing feedback within PR

* [PM-3032] Addressing feedback within PR

* [PM-3033] Allow User to Fill Matching Logins within Overlay (#6517)

* [PM-3033] Allow User to Fill Matching Logins within Overlay

* [PM-3035] Allow adding new items when no ciphers found in overlay (#6518)

* [PM-2319] Refactoring implementation to leverage styles within the encapsulated custom elements rather than inline on those elements

* [PM-2319] Leveraging globalThis to avoid potential DOM clobbering within implementation

* [PM-2319] Fixing issue where styles can override visibility of overlay icon and list

* [PM-2319] Fixing issue where styles can override visibility of overlay icon and list

* [PM-2319] Implementing more secure method for ensuring overlay is visible

* [PM-2319] Optimizing implementation of mutation observers on elements that need to enforce CSS styling

* [PM-2319] Refactoring how we handle mutation observers to allow for a more streamlined implementation approach

* [PM-2319] Implementing view cipher item initial workflow

* [PM-2319] Implementing obfruscation of username within login ciphers

* [PM-2747] Fixing logic error incorporated when merging in master

* [PM-2130] Fixing issue with autofill service unit tests

* [PM-2130] Fixing issue with autofill service unit tests

* [PM-2747] Fixing issue present with notification bar merge

* [PM-2130] Fixing test test for when we need to handle a password reprompt

* [PM-2319] Fixing issue present with context menu handler

* [PM-2319] Implementing fixes for password reprompt when autofilling from overlay

* [PM-2319] Working through accessibility and focus order on overlay elements

* [PM-2319] Finishing out focus redirection approach for focus out of overlay list

* [PM-2319] Working through screen reader accessibility including aria attributes

* [PM-2319] Adding guard to usage of extension privacy api

* [PM-2319] Adding guard to usage of extension privacy api

* [PM-2319] Adding aria description for fill cipher elements

* [PM-2319] Refactoring implementation

* [PM-2319] Working through implementation of view cipher tirggers when overlay set to view an element

* [PM-2319] Refining implementation for viewing vault item from overlay

* [PM-2319] Applying fix for context menu ciphers

* [PM-2319] Modifying namespace for overlay icon to overlay button

* [PM-2319] Refactoring OverlayButton

* [PM-2319] Refactoring OverlayButton

* [PM-2319] Adding translations for overlay content

* [PM-2319] Refactoring OverlayBackground class

* [PM-2319] Refactoring OverlayBackground class to more optimially store and retrieve cipher data for the overlay elements

* [PM-2319] Refactoring OverlayBackground class

* [PM-2319] Refactoring AutofillOverlayList class structure

* [PM-2319] Implementing randomization of custom element names for elements injected into tab

* [PM-2319] Updating how we handle referencing port messages within the OverlayIframe service

* [PM-3465] Optimization of CollectPageDetails Message within Autofill

* [PM-3465] Implementing caching for CollectPage details call

* [PM-3465] Implementing caching for CollectPage details call

* [PM-3465] Implementing method for ensuring that getPageDetails is not called when no fields appear within a frame

* [PM-3465] Implementing Mutation Observer to handle updating autofill fields when DOM updates

* [PM-2747] Fixing wording for webpack script

* [PM-2130] - Audit, Modularize, and Refactor Core autofill.js File (#5453)

* split up autofill.ts, first pass

* remove modification tracking comments

* lessen and localize eslint disables

* additional typing and formatting

* update autofill v2 with PR #5364 changes (update/i18n confirm dialogs)

* update autofill v2 with PR #4155 changes (add autofill support for textarea)

Co-Authored-By: Manuel <mr-manuel@outlook.it>

* move commonly used string values to constants

* ts cleanup

* [PM-2130] Starting work to re-architect autofillv2.ts

* [PM-2130] Starting work to re-architect autofillv2.ts

* [PM-2130] Working through autofill collect method

* [PM-2130] Marking Removal of documentUUID as dead code

* [PM-2130] Refining the implementation of collect and moving broken out utils back into class implementation

* [PM-2130] Applying small refactors to AutofillCollect

* [PM-2130] Refining the implementation of getAutofillFieldLabelTag to help with readability of the method

* [PM-2130] Implementing jest tests for AutofillCollect methods

* [PM-2130] Refining implementation for AutofillCollect

* [PM-2200] Unit tests for autofill content script utilities with slight refactors (#5544)

* add unit tests for urlNotSecure

* add test coverage command

* add unit tests for canSeeElementToStyle

* canSeeElementToStyle should not return true if `animateTheFilling` or `currentEl` is false

* add tests for selectAllFromDoc and getElementByOpId

* clean up getElementByOpId

* address some typing issues

* add tests for setValueForElementByEvent, setValueForElement, and doSimpleSetByQuery

* clean up setValueForElement and setValueForElementByEvent

* more typescript cleanup

* add tests for doClickByOpId and touchAllPasswordFields

* add tests for doFocusByOpId and doClickByQuery

* misc fill cleanup

* move functions between collect and fill utils and replace getElementForOPID for duplicate getElementByOpId

* add tests for isKnownTag and isElementVisible

* rename addProp and remove redundant focusElement in favor of doFocusElement

* cleanup

* fix checkNodeType

* add tests for shiftForLeftLabel

* clean up and rename checkNodeType, isKnownTag, and shiftForLeftLabel

* add tests for getFormElements

* clean up getFormElements

* add tests for getElementAttrValue, getElementValue, getSelectElementOptions, getLabelTop, and queryDoc

* clean up and rename queryDoc to queryDocument

* misc cleanup and rename getElementAttrValue to getPropertyOrAttribute

* rebase cleanup

* prettier formatting

* [PM-2130] Fixing linting issues

* [PM-2130] Fixing linting issues

* [PM-2130] Migrating implementation for collect methods and tests for those methods into AutofillCollect context

* [PM-2130] Migrating getPropertyOrAttribute method from utils to AutofillCollect

* [PM-2130] Continuing migration of methods from collect utils into AutofillCollect

* [PM-2130] Rework of isViewable method to better handle behavior for how we identify if an element is currently within the viewport

* [PM-2130] Filling out implementation of autofill-insert

* [PM-2130] Refining AutofillInsert

* [PM-2130] Implementing jest tests for AutofillCollect methods and breaking out visibility related logic to a separate service

* [PM-2130] Fixing jest tests for AutofillCollect

* [PM-2130] Fixing jest tests for AutofillInit

* [PM-2130] Adjusting how the AutofillFieldVisibilityService class is used in AutofillCollect

* [PM-2130] Working through AutofillInsert implementation

* [PM-2130] Migrating methods from fill.ts to AutofillInsert

* [PM-2130] Migrating methods from fill.ts to AutofillInsert

* [PM-2130] Applying fix for IntersectionObserver when triggering behavior in Safari and fixing issue with how we trigger an input event shortly after filling in a field

* [PM-2130] Refactoring AutofillCollect to service CollectAutofillContentService

* [PM-2130] Refactoring AutofillInsert to service InsertAutofillContentService

* [PM-2130] Further organization of implementation

* [PM-2130] Filling out missing jest test for AutofillInit.fillForm method

* [PM-2130] Migrating the last of the collect jest tests to InsertAutofillContentService

* [PM-2130] Further refactoring of elements including typing information

* [PM-2130] Implementing jest tests for InsertAutofillContentService

* [PM-2130] Implementing jest tests for InsertAutofillContentService

* [PM-2130] Organization and refactoring of methods within InsertAutofillContent

* [PM-2130] Implementation of jest tests for InsertAutofillContentService

* [PM-2130] Implementation of Jest Test for IntertAutofillContentService

* [PM-2130] Finalizing migration of methods and jest tests from util files into Autofill serivces

* [PM-2130] Cleaning up dead code comments

* [PM-2130] Removing unnecessary constants

* [PM-2130] Finalizing jest tests for InsertAutofillContentService

* [PM-2130] Refactoring FieldVisibiltyService to DomElementVisibilityService to allow service to act in a more general manner

* [PM-2130] Implementing jest tests for DomElementVisibilityService

* [PM-2130] Implementing jest tests for DomElementVisibilityService

* [PM-2130] Implementing jest tests for DomElementVisibilityService

* [PM-2130] Implementing jest tests for DomElementVisibilityService

* [PM-2130] Breaking out the callback method used to resolve the IntersectionObserver promise

* [PM-2130] Adding a comment explaining a fix for Safari

* [PM-2130] Adding a comment explaining a fix for Safari

* [PM-2130] Applying changes required for PM-2762 to implementation, and ensuring jest tests exist to validate the behavior

* [PM-2130] Removing usage of IntersectionObserver when identifying element visibility due to broken interactions with React Components

* [PM-2130] Fixing issue found when attempting to capture the elementAtCenterPoint in determining file visibility

* [PM-2100] Create Unit Test Suite for autofill.service.ts (#5371)

* [PM-2100] Create Unit Test Suite for Autofill.service.ts

* [PM-2100] Finishing out tests for the getFormsWithPasswordFields method

* [PM-2100] Implementing tests for the doAutofill method within the autofill service

* [PM-2100] Working through implementation of doAutofill method

* [PM-2100] Working through implementation of doAutofill method

* [PM-2100] Finishing implementatino of isUntrustedIframe method within autofill service

* [PM-2100] Finishing implementation of doAutoFill method within autofill service

* [PM-2100] Finishing implementation of doAutoFillOnTab method within autofill service

* [PM-2100] Working through tests for generateFillScript

* [PM-2100] Finalizing generateFillScript method testing

* [PM-2100] Starting implementation of generateLoginFillScript

* [PM-2100] Working through tests for generateLoginFillScript

* [PM-2100] Finalizing generateLoginFillScript method testing

* [PM-2100] Removing unnecessary jest config file

* [PM-2100] Fixing jest tests based on changes implemented within PM-2130

* [PM-2100] Fixing autofill mocks

* [PM-2100] Fixing AutofillService jest tests

* [PM-2100] Handling missing tests within coverage of AutofillService

* [PM-2100] Handling missing tests within coverage of AutofillService.generateLoginFillScript

* [PM-2100] Writing tests for AutofillService.generateCardFillScript

* [PM-2100] Finalizing tests for AutofillService.generateCardFillScript

* [PM-2100] Adding additional tests to cover changes introduced by TOTOP autofill PR

* [PM-2100] Adding jest tests for Autofill.generateIdentityFillScript

* [PM-2100] Finalizing tests for AutofillService.generateIdentityFillScript

* [PM-2100] Implementing tests for AutofillService

* [PM-2100] Implementing tests for AutofillService.loadPasswordFields

* [PM-2100] Implementing tests for AutofillService.findUsernameField

* [PM-2100] Implementing tests for AutofillService.findTotpField

* [PM-2100] Implementing tests for AutofillService.fieldPropertyIsPrefixMatch

* [PM-2100] Finalizing tests for AutofillService

* [PM-2100] Modyfing placement of autofill-mocks

* [PM-2100] Modyfing placement of autofill-mocks

* [PM-2100] Removal of jest transform declaration

* [PM-2130] Fixing issue with autofill service unit tests

* [PM-2130] Fixing issue with autofill service unit tests

* [PM-2130] Fixing test test for when we need to handle a password reprompt

---------

Co-authored-by: Manuel <mr-manuel@outlook.it>
Co-authored-by: Cesar Gonzalez <cgonzalez@bitwarden.com>
Co-authored-by: Cesar Gonzalez <cesar.a.gonzalezcs@gmail.com>

* [PM-2747] Finanlizing implementation of attribute updates on cached values

* [PM-2319] Refactoring implementation to reposition OverlayIframe classes

* [PM-3465] Finalizing implementation of mutation observer behavior and CollectPageDetails optimization

* [PM-3465] Adding jest tests for introduced functionality

* [PM-3465] Finalizing jest tests and comments within implementation

* [PM-3465] Removing a TODO by incorrporating a method for deep querying for a password field element

* [PM-3465] Removing a TODO by incorrporating a method for deep querying for a password field element

* [PM-3285] Migrating Changes from PM-1407 into autofill v2 refactor implementation

* [PM-2747] Addressing stylistic changes requested from code review

* [PM-2319] Refactoring implementation

* [PM-2747] Add Support for Feature Flag of Autofill Version (#5695)

* [PM-2100] Create Unit Test Suite for Autofill.service.ts

* [PM-2100] Finishing out tests for the getFormsWithPasswordFields method

* [PM-2100] Implementing tests for the doAutofill method within the autofill service

* [PM-2100] Working through implementation of doAutofill method

* [PM-2100] Working through implementation of doAutofill method

* [PM-2100] Finishing implementatino of isUntrustedIframe method within autofill service

* [PM-2100] Finishing implementation of doAutoFill method within autofill service

* [PM-2100] Finishing implementation of doAutoFillOnTab method within autofill service

* [PM-2100] Working through tests for generateFillScript

* split up autofill.ts, first pass

* remove modification tracking comments

* lessen and localize eslint disables

* additional typing and formatting

* update autofill v2 with PR #5364 changes (update/i18n confirm dialogs)

* update autofill v2 with PR #4155 changes (add autofill support for textarea)

Co-Authored-By: Manuel <mr-manuel@outlook.it>

* move commonly used string values to constants

* ts cleanup

* [PM-2100] Finalizing generateFillScript method testing

* [PM-2100] Starting implementation of generateLoginFillScript

* [PM-2100] Working through tests for generateLoginFillScript

* [PM-2100] Finalizing generateLoginFillScript method testing

* [PM-2130] Starting work to re-architect autofillv2.ts

* [PM-2130] Starting work to re-architect autofillv2.ts

* [PM-2130] Working through autofill collect method

* [PM-2130] Marking Removal of documentUUID as dead code

* [PM-2130] Refining the implementation of collect and moving broken out utils back into class implementation

* [PM-2130] Applying small refactors to AutofillCollect

* [PM-2130] Refining the implementation of getAutofillFieldLabelTag to help with readability of the method

* [PM-2130] Implementing jest tests for AutofillCollect methods

* [PM-2130] Refining implementation for AutofillCollect

* [PM-2200] Unit tests for autofill content script utilities with slight refactors (#5544)

* add unit tests for urlNotSecure

* add test coverage command

* add unit tests for canSeeElementToStyle

* canSeeElementToStyle should not return true if `animateTheFilling` or `currentEl` is false

* add tests for selectAllFromDoc and getElementByOpId

* clean up getElementByOpId

* address some typing issues

* add tests for setValueForElementByEvent, setValueForElement, and doSimpleSetByQuery

* clean up setValueForElement and setValueForElementByEvent

* more typescript cleanup

* add tests for doClickByOpId and touchAllPasswordFields

* add tests for doFocusByOpId and doClickByQuery

* misc fill cleanup

* move functions between collect and fill utils and replace getElementForOPID for duplicate getElementByOpId

* add tests for isKnownTag and isElementVisible

* rename addProp and remove redundant focusElement in favor of doFocusElement

* cleanup

* fix checkNodeType

* add tests for shiftForLeftLabel

* clean up and rename checkNodeType, isKnownTag, and shiftForLeftLabel

* add tests for getFormElements

* clean up getFormElements

* add tests for getElementAttrValue, getElementValue, getSelectElementOptions, getLabelTop, and queryDoc

* clean up and rename queryDoc to queryDocument

* misc cleanup and rename getElementAttrValue to getPropertyOrAttribute

* rebase cleanup

* prettier formatting

* [PM-2130] Fixing linting issues

* [PM-2130] Fixing linting issues

* [PM-2130] Migrating implementation for collect methods and tests for those methods into AutofillCollect context

* [PM-2130] Migrating getPropertyOrAttribute method from utils to AutofillCollect

* [PM-2130] Continuing migration of methods from collect utils into AutofillCollect

* [PM-2130] Rework of isViewable method to better handle behavior for how we identify if an element is currently within the viewport

* [PM-2130] Filling out implementation of autofill-insert

* [PM-2130] Refining AutofillInsert

* [PM-2130] Implementing jest tests for AutofillCollect methods and breaking out visibility related logic to a separate service

* [PM-2130] Fixing jest tests for AutofillCollect

* [PM-2130] Fixing jest tests for AutofillInit

* [PM-2130] Adjusting how the AutofillFieldVisibilityService class is used in AutofillCollect

* [PM-2130] Working through AutofillInsert implementation

* [PM-2130] Migrating methods from fill.ts to AutofillInsert

* [PM-2130] Migrating methods from fill.ts to AutofillInsert

* [PM-2130] Applying fix for IntersectionObserver when triggering behavior in Safari and fixing issue with how we trigger an input event shortly after filling in a field

* [PM-2130] Refactoring AutofillCollect to service CollectAutofillContentService

* [PM-2130] Refactoring AutofillInsert to service InsertAutofillContentService

* [PM-2130] Further organization of implementation

* [PM-2130] Filling out missing jest test for AutofillInit.fillForm method

* [PM-2130] Migrating the last of the collect jest tests to InsertAutofillContentService

* [PM-2130] Further refactoring of elements including typing information

* [PM-2130] Implementing jest tests for InsertAutofillContentService

* [PM-2130] Implementing jest tests for InsertAutofillContentService

* [PM-2130] Organization and refactoring of methods within InsertAutofillContent

* [PM-2130] Implementation of jest tests for InsertAutofillContentService

* [PM-2130] Implementation of Jest Test for IntertAutofillContentService

* [PM-2130] Finalizing migration of methods and jest tests from util files into Autofill serivces

* [PM-2130] Cleaning up dead code comments

* [PM-2130] Removing unnecessary constants

* [PM-2130] Finalizing jest tests for InsertAutofillContentService

* [PM-2130] Refactoring FieldVisibiltyService to DomElementVisibilityService to allow service to act in a more general manner

* [PM-2130] Implementing jest tests for DomElementVisibilityService

* [PM-2130] Implementing jest tests for DomElementVisibilityService

* [PM-2130] Implementing jest tests for DomElementVisibilityService

* [PM-2130] Implementing jest tests for DomElementVisibilityService

* [PM-2130] Breaking out the callback method used to resolve the IntersectionObserver promise

* [PM-2100] Removing unnecessary jest config file

* [PM-2100] Fixing jest tests based on changes implemented within PM-2130

* [PM-2100] Fixing autofill mocks

* [PM-2100] Fixing AutofillService jest tests

* [PM-2100] Handling missing tests within coverage of AutofillService

* [PM-2100] Handling missing tests within coverage of AutofillService.generateLoginFillScript

* [PM-2100] Writing tests for AutofillService.generateCardFillScript

* [PM-2100] Finalizing tests for AutofillService.generateCardFillScript

* [PM-2100] Adding additional tests to cover changes introduced by TOTOP autofill PR

* [PM-2100] Adding jest tests for Autofill.generateIdentityFillScript

* [PM-2100] Finalizing tests for AutofillService.generateIdentityFillScript

* [PM-2100] Implementing tests for AutofillService

* [PM-2130] Adding a comment explaining a fix for Safari

* [PM-2130] Adding a comment explaining a fix for Safari

* [PM-2100] Implementing tests for AutofillService.loadPasswordFields

* [PM-2100] Implementing tests for AutofillService.findUsernameField

* [PM-2100] Implementing tests for AutofillService.findTotpField

* [PM-2100] Implementing tests for AutofillService.fieldPropertyIsPrefixMatch

* [PM-2100] Finalizing tests for AutofillService

* [PM-2747] Add Support for Feature Flag of Autofill Version

* [PM-2747] Adding Support for Manifest v3 within the implementation

* [PM-2747] Modifying how the feature flag for autofill is named

* [PM-2747] Modifying main.background.ts to load the ConfigApiService correctly

* [PM-2747] Refactoring trigger of autofill scripts to be a simple immediately invoked function

* [PM-2100] Modyfing placement of autofill-mocks

* [PM-2100] Modyfing placement of autofill-mocks

* [PM-2100] Removal of jest transform declaration

* [PM-2130] Applying changes required for PM-2762 to implementation, and ensuring jest tests exist to validate the behavior

* [PM-2747] Modifying how we inject the autofill scripts to ensure we are injecting into all frames within a page

* [PM-2130] Removing usage of IntersectionObserver when identifying element visibility due to broken interactions with React Components

* [PM-2130] Fixing issue found when attempting to capture the elementAtCenterPoint in determining file visibility

* [PM-2100] Create Unit Test Suite for autofill.service.ts (#5371)

* [PM-2100] Create Unit Test Suite for Autofill.service.ts

* [PM-2100] Finishing out tests for the getFormsWithPasswordFields method

* [PM-2100] Implementing tests for the doAutofill method within the autofill service

* [PM-2100] Working through implementation of doAutofill method

* [PM-2100] Working through implementation of doAutofill method

* [PM-2100] Finishing implementatino of isUntrustedIframe method within autofill service

* [PM-2100] Finishing implementation of doAutoFill method within autofill service

* [PM-2100] Finishing implementation of doAutoFillOnTab method within autofill service

* [PM-2100] Working through tests for generateFillScript

* [PM-2100] Finalizing generateFillScript method testing

* [PM-2100] Starting implementation of generateLoginFillScript

* [PM-2100] Working through tests for generateLoginFillScript

* [PM-2100] Finalizing generateLoginFillScript method testing

* [PM-2100] Removing unnecessary jest config file

* [PM-2100] Fixing jest tests based on changes implemented within PM-2130

* [PM-2100] Fixing autofill mocks

* [PM-2100] Fixing AutofillService jest tests

* [PM-2100] Handling missing tests within coverage of AutofillService

* [PM-2100] Handling missing tests within coverage of AutofillService.generateLoginFillScript

* [PM-2100] Writing tests for AutofillService.generateCardFillScript

* [PM-2100] Finalizing tests for AutofillService.generateCardFillScript

* [PM-2100] Adding additional tests to cover changes introduced by TOTOP autofill PR

* [PM-2100] Adding jest tests for Autofill.generateIdentityFillScript

* [PM-2100] Finalizing tests for AutofillService.generateIdentityFillScript

* [PM-2100] Implementing tests for AutofillService

* [PM-2100] Implementing tests for AutofillService.loadPasswordFields

* [PM-2100] Implementing tests for AutofillService.findUsernameField

* [PM-2100] Implementing tests for AutofillService.findTotpField

* [PM-2100] Implementing tests for AutofillService.fieldPropertyIsPrefixMatch

* [PM-2100] Finalizing tests for AutofillService

* [PM-2100] Modyfing placement of autofill-mocks

* [PM-2100] Modyfing placement of autofill-mocks

* [PM-2100] Removal of jest transform declaration

* [PM-2747] Applying a fix for a race condition that can occur when loading the notification bar and autofiller script login

* [PM-2747] Reverting removal of autofill npm action. Now this will force usage of autofill-v2 regardless of whether a feature flag is set or not

* [PM-2747] Fixing logic error incorporated when merging in master

* [PM-2130] Fixing issue with autofill service unit tests

* [PM-2130] Fixing issue with autofill service unit tests

* [PM-2747] Fixing issue present with notification bar merge

* [PM-2130] Fixing test test for when we need to handle a password reprompt

* [PM-2747] Fixing wording for webpack script

* [PM-2747] Addressing stylistic changes requested from code review

* [PM-2747] Addressing stylistic changes requested from code review

---------

Co-authored-by: Jonathan Prusik <jprusik@classynemesis.com>
Co-authored-by: Manuel <mr-manuel@outlook.it>
Co-authored-by: Jonathan Prusik <jprusik@users.noreply.github.com>

* [PM-3285] Applying stylistic changes suggested by code review for the feature flag implementation

* [PM-3285] Adding temporary console log to validate which version is being used

* [PM-2319] Adjusting translation content

* [PM-3465] Implementing a methodology for sorting the autofill field elements after awaiting the results of each element

* [PM-3465] Implementing a methodology for sorting the autofill field elements after awaiting the results of each element

* [PM-3465] Implementing a methodology for using cached field values when requerying DOM for elements

* [PM-2319] Adjusting translation content

* [PM-2319] Adding typing information for OverlayBackground

* [PM-2319] Removing unnecesssary methods within OverlayBackground and AutofillOverlayContentService

* [PM-2319] Refactoring implementation and incorpoarting BrowserApi class more effectively

* [PM-2319] Fixing issue found with opening overaly element during reprompt of vault item

* [PM-2319] Fixing issue found with auth status not updating when overlay is initializing

* [PM-2319] Implementing a method for initializing the overlay with the user auth status

* [PM-2319] Fixing issue where shadowRoot elements might not initialize overlay on setup

* [PM-2319] Implementing await for runFillScriptAction

* [PM-2319] Implementing methodology for having list of elements hide after user starts inputting within field

* [PM-2319] Removing unnecesssary methods within OverlayBackground and AutofillOverlayContentService

* [PM-2319] Fixing tab focus issue

* [PM-2319] Fixing issue where page details would unload sooner than desired

* [PM-2319] Fixing tab focus issues present on page details

* [PM-2319] Adjusting how we iterate over cipher data

* [PM-2319] Refactoring overlay background

* [PM-2319] Adding typing information for OverlayBackground

* [PM-2319] Adding typing information for OverlayBackground

* [PM-2319] Refactoring and optimizing for loops

* [PM-2319] Refactoring and optimizing how we listen for overlay element ports

* [PM-2319] Implementing method for ensuring overlay removes itself if user scrolls focused input element out of viewport

* [PM-2319] Replacing usage of foreach for a regular for loop

* [PM-2319] Replacing usage of foreach for a regular for loop

* [PM-2319] Refactoring forEach loops within CollectAutofillContent and moving autofill utils to a top level

* [PM-2319] Refactoring getRandomCustomElementName util method

* [PM-2319] Refactoring implementation

* [PM-2319] Refactoring implementation

* [PM-2319] Replacing hardcoded values for events with constant enum

* [PM-2319] Adding reduced animation declaration for fill

* [PM-2319] Adjusting implementation of mutation observer to better handle insertion of elements around overlay

* [PM-2319] Fixing jest test

* [PM-2319] Implementing method for ensuring tab focus from the overlay button can move to the correct place

* [PM-2319] Refactoring implementation

* [PM-3285] Removing temporary console log indicating which version of autofill the user is currently loading

* [PM-3465] Adding scripting api reference to the manifest v3 json file

* [PM-2319] Splitting shared logic within the overlay page implementations to act as a parent class for the overlay button and list pages

* [PM-2319] Updating file names for page scripts

* [PM-2319] Updating file names for page scripts

* [PM-2319] Fixing issues present with overlay background when updating auth status

* [PM-2319] Refactoring implementation

* [PM-2319] Fixing cache invalidation issues present with the collect page details optimization

* [PM-3465] Updating implementation to deal with cache invalidation issues

* [PM-3465] Implementing jest tests for added collect autofill content class elements

* [PM-3465] Removing scripting API permissiong within manifest v3 json file

* [PM-2319] Adding scripting api to manifest v3

* [PM-2319] Fixing issue present with non visible fields having an overlay element

* [PM-3465] Implementing method for removing cached page details if the window location has updated

* [PM-3465] Fixing issue found with query selector generated while collecting page details

* [PM-2319] Commenting out code that overrides default browser autofill behavior in chrome

* [PM-3465] Fixing jest tests

* [PM-3465] Fixing jest tests

* [PM-2319] Adding typing information for OverlayBackground

* [PM-2319] Updating typing information for the Overlay Background

* [PM-2319] Adding typing information for notification changes

* [PM-2319] Finalizing OverlayBackground typing info and removing browser autofill override method

* [PM-2319] Refining typing information within different service classes

* [PM-2319] Finalizing typing information within implementation

* [PM-2319] Further refinement and fixes for icon element

* [PM-2319] Fixing issue where submission of form and presentation of notification bar can offset the overlay element

* [PM-2319] Fixing issues present with keyboard focus and determining when to open the overlay upon user interaction

* [PM-2319] Adding in change to fix issue where autofill is occurring when iframes exist

* [PM-2319] Implementing lazy load of UI elements

* [PM-2319] Fixing issue present with lazy loading of cipher elements

* [PM-2319] Fixing issue present with lazy loading of cipher elements

* [PM-2319] Modifying offset for the ciphers list container

* [PM-2319] Fixing issue encountered with autofilling using keyboard

* [PM-2319] Modifying initialization of iframe element

* [PM-2319] Fixing an issue where login ciphers that do not contain a user name will not display within the overlay list

* [PM-2855] [PM-3034] Add Setting to Enable Autofill Overlay (#6194)

* [PM-2855] Add Settings to Enable Autofil Overlay

* [PM-2855] Adding feature flag for overlay

* [PM-2855] Implementing autofill overlay setting within browser extension

* [PM-2855] Implementing autofill overlay appearance setting

* [PM-2855] Implementing behavior within autofill overlay to conditionally display either the icon or the full list on focus of an element

* [PM-2855] Implementing a fix for when focus changes with the form field visible

* [PM-2855] Modifying rules for how the callout appears within the current-tab component

* [PM-2855] Modifying enum for autofill overlay appearance

* [PM-2855] Implementing check to ensure autofill overlay setting is not visible if the feature flag is not set

* [PM-2855] Fixing jest tests within implementation

* [PM-2855] Modifying how we pull the overlay appearance information for the end user

* [PM-2855] Applying changes to the structure for how the overlay settings are identified and verified

* [PM-2855] Applying changes to the structure for how the overlay settings are identified and verified

* [PM-2855] Adding translations content

* [PM-2855] Modifying implementation for how autofill settings populate and present themselves

* [PM-2855] Modifying implementation for how autofill settings populate and present themselves

* [PM-2855] Adding the ability to override autofill permissions within Chrome as an opt-in

* [PM-2855] Modifying message sent when vault item reprompt popout is opened

* [PM-2855] Fixing issue encountered with how we handle lazy loading vaul items

* [PM-2855] Fixing issue present when iframe is updating position when the window focus changes

* [PM-3982] Implement Autofill Overlay unit tests (#6337)

* [PM-2319] Jest Tests for Autofill Overlay MVP

* [PM-2319] Jest test stubs for OverlayBackground

* add tests and cleanup (#6341)

* [PM-3983] Implementing test for `updateAutofillOverlayCiphers`

* [PM-3983] Implementing test for `updateAutofillOverlayCiphers`

* [PM-3983] Working through jest tests for overlay background

* [PM-3983] Adding jest tests for OverlayBackground

* [PM-3983] Adding jest tests for OverlayBackground;

* [PM-3983] Adding jest tests for getAuthStatus

* [PM-3983] Adding jest tests for getAuthStatus

* [PM-3983] Adding jest tests for getTranslations

* [PM-3983] Finalizing jest tests for OverlayBackground

* [PM-3983] Finalizing jest tests for OverlayBackground

* [PM-3982] Updating unit tests within AutofillInit

* [PM-3982] Adding jest tests for AutofillOverlayIframeElement, AutofillOverlayButtonIframe, and AutofillOverlayListIframe

* [PM-3982] Adding jest tests for the AutofillOverlayIframeService class

* [PM-3992] AutofillOverlayContentService class unit tests

* [PM-3992] AutofillOverlayContentService class unit tests

* [PM-3992] AutofillOverlayContentService class unit tests

* [PM-3992] AutofillOverlayContentService class unit tests

* [PM-3992] AutofillOverlayContentService class unit tests

* [PM-3992] AutofillOverlayContentService class unit tests

* [PM-3992] AutofillOverlayContentService class unit tests

* [PM-3992] AutofillOverlayContentService class unit tests

* [PM-3992] AutofillOverlayContentService class unit tests

* [PM-3992] AutofillOverlayContentService class unit tests

* [PM-3992] AutofillOverlayContentService class unit tests

* [PM-3992] AutofillOverlayContentService class unit tests

* [PM-3992] AutofillOverlayContentService class unit tests

* [PM-3992] AutofillOverlayContentService class unit tests

* [PM-3982] Filling out unit tests for the AutofillService class

* [PM-3982] Implementing unit tests for the AutofillOverlayPageElement custom element class

* [PM-3982] Updating elements to better allow for testing of the AutofillOverlayList and AutofillOverlayButton classes

* [PM-3982] Adding jest tests for AutofillOverlayList custom element class

* [PM-3982] Adding jest tests for AutofillOverlayList custom element class

* [PM-3982] Adding jest tests for the AutofillOverlayButton custom element class

* [PM-3982] Adding jest tests for the AutofillOverlayButton custom element class

* [PM-3982] Updating obsolete snapshot

* add tests for AutofillOverlayIframeService

* [PM-3982] Refactoring

* [PM-3982] Refactoring

---------

Co-authored-by: Jonathan Prusik <jprusik@users.noreply.github.com>
Co-authored-by: Jonathan Prusik <jprusik@classynemesis.com>

---------

Co-authored-by: Jonathan Prusik <jprusik@users.noreply.github.com>
Co-authored-by: Jonathan Prusik <jprusik@classynemesis.com>

* [PM-2319] Adjusting implementation for how we open the unlock popout to facilitate skipping the notification

* [PM-2319] Adjusting typing information within the OverlayBackground class and fixing issue found within the AutofillOverlayList implementation

* [PM-2319] Adjusting JSDOC comment within NotificationBackground

* [PM-2319] Refactoring OverlayBackground tests

* [PM-2319] Refactoring OverlayBackground tests

* [PM-2319] Refactoring JSDOC comments

* [PM-2319] Adding jest tests to modified TabsBackground class

* [PM-2319] Refactoring jest tests for AutofillInit

* [PM-2319] Refactoring AutofillInit JSDOC messages

* [PM-2319] Applying refactors to AutofillInit

* [PM-2319] Applying refactors to fying info for the AutofillOverlayIframeService

* [PM-2319] Adding the ability to apply the extension theme to the overlay elements

* [PM-2319] Adjusting background offset on darker themes

* [PM-2319] Adjusting background offset on darker themes

* [PM-2319] Adding JSDOC comments to the overlay iframe service

* [PM-2319] Cleaning up implementation

* [PM-2319] Cleaning up implementation

* [PM-2319] Adding removal of unknown manifest key, `sandbox`, from the Firefox manifest

* [PM-2319] Updating manifest v3 implementation to facilitate presentation of the overlay page elements

* [PM-2319] Adding documentation to the changes to BrowserApi

* [PM-2855] Removing unnecessary key

* [PM-2319] Removing unnecesssary abstraction file

* [PM-3035] Reverting changes to package-lock.json

* [PM-3035] Reverting changes to package-lock.json

* [PM-3035] Reverting added logs

---------

Co-authored-by: Jonathan Prusik <jprusik@users.noreply.github.com>
Co-authored-by: Manuel <mr-manuel@outlook.it>
Co-authored-by: Jonathan Prusik <jprusik@classynemesis.com>

---------

Co-authored-by: Jonathan Prusik <jprusik@users.noreply.github.com>
Co-authored-by: Manuel <mr-manuel@outlook.it>
Co-authored-by: Jonathan Prusik <jprusik@classynemesis.com>

* [PM-3032] Fixing issue with flashing background on overlay iframe list element

* [PM-3032] Modifying how we determine the size of the overlay button element to facilitate smaller scaling on larger sized input elements

* [PM-3032] Modifying how load actions are handled within the browser view component to clarify the triggered logic.

* [PM-3032] Adjusting implementation to how we trigger copy actions

* [PM-3032] Setting copyActions to be a static member of the view component class

* [PM-3032] Merging in changes

---------

Co-authored-by: Jonathan Prusik <jprusik@users.noreply.github.com>
Co-authored-by: Manuel <mr-manuel@outlook.it>
Co-authored-by: Jonathan Prusik <jprusik@classynemesis.com>

---------

Co-authored-by: Jonathan Prusik <jprusik@users.noreply.github.com>
Co-authored-by: Manuel <mr-manuel@outlook.it>
Co-authored-by: Jonathan Prusik <jprusik@classynemesis.com>

* [PM-3914] Fixing issue within Opera where lock and login routes can persist if user opens the extension popout in a new window before locking or logging out

* [PM-3914] Setting the extensionUrls that are cheked as a variable outside of the scope fo the openUlockPopout method to ensure it does not have to be rebuilt each time the method is called

* [PM-4744] Page Details that Update after Mutation Observer has Triggered Do Not Update within Overlay Background (#6848)

* [PM-4743] Windows Chromium Browser is Not Updating Overlay Ciphers on Tab Update (#6863)

* [PM-4763] Fixing Issues with the Overlay UI Positioning and Presentation (#6864)

* [PM-4763] Fixing overlay UI issues

* [PM-4736] Implementing a method to ensure that the overlay is refreshed anytime the overlay has lost visibility

* [PM-4763] Implementing a fix for a delayed opening of the overlay element where elements in the documentElement could potentially overlay our own UI element

* [PM-4763] Implementing a fix for when the visibility of the dom changes to facilitate removing the overlay element if necessary

* [PM-4763] Fixing jest tests

* [PM-4763] Fixing global references

* [PM-4790] Overlay not resetting on scroll of websites that do not scroll body element (#6877)

* [PM-4790] Overlay not resetting on scroll of websites that do not scrollt he body element

* [PM-4790] Setting up the scroll event to capture rather than setting mousewheel and touchmove events

* [PM-4790] Setting up constants for referenced events

* [PM-4229] Fixing issue found when collecting page details

* [PM-4229] Implementing optimization to ensure we only rebuild the autofill item if the overlay needs to set the listeners on the field

* [PM-4229] Adjusting copy for autofill callout message

---------

Co-authored-by: Jonathan Prusik <jprusik@users.noreply.github.com>
Co-authored-by: Manuel <mr-manuel@outlook.it>
Co-authored-by: Jonathan Prusik <jprusik@classynemesis.com>
2023-11-20 18:34:04 +00:00
Cesar Gonzalez cf6ada531e
[PM-3914] Refactor Browser Extension Popout Windows (#6296)
* [PM-3914] Refactor Browser Extension Popouts

* [PM-3914] Refactor Browser Extension Popouts

* [PM-3914] Refactor Browser Extension Popouts

* [PM-3914] Adding enums for the browser popout type

* [PM-3914] Making the methods for getting a window in a targeted manner public

* [PM-3914] Refactoing implementation

* [PM-3914] Updating deprecated api call

* [PM-3914] Fixing issues found when testing behavior

* [PM-3914] Reimplementing behavior based on feedback from platform team

* [PM-3914] Adding method of ensuring previously opened single action window is force closed for vault item password reprompts

* [PM-3914] Taking into consideration feedback regarding the browser popup utils service and implementating requested changes

* [PM-3914] Removing unnecesssary class dependencies

* [PM-3914] Adding method for uniquely setting up password reprompt windows

* [PM-3914] Modifying method

* [PM-3914] Adding jest tests and documentation for AuthPopoutWindow util

* [PM-3914] Adding jest tests and documentation for VaultPopoutWindow

* [PM-3914] Adding jest tests for the debouncing method within autofill service

* [PM-3914] Adding jest tests for the new BrowserApi methods

* [PM-3914] Adding jest tests to the BrowserPopupUtils class

* [PM-3914] Updating inPrivateMode reference

* [PM-3914] Updating inPrivateMode reference

* [PM-3914] Modifying comment

* [PM-3914] Moviing implementation for openCurrentPagePopout to the BrowserPopupUtils

* [PM-3914] Applying feedback

* [PM-3914] Applying feedback

* [PM-3914] Applying feedback

* [PM-3983] Refactoring implementation of `setContentScrollY` to facilitate having a potential delay

* [PM-3914] Applying feedback regarding setContentScrollY to the implementation

* [PM-3914] Modifying early return within the run method of the ContextMenuClickedHandler

* [PM-3914] Adding test for VaultPopoutWindow

* [PM-3914] Applying work done within PM-4366 to facilitate opening the popout window as a popup rather than a normal window

* [PM-3914] Updating the BrowserApi.removeTab method to leverage a callback structure for the promise rather than an async away structure

* [PM-3036] Adding jest tests for added passkeys popout windows

* [PM-3914] Adjsuting logic for turning off the warning when FIDO2 credentials are saved

* [PM-3914] Fixing height to design

* [PM-3914] Fixing call to Fido2 Popout

* [PM-3914] Fixing add/edit from fido2 popout

* [PM-3914] Fixing add/edit from fido2 popout

* [PM-3914] Fixing jest tests for updated elements

* [PM-3914] Reverting how context menu actions are passed to the view component

* [PM-3914] Reverting re-instantiation of config service within main.background.ts

* [PM-3914] Adding jest test for BrowserAPI removeTab method

* [PM-3914] Adding method to handle parsing the popout url path

* [PM-3914] Removing JSDOC comment elements

* [PM-3914] Removing await from method call

* [PM-3914] Simplifying implementation on add/edit

* [PM-3032] Adding more direct reference to view item action in context menus

* [PM-3914] Adjusting routing on Fido2 component to pass the singleActionPopout param to the route when opening the add-edit component

* [PM-3914] Adding singleActionPopout param to the fido2 component routing

* [PM-3914] Updating implementation details for how we build the extension url path

* [PM-3914] Reworking implementation for isSingleActionPopoutOpen to clean up iterative logic

* [PM-3914] Merging work from master and fixing merge conflicts

* [PM-3914] Fixing merge conflict introduced from master

* [PM-3914] Reworking closure of single action popouts to ensure they close the window instead of attempting to close the tab

* [PM-3914] Fixing issue within Opera where lock and login routes can persist if user opens the extension popout in a new window before locking or logging out

* [PM-3914] Setting the extensionUrls that are cheked as a variable outside of the scope fo the openUlockPopout method to ensure it does not have to be rebuilt each time the method is called
2023-11-08 12:57:44 -06:00
Daniel James Smith 35ed8f1d5e
[PM-4306] Extract file-popout-callout component used within Send on browser (#6564)
* Extract callout in send-add-edit into separate component

- Created new file-popout-callout.component
- Register component within app.module
- Replaced usage within send-add-edit.component

* Override popup header style to fix bit-callout

* [PM-4375] Reuse show file selector callout logic (#6606)

* Added FilePopoutUtilsService with the logic of showing/hiding the popout callout and file selector button

* Added documentation to FilePopoutUtilsService

* Added documentation for class and constructor on FilePopoutUtilsService

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
Co-authored-by: aj-rosado <109146700+aj-rosado@users.noreply.github.com>
2023-10-20 12:28:36 +02:00
Matt Gibson cdcd1809f0
Expand account service (#6622)
* Define account service observable responsibilities

* Establish account service observables and update methods

* Update Account Service observables from state service

This is a temporary stop-gap to avoid needing to reroute all account
activity and status changes through the account service. That can be
done as part of the breakup of state service.

* Add matchers for Observable emissions

* Fix null active account

* Test account service

* Transition account status to account info

* Remove unused matchers

* Remove duplicate class

* Replay active account for late subscriptions

* Add factories for background services

* Fix state service for web

* Allow for optional messaging

This is a temporary hack until the flow of account status can be
reversed from state -> account to account -> state. The foreground
account service will still logout, it's just the background one cannot
send messages

* Fix add account logic

* Do not throw on recoverable errors

It's possible that duplicate entries exist in `activeAccounts` exist
in the wild. If we throw on adding a duplicate account this will cause
applications to be unusable until duplicates are removed it is not
necessary to throw since this is recoverable. with some potential loss
in current account status

* Add documentation to abstraction

* Update libs/common/spec/utils.ts

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

* Fix justin's comment :fist-shake:

---------

Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
2023-10-19 15:41:01 -04:00
Daniel James Smith 9e290a3fed
[PM-4222] Make importer UI reusable (#6504)
* Split up import/export into separate modules

* Fix routing and apply PR feedback

* Renamed OrganizationExport exports to OrganizationVaultExport

* Make import dialogs standalone and move them to libs/importer

* Make import.component re-usable

- Move functionality which was previously present on the org-import.component into import.component
- Move import.component into libs/importer
Make import.component standalone
Create import-web.component to represent Web UI
Fix module imports and routing
Remove unused org-import-files

* Renamed filenames according to export rename

* Make ImportWebComponent standalone, simplify routing

* Pass organizationId as Input to ImportComponent

* use formLoading and formDisabled outputs

* Emit an event when the import succeeds

Remove Angular router from base-component as other clients might not have routing (i.e. desktop)
Move logic that happened on web successful import into the import-web.component

* fix table themes on desktop & browser

* fix fileSelector button styles

* update selectors to use tools prefix; remove unused selectors

* Wall off UI components in libs/importer

Create barrel-file for libs/importer/components
Remove components and dialog exports from libs/importer/index.ts
Extend libs/shared/tsconfig.libs.json to include @bitwarden/importer/ui -> libs/importer/components
Extend apps/web/tsconfig.ts to include @bitwarden/importer/ui
Update all usages

* Rename @bitwarden/importer to @bitwarden/importer/core

Create more barrel files in libs/importer/*
Update imports within libs/importer
Extend tsconfig files
Update imports in web, desktop, browser and cli

* Lazy-load the ImportWebComponent via both routes

* Use SharedModule as import in import-web.component

* File selector should be displayed as secondary

* Use bitSubmit to override submit preventDefault (#6607)

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

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
Co-authored-by: William Martin <contact@willmartian.com>
2023-10-19 11:17:23 +02:00
Oscar Hinton d0e72f5554
[PM-4360] Move auth owned code into auth (#6595) 2023-10-19 08:03:32 +00:00
SmithThe4th 922de469f4
[PM-2169] Update Password Reprompt Modal to use Component Library (#5720)
* update password reprompt to use the dialog CL

* Override showPasswordPrompt and submit method on web child classes from base classes to allow dialog work on web and modal on other clients

* Override showPasswordPrompt and submit method on web child classes from base classes to allow dialog work on web and modal on other clients

* Fixed lint issues

* Corrected comments

* Refactored passwored reprompt to use dialog service after changes to make the dialog service work on the desktop and browser

* Changed access modifier from protected to protected

* Refactored passwprd reprompt component to a stand alone component and fixed all references

* fix merge changes

* fix import aliases in password-reprompt.component.ts

* fix alias typo in browser tsconfig

* import from root vault alias

* revert tsconfig changes

* remove service abstraction and update imports

* remove component from imports

* Removed unneccesary show password toggle

* renamed selector to use vault prefix

* removed unnecessary data dismiss

* merged and fixed conflicts

* remove reintroduced file

* Added appAutoFocus to reprompt dialog

* delayed validation until submit happens

---------

Co-authored-by: William Martin <contact@willmartian.com>
2023-10-04 22:56:27 -04:00