2022-04-29 09:48:44 +02:00
|
|
|
import { APP_INITIALIZER, InjectionToken, NgModule } from "@angular/core";
|
|
|
|
|
|
|
|
import {
|
|
|
|
SECURE_STORAGE,
|
|
|
|
STATE_FACTORY,
|
|
|
|
STATE_SERVICE_USE_CACHE,
|
|
|
|
LOCALES_DIRECTORY,
|
|
|
|
SYSTEM_LANGUAGE,
|
2022-06-27 19:38:12 +02:00
|
|
|
MEMORY_STORAGE,
|
2023-11-21 22:35:37 +01:00
|
|
|
OBSERVABLE_MEMORY_STORAGE,
|
|
|
|
OBSERVABLE_DISK_STORAGE,
|
2024-02-26 23:31:09 +01:00
|
|
|
WINDOW,
|
2024-03-13 16:25:39 +01:00
|
|
|
SYSTEM_THEME_OBSERVABLE,
|
2022-09-07 22:23:32 +02:00
|
|
|
} from "@bitwarden/angular/services/injection-tokens";
|
|
|
|
import { JslibServicesModule } from "@bitwarden/angular/services/jslib-services.module";
|
[PM-194] Browser Account Switcher UI (#6772)
* Handle switch messaging
TODO: handle loading state for account switcher
* Async updates required for state
* Fallback to email for current account avatar
* Await un-awaited promises
* Remove unnecessary Prune
Prune was getting confused in browser and deleting memory in browser on
account switch. This method isn't needed since logout already removes
memory data, which is the condition for pruning
* Fix temp password in browser
* Use direct memory access until data is serializable
Safari uses a different message object extraction than firefox/chrome
and is removing `UInt8Array`s. Until all data passed into StorageService
is guaranteed serializable, we need to use direct access in state
service
* Reload badge and context menu on switch
* Gracefully switch account as they log out.
* Maintain location on account switch
* Remove unused state definitions
* Prefer null for state
undefined can be misinterpreted to indicate a value has not been set.
* Hack: structured clone in memory storage
We are currently getting dead objects on account switch due to updating
the object in the foreground state service. However, the storage service
is owned by the background. This structured clone hack ensures that all
objects stored in memory are owned by the appropriate context
* Null check nullable values
active account can be null, so we should include null safety in the
equality
* Correct background->foreground switch command
* Already providing background memory storage
* Handle connection and clipboard on switch account
* Prefer strict equal
* Ensure structuredClone is available to jsdom
This is a deficiency in jsdom --
https://github.com/jsdom/jsdom/issues/3363 -- structured clone is well
supported.
* Fixup types in faker class
* add avatar and simple navigation to header
* add options buttons
* add app-header to necessary pages
* add back button and adjust avatar sizes
* add helper text when account limit reached
* convert magic number to constant
* add clarifying comment
* adjust homepage header styles
* navigate to previousp page upon avatar click when already on '/account-switcher'
* move account UI to own component
* add i18n
* show correct auth status
* add aria-hidden to icons
* use listbox role
* add screen reader accessibility to account component
* more SR a11y updates to account component
* add hover and focus states to avatar
* refactor hover and focus states for avatar
* add screen reader text for avatar
* add slide-down animation on account switcher close
* remove comment
* setup account component story
* add all stories
* move navigation call to account component
* implement account lock
* add button hover effect
* implement account logout
* implement lockAll accounts functionality
* replace 'any' with custom type
* add account switcher button to /home login page
* use <main> tag (enables scrolling)
* change temp server filler name
* temporarily remove server arg from account story
* don't show avatar on /home if no accounts, and don't show 'lock'/'logout' buttons if no currentAccount
* add translation and a11y to /home avatar
* add correct server url to account component
* add 'server' to AccountOption type
* Enabled account switching client-side feature flag.
* add slide-in transition to /account-switcher page
* change capitalization to reflect figma design
* make screen reader read active account email, address more capitalization
* fix web avatar misalignment
* make avatar color based on user settings and in sync with other clients
* make property private
* change accountOptions to availableAccounts for clarity
* refactor to remove 'else' template ref
* remove empty scss rule
* use tailwind instead of scss
* rename isSelected to isActive
* add 'isButton' to /home page avatar
* move files to services folder
* update import
* Remove duplicate active account button
* Move no account button to current-account component
* Always complete logging out
Fixes PM-4866
* make screenreader read off email, not name
* refactor avatar for button case
* Do not next object updates
StateService's init was calling `updateState` at multiple layers,
once overall and then again for each account updated. Because
we were not maintaining a single state object through the
process, it was ending up in a consistent, but incomplete state.
Fixed by returning the updated state everywhere. This very well
may not be all the bugs associated with this
* Treat null switch account as no active user
* Listen for switchAccountFinish before routing (#6950)
* adjust avatar style when wrapped in a button
* show alt text for favicon setting
* move stories to browser
* Send Finish Message on null
* Dynamically set active user when locking all
This is required because some user lock states are not recoverable after
process reload (those with logout timeout). This waits until reload is
occurring, then sets the next user appropriately
* Move Finished Message to Finally Block
Fix tests
* Drop problematic key migration
Fixes PM-4933. This was an instance of foreground/background collision
when writing state. We have several other fallbacks of clearing
these deprecated keys.
* Prefer location to homebrew router service
* Initialize account disk cache from background
Uses the `isRecoveredSession` bool to re-initialize foreground caches
from a background message. This avoids a lengthy first-read for
foregrounds
* PM-4865 - Browser Acct Switcher - only show lock btn for lockable accounts (#6991)
* Lock of active account first, when locking multiple.
Fixes PM-4996
* Fix linter
* Hide lock now for locked users (#7020)
* Hide lock now for locked users
* Prefer disabling button to removing
* Add tooltip to TDE without unlock method
* Load all auth states on state init (#7027)
This is a temporary fix until the owning services can update state
themselves. It uses the presence of an auto key to surmise unlocked
state on init. This is safe since it's run only once on extension start.
* Ps/pm 5004/add load to account switcher (#7032)
* Add load spinner to account switcher
* Remove ul list icons
* Properly size account switcher in popout
* [PM-5005] Prevent Double Navigation (#7035)
* Delete Overriden Method
* Add Lock Transition
* truncate email and server name
* remove account.stories.ts (will add in separate PR)
* Do not switch user at reload if no user is active
* fix prettier issues
---------
Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
Co-authored-by: Todd Martin <tmartin@bitwarden.com>
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
Co-authored-by: Jared Snider <116684653+JaredSnider-Bitwarden@users.noreply.github.com>
Co-authored-by: bnagawiecki <107435978+bnagawiecki@users.noreply.github.com>
2023-12-06 18:22:48 +01:00
|
|
|
import { VaultTimeoutSettingsService } from "@bitwarden/common/abstractions/vault-timeout/vault-timeout-settings.service";
|
[AC-1011] Admin Console / Billing code ownership (#4973)
* refactor: move SCIM component to admin-console, refs EC-1011
* refactor: move scimProviderType to admin-console, refs EC-1011
* refactor: move scim-config.api to admin-console, refs EC-1011
* refactor: create models folder and nest existing api contents, refs EC-1011
* refactor: move scim-config to admin-console models, refs EC-1011
* refactor: move billing.component to billing, refs EC-1011
* refactor: remove nested app folder from new billing structure, refs EC-1011
* refactor: move organizations/billing to billing, refs EC-1011
* refactor: move add-credit and adjust-payment to billing/settings, refs EC-1011
* refactor: billing history/sync to billing, refs EC-1011
* refactor: move org plans, payment/method to billing/settings, refs EC-1011
* fix: update legacy file paths for payment-method and tax-info, refs EC-1011
* fix: update imports for scim component, refs EC-1011
* refactor: move subscription and tax-info into billing, refs EC-1011
* refactor: move user-subscription to billing, refs EC-1011
* refactor: move images/cards to billing and update base path, refs EC-1011
* refactor: move payment-method, plan subscription, and plan to billing, refs EC-1011
* refactor: move transaction-type to billing, refs EC-1011
* refactor: move billing-sync-config to billing, refs EC-1011
* refactor: move billing-sync and bit-pay-invoice request to billing, refs EC-1011
* refactor: move org subscription and tax info update requests to billing, refs EC-1011
* fix: broken paths to billing, refs EC-1011
* refactor: move payment request to billing, refs EC-1011
* fix: update remaining imports for payment-request, refs EC-1011
* refactor: move tax-info-update to billing, refs EC-1011
* refactor: move billing-payment, billing-history, and billing responses to billing, refs EC-1011
* refactor: move organization-subscription-responset to billing, refs EC-1011
* refactor: move payment and plan responses to billing, refs EC-1011
* refactor: move subscription response to billing ,refs EC-1011
* refactor: move tax info and rate responses to billing, refs EC-1011
* fix: update remaining path to base response for tax-rate response, refs EC-1011
* refactor: (browser) move organization-service to admin-console, refs EC-1011
* refactor: (browser) move organizaiton-service to admin-console, refs EC-1011
* refactor: (cli) move share command to admin-console, refs EC-1011
* refactor: move organization-collect request model to admin-console, refs EC-1011
* refactor: (web) move organization, collection/user responses to admin-console, refs EC-1011
* refactor: (cli) move selection-read-only to admin-console, refs EC-1011
* refactor: (desktop) move organization-filter to admin-console, refs EC-1011
* refactor: (web) move organization-switcher to admin-console, refs EC-1011
* refactor: (web) move access-selector to admin-console, refs EC-1011
* refactor: (web) move create folder to admin-console, refs EC-1011
* refactor: (web) move org guards folder to admin-console, refs EC-1011
* refactor: (web) move org layout to admin-console, refs EC-1011
* refactor: move manage collections to admin console, refs EC-1011
* refactor: (web) move collection-dialog to admin-console, refs EC-1011
* refactor: (web) move entity users/events and events component to admin-console, refs EC-1011
* refactor: (web) move groups/group-add-edit to admin-console, refs EC-1011
* refactor: (web) move manage, org-manage module, and user-confirm to admin-console, refs EC-1011
* refactor: (web) move people to admin-console, refs EC-1011
* refactor: (web) move reset-password to admin-console, refs EC-1011
* refactor: (web) move organization-routing and module to admin-console, refs EC-1011
* refactor: move admin-console and billing within app scope, refs EC-1011
* fix: update leftover merge conflicts, refs EC-1011
* refactor: (web) member-dialog to admin-console, refs EC-1011
* refactor: (web) move policies to admin-console, refs EC-1011
* refactor: (web) move reporting to admin-console, refs EC-1011
* refactor: (web) move settings to admin-console, refs EC-1011
* refactor: (web) move sponsorships to admin-console, refs EC-1011
* refactor: (web) move tools to admin-console, refs EC-1011
* refactor: (web) move users to admin-console, refs EC-1011
* refactor: (web) move collections to admin-console, refs EC-1011
* refactor: (web) move create-organization to admin-console, refs EC-1011
* refactor: (web) move licensed components to admin-console, refs EC-1011
* refactor: (web) move bit organization modules to admin-console, refs EC-1011
* fix: update leftover import statements for organizations.module, refs EC-1011
* refactor: (web) move personal vault and max timeout to admin-console, refs EC-1011
* refactor: (web) move providers to admin-console, refs EC-1011
* refactor: (libs) move organization service to admin-console, refs EC-1011
* refactor: (libs) move profile org/provider responses and other misc org responses to admin-console, refs EC-1011
* refactor: (libs) move provider request and selectionion-read-only request to admin-console, refs EC-1011
* fix: update missed import path for provider-user-update request, refs EC-1011
* refactor: (libs) move abstractions to admin-console, refs EC-1011
* refactor: (libs) move org/provider enums to admin-console, refs EC-1011
* fix: update downstream import statements from libs changes, refs EC-1011
* refactor: (libs) move data files to admin-console, refs EC-1011
* refactor: (libs) move domain to admin-console, refs EC-1011
* refactor: (libs) move request objects to admin-console, refs EC-1011
* fix: update downstream import changes from libs, refs EC-1011
* refactor: move leftover provider files to admin-console, refs EC-1011
* refactor: (browser) move group policy environment to admin-console, refs EC-1011
* fix: (browser) update downstream import statements, refs EC-1011
* fix: (desktop) update downstream libs moves, refs EC-1011
* fix: (cli) update downstream import changes from libs, refs EC-1011
* refactor: move org-auth related files to admin-console, refs EC-1011
* refactor: (libs) move request objects to admin-console, refs EC-1011
* refactor: move persmissions to admin-console, refs EC-1011
* refactor: move sponsored families to admin-console and fix libs changes, refs EC-1011
* refactor: move collections to admin-console, refs EC-1011
* refactor: move spec file back to spec scope, refs EC-1011
* fix: update downstream imports due to libs changes, refs EC-1011
* fix: udpate downstream import changes due to libs, refs EC-1011
* fix: update downstream imports due to libs changes, refs EC-1011
* fix: update downstream imports from libs changes, refs EC-1011
* fix: update path malformation in jslib-services.module, refs EC-1011
* fix: lint errors from improper casing, refs AC-1011
* fix: update downstream filename changes, refs AC-1011
* fix: (cli) update downstream filename changes, refs AC-1011
* fix: (desktop) update downstream filename changes, refs AC-1011
* fix: (browser) update downstream filename changes, refs AC-1011
* fix: lint errors, refs AC-1011
* fix: prettier, refs AC-1011
* fix: lint fixes for import order, refs AC-1011
* fix: update import path for provider user type, refs AC-1011
* fix: update new codes import paths for admin console structure, refs AC-1011
* fix: lint/prettier, refs AC-1011
* fix: update layout stories path, refs AC-1011
* fix: update comoponents card icons base variable in styles, refs AC-1011
* fix: update provider service path in permissions guard spec, refs AC-1011
* fix: update provider permission guard path, refs AC-1011
* fix: remove unecessary TODO for shared index export statement, refs AC-1011
* refactor: move browser-organization service and cli organization-user response out of admin-console, refs AC-1011
* refactor: move web/browser/desktop collections component to vault domain, refs AC-1011
* refactor: move organization.module out of admin-console scope, refs AC-1011
* fix: prettier, refs AC-1011
* refactor: move organizations-api-key.request out of admin-console scope, refs AC-1011
2023-03-22 16:03:50 +01:00
|
|
|
import { PolicyService as PolicyServiceAbstraction } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction";
|
2023-10-19 21:41:01 +02:00
|
|
|
import { AccountService as AccountServiceAbstraction } from "@bitwarden/common/auth/abstractions/account.service";
|
2023-02-06 22:53:37 +01:00
|
|
|
import { AuthService as AuthServiceAbstraction } from "@bitwarden/common/auth/abstractions/auth.service";
|
|
|
|
import { LoginService as LoginServiceAbstraction } from "@bitwarden/common/auth/abstractions/login.service";
|
|
|
|
import { LoginService } from "@bitwarden/common/auth/services/login.service";
|
2024-02-28 17:49:20 +01:00
|
|
|
import { AutofillSettingsServiceAbstraction } from "@bitwarden/common/autofill/services/autofill-settings.service";
|
2023-06-06 22:34:53 +02:00
|
|
|
import { BroadcasterService as BroadcasterServiceAbstraction } from "@bitwarden/common/platform/abstractions/broadcaster.service";
|
|
|
|
import { CryptoFunctionService as CryptoFunctionServiceAbstraction } from "@bitwarden/common/platform/abstractions/crypto-function.service";
|
|
|
|
import { CryptoService as CryptoServiceAbstraction } from "@bitwarden/common/platform/abstractions/crypto.service";
|
|
|
|
import { EncryptService } from "@bitwarden/common/platform/abstractions/encrypt.service";
|
2024-01-24 20:21:50 +01:00
|
|
|
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
|
2023-06-06 22:34:53 +02:00
|
|
|
import { FileDownloadService } from "@bitwarden/common/platform/abstractions/file-download/file-download.service";
|
|
|
|
import { I18nService as I18nServiceAbstraction } from "@bitwarden/common/platform/abstractions/i18n.service";
|
2024-02-23 14:48:15 +01:00
|
|
|
import { KeyGenerationService as KeyGenerationServiceAbstraction } from "@bitwarden/common/platform/abstractions/key-generation.service";
|
2023-06-06 22:34:53 +02:00
|
|
|
import {
|
|
|
|
LogService,
|
|
|
|
LogService as LogServiceAbstraction,
|
|
|
|
} from "@bitwarden/common/platform/abstractions/log.service";
|
|
|
|
import { MessagingService as MessagingServiceAbstraction } from "@bitwarden/common/platform/abstractions/messaging.service";
|
|
|
|
import { PlatformUtilsService as PlatformUtilsServiceAbstraction } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
|
|
|
import { StateService as StateServiceAbstraction } from "@bitwarden/common/platform/abstractions/state.service";
|
|
|
|
import { AbstractStorageService } from "@bitwarden/common/platform/abstractions/storage.service";
|
|
|
|
import { SystemService as SystemServiceAbstraction } from "@bitwarden/common/platform/abstractions/system.service";
|
2024-02-05 19:02:28 +01:00
|
|
|
import { BiometricStateService } from "@bitwarden/common/platform/biometrics/biometric-state.service";
|
2023-06-06 22:34:53 +02:00
|
|
|
import { StateFactory } from "@bitwarden/common/platform/factories/state-factory";
|
|
|
|
import { GlobalState } from "@bitwarden/common/platform/models/domain/global-state";
|
|
|
|
import { MemoryStorageService } from "@bitwarden/common/platform/services/memory-storage.service";
|
2024-02-14 14:52:13 +01:00
|
|
|
import { MigrationRunner } from "@bitwarden/common/platform/services/migration-runner";
|
2023-06-06 22:34:53 +02:00
|
|
|
import { SystemService } from "@bitwarden/common/platform/services/system.service";
|
2024-03-11 18:59:19 +01:00
|
|
|
import { GlobalStateProvider, StateProvider } from "@bitwarden/common/platform/state";
|
2024-01-29 20:42:58 +01:00
|
|
|
// eslint-disable-next-line import/no-restricted-paths -- Implementation for memory storage
|
|
|
|
import { MemoryStorageService as MemoryStorageServiceForStateProviders } from "@bitwarden/common/platform/state/storage/memory-storage.service";
|
2023-03-10 21:39:46 +01:00
|
|
|
import { PasswordGenerationServiceAbstraction } from "@bitwarden/common/tools/generator/password";
|
2023-01-31 22:08:37 +01:00
|
|
|
import { CipherService as CipherServiceAbstraction } from "@bitwarden/common/vault/abstractions/cipher.service";
|
2023-08-16 14:26:56 +02:00
|
|
|
import { DialogService } from "@bitwarden/components";
|
2022-04-29 09:48:44 +02:00
|
|
|
|
2023-02-06 22:53:37 +01:00
|
|
|
import { LoginGuard } from "../../auth/guards/login.guard";
|
2022-04-29 09:48:44 +02:00
|
|
|
import { Account } from "../../models/account";
|
2024-02-07 16:39:54 +01:00
|
|
|
import { ElectronCryptoService } from "../../platform/services/electron-crypto.service";
|
2024-02-08 18:00:19 +01:00
|
|
|
import { ElectronLogRendererService } from "../../platform/services/electron-log.renderer.service";
|
2023-06-06 22:34:53 +02:00
|
|
|
import { ElectronPlatformUtilsService } from "../../platform/services/electron-platform-utils.service";
|
|
|
|
import { ElectronRendererMessagingService } from "../../platform/services/electron-renderer-messaging.service";
|
|
|
|
import { ElectronRendererSecureStorageService } from "../../platform/services/electron-renderer-secure-storage.service";
|
|
|
|
import { ElectronRendererStorageService } from "../../platform/services/electron-renderer-storage.service";
|
|
|
|
import { ElectronStateService } from "../../platform/services/electron-state.service";
|
2023-10-24 12:32:54 +02:00
|
|
|
import { I18nRendererService } from "../../platform/services/i18n.renderer.service";
|
2024-03-13 16:25:39 +01:00
|
|
|
import { fromIpcSystemTheme } from "../../platform/utils/from-ipc-system-theme";
|
2022-11-24 15:05:45 +01:00
|
|
|
import { EncryptedMessageHandlerService } from "../../services/encrypted-message-handler.service";
|
|
|
|
import { NativeMessageHandlerService } from "../../services/native-message-handler.service";
|
|
|
|
import { NativeMessagingService } from "../../services/native-messaging.service";
|
2022-04-29 09:48:44 +02:00
|
|
|
import { SearchBarService } from "../layout/search/search-bar.service";
|
|
|
|
|
2022-11-24 15:05:45 +01:00
|
|
|
import { DesktopFileDownloadService } from "./desktop-file-download.service";
|
2022-04-29 09:48:44 +02:00
|
|
|
import { InitService } from "./init.service";
|
2024-02-26 23:31:09 +01:00
|
|
|
import { RendererCryptoFunctionService } from "./renderer-crypto-function.service";
|
2022-04-29 09:48:44 +02:00
|
|
|
|
|
|
|
const RELOAD_CALLBACK = new InjectionToken<() => any>("RELOAD_CALLBACK");
|
|
|
|
|
|
|
|
@NgModule({
|
|
|
|
imports: [JslibServicesModule],
|
|
|
|
declarations: [],
|
|
|
|
providers: [
|
|
|
|
InitService,
|
|
|
|
NativeMessagingService,
|
|
|
|
SearchBarService,
|
2022-05-09 14:19:18 +02:00
|
|
|
LoginGuard,
|
2023-08-16 14:26:56 +02:00
|
|
|
DialogService,
|
2022-04-29 09:48:44 +02:00
|
|
|
{
|
|
|
|
provide: APP_INITIALIZER,
|
|
|
|
useFactory: (initService: InitService) => initService.init(),
|
|
|
|
deps: [InitService],
|
|
|
|
multi: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
provide: STATE_FACTORY,
|
|
|
|
useValue: new StateFactory(GlobalState, Account),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
provide: RELOAD_CALLBACK,
|
|
|
|
useValue: null,
|
|
|
|
},
|
2024-02-08 18:00:19 +01:00
|
|
|
{ provide: LogServiceAbstraction, useClass: ElectronLogRendererService, deps: [] },
|
2022-04-29 09:48:44 +02:00
|
|
|
{
|
|
|
|
provide: PlatformUtilsServiceAbstraction,
|
|
|
|
useClass: ElectronPlatformUtilsService,
|
2023-09-14 16:29:46 +02:00
|
|
|
deps: [I18nServiceAbstraction, MessagingServiceAbstraction],
|
2022-04-29 09:48:44 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
provide: I18nServiceAbstraction,
|
2023-10-24 12:32:54 +02:00
|
|
|
useClass: I18nRendererService,
|
2024-03-11 18:59:19 +01:00
|
|
|
deps: [SYSTEM_LANGUAGE, LOCALES_DIRECTORY, GlobalStateProvider],
|
2022-04-29 09:48:44 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
provide: MessagingServiceAbstraction,
|
|
|
|
useClass: ElectronRendererMessagingService,
|
|
|
|
deps: [BroadcasterServiceAbstraction],
|
|
|
|
},
|
2022-06-27 19:38:12 +02:00
|
|
|
{ provide: AbstractStorageService, useClass: ElectronRendererStorageService },
|
2022-04-29 09:48:44 +02:00
|
|
|
{ provide: SECURE_STORAGE, useClass: ElectronRendererSecureStorageService },
|
2022-06-27 19:38:12 +02:00
|
|
|
{ provide: MEMORY_STORAGE, useClass: MemoryStorageService },
|
2024-01-29 20:42:58 +01:00
|
|
|
{ provide: OBSERVABLE_MEMORY_STORAGE, useClass: MemoryStorageServiceForStateProviders },
|
2023-11-21 22:35:37 +01:00
|
|
|
{ provide: OBSERVABLE_DISK_STORAGE, useExisting: AbstractStorageService },
|
2022-04-29 09:48:44 +02:00
|
|
|
{
|
|
|
|
provide: SystemServiceAbstraction,
|
|
|
|
useClass: SystemService,
|
|
|
|
deps: [
|
|
|
|
MessagingServiceAbstraction,
|
|
|
|
PlatformUtilsServiceAbstraction,
|
|
|
|
RELOAD_CALLBACK,
|
|
|
|
StateServiceAbstraction,
|
2024-02-28 17:49:20 +01:00
|
|
|
AutofillSettingsServiceAbstraction,
|
[PM-194] Browser Account Switcher UI (#6772)
* Handle switch messaging
TODO: handle loading state for account switcher
* Async updates required for state
* Fallback to email for current account avatar
* Await un-awaited promises
* Remove unnecessary Prune
Prune was getting confused in browser and deleting memory in browser on
account switch. This method isn't needed since logout already removes
memory data, which is the condition for pruning
* Fix temp password in browser
* Use direct memory access until data is serializable
Safari uses a different message object extraction than firefox/chrome
and is removing `UInt8Array`s. Until all data passed into StorageService
is guaranteed serializable, we need to use direct access in state
service
* Reload badge and context menu on switch
* Gracefully switch account as they log out.
* Maintain location on account switch
* Remove unused state definitions
* Prefer null for state
undefined can be misinterpreted to indicate a value has not been set.
* Hack: structured clone in memory storage
We are currently getting dead objects on account switch due to updating
the object in the foreground state service. However, the storage service
is owned by the background. This structured clone hack ensures that all
objects stored in memory are owned by the appropriate context
* Null check nullable values
active account can be null, so we should include null safety in the
equality
* Correct background->foreground switch command
* Already providing background memory storage
* Handle connection and clipboard on switch account
* Prefer strict equal
* Ensure structuredClone is available to jsdom
This is a deficiency in jsdom --
https://github.com/jsdom/jsdom/issues/3363 -- structured clone is well
supported.
* Fixup types in faker class
* add avatar and simple navigation to header
* add options buttons
* add app-header to necessary pages
* add back button and adjust avatar sizes
* add helper text when account limit reached
* convert magic number to constant
* add clarifying comment
* adjust homepage header styles
* navigate to previousp page upon avatar click when already on '/account-switcher'
* move account UI to own component
* add i18n
* show correct auth status
* add aria-hidden to icons
* use listbox role
* add screen reader accessibility to account component
* more SR a11y updates to account component
* add hover and focus states to avatar
* refactor hover and focus states for avatar
* add screen reader text for avatar
* add slide-down animation on account switcher close
* remove comment
* setup account component story
* add all stories
* move navigation call to account component
* implement account lock
* add button hover effect
* implement account logout
* implement lockAll accounts functionality
* replace 'any' with custom type
* add account switcher button to /home login page
* use <main> tag (enables scrolling)
* change temp server filler name
* temporarily remove server arg from account story
* don't show avatar on /home if no accounts, and don't show 'lock'/'logout' buttons if no currentAccount
* add translation and a11y to /home avatar
* add correct server url to account component
* add 'server' to AccountOption type
* Enabled account switching client-side feature flag.
* add slide-in transition to /account-switcher page
* change capitalization to reflect figma design
* make screen reader read active account email, address more capitalization
* fix web avatar misalignment
* make avatar color based on user settings and in sync with other clients
* make property private
* change accountOptions to availableAccounts for clarity
* refactor to remove 'else' template ref
* remove empty scss rule
* use tailwind instead of scss
* rename isSelected to isActive
* add 'isButton' to /home page avatar
* move files to services folder
* update import
* Remove duplicate active account button
* Move no account button to current-account component
* Always complete logging out
Fixes PM-4866
* make screenreader read off email, not name
* refactor avatar for button case
* Do not next object updates
StateService's init was calling `updateState` at multiple layers,
once overall and then again for each account updated. Because
we were not maintaining a single state object through the
process, it was ending up in a consistent, but incomplete state.
Fixed by returning the updated state everywhere. This very well
may not be all the bugs associated with this
* Treat null switch account as no active user
* Listen for switchAccountFinish before routing (#6950)
* adjust avatar style when wrapped in a button
* show alt text for favicon setting
* move stories to browser
* Send Finish Message on null
* Dynamically set active user when locking all
This is required because some user lock states are not recoverable after
process reload (those with logout timeout). This waits until reload is
occurring, then sets the next user appropriately
* Move Finished Message to Finally Block
Fix tests
* Drop problematic key migration
Fixes PM-4933. This was an instance of foreground/background collision
when writing state. We have several other fallbacks of clearing
these deprecated keys.
* Prefer location to homebrew router service
* Initialize account disk cache from background
Uses the `isRecoveredSession` bool to re-initialize foreground caches
from a background message. This avoids a lengthy first-read for
foregrounds
* PM-4865 - Browser Acct Switcher - only show lock btn for lockable accounts (#6991)
* Lock of active account first, when locking multiple.
Fixes PM-4996
* Fix linter
* Hide lock now for locked users (#7020)
* Hide lock now for locked users
* Prefer disabling button to removing
* Add tooltip to TDE without unlock method
* Load all auth states on state init (#7027)
This is a temporary fix until the owning services can update state
themselves. It uses the presence of an auto key to surmise unlocked
state on init. This is safe since it's run only once on extension start.
* Ps/pm 5004/add load to account switcher (#7032)
* Add load spinner to account switcher
* Remove ul list icons
* Properly size account switcher in popout
* [PM-5005] Prevent Double Navigation (#7035)
* Delete Overriden Method
* Add Lock Transition
* truncate email and server name
* remove account.stories.ts (will add in separate PR)
* Do not switch user at reload if no user is active
* fix prettier issues
---------
Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
Co-authored-by: Todd Martin <tmartin@bitwarden.com>
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
Co-authored-by: Jared Snider <116684653+JaredSnider-Bitwarden@users.noreply.github.com>
Co-authored-by: bnagawiecki <107435978+bnagawiecki@users.noreply.github.com>
2023-12-06 18:22:48 +01:00
|
|
|
VaultTimeoutSettingsService,
|
2024-03-08 02:41:56 +01:00
|
|
|
BiometricStateService,
|
2022-04-29 09:48:44 +02:00
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
provide: StateServiceAbstraction,
|
2023-04-18 15:09:47 +02:00
|
|
|
useClass: ElectronStateService,
|
2022-04-29 09:48:44 +02:00
|
|
|
deps: [
|
2022-06-27 19:38:12 +02:00
|
|
|
AbstractStorageService,
|
2022-04-29 09:48:44 +02:00
|
|
|
SECURE_STORAGE,
|
2022-06-27 19:38:12 +02:00
|
|
|
MEMORY_STORAGE,
|
2022-04-29 09:48:44 +02:00
|
|
|
LogService,
|
|
|
|
STATE_FACTORY,
|
2023-10-19 21:41:01 +02:00
|
|
|
AccountServiceAbstraction,
|
2024-01-24 20:21:50 +01:00
|
|
|
EnvironmentService,
|
2024-02-14 14:52:13 +01:00
|
|
|
MigrationRunner,
|
2022-04-29 09:48:44 +02:00
|
|
|
STATE_SERVICE_USE_CACHE,
|
|
|
|
],
|
|
|
|
},
|
2022-06-29 23:15:29 +02:00
|
|
|
{
|
|
|
|
provide: FileDownloadService,
|
|
|
|
useClass: DesktopFileDownloadService,
|
|
|
|
},
|
2024-03-13 16:25:39 +01:00
|
|
|
{
|
|
|
|
provide: SYSTEM_THEME_OBSERVABLE,
|
|
|
|
useFactory: () => fromIpcSystemTheme(),
|
|
|
|
},
|
2022-09-23 21:47:17 +02:00
|
|
|
{
|
|
|
|
provide: EncryptedMessageHandlerService,
|
|
|
|
deps: [
|
|
|
|
StateServiceAbstraction,
|
|
|
|
AuthServiceAbstraction,
|
|
|
|
CipherServiceAbstraction,
|
|
|
|
PolicyServiceAbstraction,
|
|
|
|
MessagingServiceAbstraction,
|
|
|
|
PasswordGenerationServiceAbstraction,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
provide: NativeMessageHandlerService,
|
|
|
|
deps: [
|
|
|
|
StateServiceAbstraction,
|
|
|
|
CryptoServiceAbstraction,
|
|
|
|
CryptoFunctionServiceAbstraction,
|
|
|
|
MessagingServiceAbstraction,
|
|
|
|
I18nServiceAbstraction,
|
|
|
|
EncryptedMessageHandlerService,
|
2023-09-11 20:54:23 +02:00
|
|
|
DialogService,
|
2022-09-23 21:47:17 +02:00
|
|
|
],
|
|
|
|
},
|
2022-10-28 20:54:55 +02:00
|
|
|
{
|
|
|
|
provide: LoginServiceAbstraction,
|
|
|
|
useClass: LoginService,
|
2022-12-16 16:08:44 +01:00
|
|
|
deps: [StateServiceAbstraction],
|
2022-10-28 20:54:55 +02:00
|
|
|
},
|
2024-02-26 23:31:09 +01:00
|
|
|
{
|
|
|
|
provide: CryptoFunctionServiceAbstraction,
|
|
|
|
useClass: RendererCryptoFunctionService,
|
|
|
|
deps: [WINDOW],
|
|
|
|
},
|
2023-04-18 15:09:47 +02:00
|
|
|
{
|
|
|
|
provide: CryptoServiceAbstraction,
|
2024-02-07 16:39:54 +01:00
|
|
|
useClass: ElectronCryptoService,
|
2023-04-18 15:09:47 +02:00
|
|
|
deps: [
|
2024-02-23 14:48:15 +01:00
|
|
|
KeyGenerationServiceAbstraction,
|
2023-04-18 15:09:47 +02:00
|
|
|
CryptoFunctionServiceAbstraction,
|
|
|
|
EncryptService,
|
|
|
|
PlatformUtilsServiceAbstraction,
|
|
|
|
LogService,
|
|
|
|
StateServiceAbstraction,
|
2024-01-10 17:51:45 +01:00
|
|
|
AccountServiceAbstraction,
|
|
|
|
StateProvider,
|
2024-02-05 19:02:28 +01:00
|
|
|
BiometricStateService,
|
2023-04-18 15:09:47 +02:00
|
|
|
],
|
|
|
|
},
|
2022-04-29 09:48:44 +02:00
|
|
|
],
|
|
|
|
})
|
|
|
|
export class ServicesModule {}
|