1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-10-28 07:49:41 +01:00
Commit Graph

330 Commits

Author SHA1 Message Date
Brandon Treston
85194fd1b5
[PM-12600] prevent verified user from deleting their account (#11665) 2024-10-25 12:46:02 -04:00
rr-bw
df8f234b9e
[PM-8111] Browser Refresh: LoginComponent (#10856)
* setup new LoginComponent files in libs/auth

* update pageTitle

* handle loading email settings

* setup web-login.service.ts

* implement web onInit

* fill out webOnInit

* refactor getOrgPolicies call

* update import

* add validateEmail logic

* handle registerRoute

* add showPasswordless flag

* handle captcha

* handle startAuthRequestLogin()

* add handleMigrateEncryptionKey to default and web service

* handle submit routing (web)

* fix typo

* incorporate loginEmailService changes

* minor updates to comments for clarity

* create a defaultOnInit()

* update defaultOnInit()

* handle master password input focus

* handle post-login routing on Browser/Desktop

* handle browser/desktop syncService

* handle browser ngOnInit

* handle browser routing and basic browser template

* setup desktop router

* add template for desktop first UI state: email entry

* rename 'response' to 'authResult'

* refactor handleMigrateEncryptionKey()

* refactor captcha methods and add return types

* refactor submit logic

* refactor submit logic further to use if statements with returns instead of if...else if...else

* remove toast error on invalid form for Browser/Desktop

* refactor to handleAuthResult() method

* refactor webOnInit

* add comment to revisit ngOnInit logic

* refactor handlCaptchaRequired()

* create a LoginSecondaryContentComponent for AnonLayout use

* minor formatting for consistency

* add clarifying comment to handleAuthResult()

* minor refactor to use destructuring

* setup desktopOnInit()

* add continue() method

* handle desktop ngOnDestroy()

* add clarifying comment regarding secondary content

* fill out desktop template and submit()

* add descriptive comment to top of HTML file

* refactor to use a uiState enum for UI states

* handle oss-routing swap

* handle registerRoute$ in secondary content

* web template modifications

* change email validation to only run on submit (or when clicking continue button)

* add dynamic anon-layout wrapper data

* remove static element ref

* desktop HTML template updates

* remove 'showPassword' property b/c now handled by bitPasswordInputToggle

* Extension: setup EmailEntry state UI

* Extension: setup MasterPasswordEntry state UI

* ensure full sync happens on all clients before navigation

* update icon stroke color

* change old components to V1

* remove 'V2' from new component

* update captcha iframe on all clients

* add browser redirect from /home to /login with FF on

* add todo comment regarding browser template

* add launchSsoBrowser to extension template

* move extension launchSsoBrowserWindow() to extension service

* cleanup & comments

* add launchSsoBrowserWindow() to default service

* setup launchSsoBrowserWindow() for Desktop

* refactor to use toastService

* remove unnecessary service injection

* rename LoginService to LoginComponentService to avoid confusion with the LoginStrategyService

* add jsdocs to LoginComponentService

* rename loginService prop to loginComponentService

* Add vault icon to anon layout.

* Prevent email address validation on blur.

* Fix comment typo.

* Prefill email field when "create account" is clicked.

* Use factory function to provide LoginEmailService.

* Add test for RegisterFormComponent.

* Remove back button todo.

* Consolidate clearing loginEmailService values and routing

* Remove unnecessary navigation.

* Fix client navigation after login.

* Consolidate login templates.

* Break up LoginComponent into client-specific services.

* Rename login.component to login-v1.component

* Rename login.component to login-v1.component

* Revert "Rename login.component to login-v1.component"

This reverts commit 9a277d6ca5.

* Revert "Rename login.component to login-v1.component"

This reverts commit 588a7af906.

* Rename login.component to login-v1.component except browser.

* Comment out debug code.

* Remove debug code.

* Rename login.component to login-v1.component for browser.

* Add login-with-passkey route to desktop.

* Set feature flag to false.

* Fix linting errors.

* Populate email on registration start form.

* Implement email population on all clients add add safeProviders.

* Remove comment re. passing email to registration.

* Add unauthUiRefreshRedirect utility function.

* Add transparent border.

* Merge main and add satisfies RouteDataProperties

* PM-8111 - Extension - AppRoutingModule - Home route now redirects conditionally based on unauthenticated ui refresh feature flag.

* PM-8111 - New Login Comp + Login Comp Svc - (1) Refactor naming and returns of getShowPasswordlessFlag to isLoginViaAuthRequestSupported (2) Replace showPasswordless with better composed variable names.

* PM-8111 - TODO cleanup

* PM-8111 - (1) Cleanup DefaultLoginComponentService (2) Sso Connector now checks client id property instead of reading it from state

* PM-8111 - Two TODO cleanups

* Remove specific client services.

* Add isLoginWithPasskeySupported function to reduce client type checking in template.

* Add styles missing from Browser to Create Account link.

* Confirmed inline form errors working and removing todo comments.

* Convert refactoring todo-rr-bw to standard todos.

* Add login component services tests.

* Cleanup formatting and remove unused provider.

* Add comment to explain call to setLoginEmail.

* Rearrange imports to fix lint error.

* Adjust styles for password hint link.

* Address PR feedback: use strict comparison.

* Ensure Login with Passkey button is shown by setting clientType.

* Update "continue" button from "submit" to "button" type.

* Ensure Passkey login available for web and desktop.

* Validate email on enter keypress.

* Use click event to trigger goToHint.

* Restructure handAuthResult to ensure we redirect to vault.

* Add await to saveEmailSettings function.

* Directly set clientType in individual login component services.

* Get clientType via service.

* Add back button.

* Remove hardcoded colors from Vault Icon

* Removing register component changes.

* Removing register component changes.

* Ensure isLoginWithPasskeySupported is only returns true for web client.

* Remove Web/Desktop comment from html template

* Update Storybook with initialLoginEmail

* Fix translation error

* Add test for unauthUiRefreshRedirect.

* Rename goAfterLogIn to evaluatePassword and borrow logic from lock component.

* Add DefaultLoginComponent tests.

* Integrate changes to translations.

* Simplify ngOnInit: remove webOnInit and move getLoginWithDevice to defaultOnInit

I couldn't find any usages of qParams.org or qParams.sponsorshipToken on QA (signing up for family membership, creating organization, manually modifying query params), so I think these are safe to remove.

* Fix translations.

* Clean up and flush out register form tests.

* Update variable name.

* Remove unused enforcedPasswordPolicyOptions property.

* Run prettier.

* Add back safeProviders for LoginEmailService

* Remove duplicate import.

* Update v1 web login title.

* Adjust overlay position of EnvironmentSelectorComponent for new layout.

Since the switcher is located at the bottom of the screen we need to position it up above the trigger button so that it is not cut off.

* Add new wave icon

* Only send email in query parameters if set.

* Remove test/debug code.

* Replace loggedEmail with this.emailFormControl.value.

* Move getLoginWithDevice call to loadEmailSettings.

* Replace loggedEmail with this.emailFormControl.value.

* Add todo comment re. inline errors.

* Remove unused setPreviousUrl function.

* Remove height / width from vault icon svg.

* Use continue method unanimously

* WIP remove validated email&  display extension back button

* Simplify getting query params

* Rework ExtensionAnonLayoutWrapperDataService to use BehaviorSubject

* Simplify validateEmail method

* Hide back button on init

* Revert "Hide back button on init"

This reverts commit e8de5e2bfc.

* Revert "Simplify validateEmail method"

This reverts commit c9141a1cb5.

* Revert "Rework ExtensionAnonLayoutWrapperDataService to use BehaviorSubject"

This reverts commit 8889ed3d3c.

* simplify validateEmail method

* Add primary / accent colors to wave icon

* Remove debug code

* PM-8111 - Tweak ShowBackButton to work

* PM-8111 - LoginCompService - finish removal of setPreviousUrl from implementations.

* PM-8111 - (1) Remove overriden default logo in anon layout (2) Update routing modules to have proper default login logo (3) LoginComp - update toggleLoginUiState to include logic to swap the icon back and forth as user navigates.

* PM-8111 - LoginComp - on UI state change from MP entry to email entry, remove subtitle (this isn't supported yet, but it will be)

* PM-8111 - LoginComp - Simplify toggleLoginUiState

* PM-8111 - LoginComponent - Add known device logic into UI state change handler

* PM-8111 - LoginComp - (1) Refactor name of getLoginWithDevice to be more accurate as getKnownDevice (2) Refactor calls to getKnownDevice to only occur if loginViaAuthRequestSupported

* PM-8111 - LoginComp - add getKnownDevice docs

* PM-8111 - LoginComponent - tweak docs

* PM-8111 - LoginComp - Continue() - remove toast as the validation on submit logic currently shows validation errors - toast is extra and not needed.

* Add isLoginViaAuthRequestSupported for DesktopLoginComponentService

* Remove validating email on init

* PM-8111 - ExtensionLoginComponentService - add tests for showBackButton

* PM-8111 - style tweaks

* PM-8111 - Extension - Refactor Overlay position to include extension default const to avoid repetition.

* PM-8111 - Desktop AppRouting Module - remove login with passkey route as it isn't supported on desktop.

* PM-8111 - Desktop - add default overlay position const

* PM-8111 - DesktopLoginCompSvc - tests were not actually testing super method calls + finish testing launchSsoBrowserWindow

* PM-8111 - Desktop Main.ts - remove dev test code

* PM-8111 - WebLoginCompSvcTests - add success test cases for getOrgPolicies

* PM-8111 - Remove duplicate translation keys

* PM-8111 - DefaultLoginComponentSvcTests - add missing test

* PM-8111 - DefaultLoginComponentServiceTests - add describes

* PM-8111 - LoginSecondaryContentComponent  - Add missing bitLink

* Update to test both browser and desktop

* Remove registration form test

* Remove aliasing CryptoFunctionService and PlatformUtilsService as abstractions

* Remove aliasing PlatformUtilsService and CryptoFunctionService as abstractions

---------

Co-authored-by: Alec Rippberger <alec@livefront.com>
Co-authored-by: Jared Snider <jsnider@bitwarden.com>
Co-authored-by: Alec Rippberger <127791530+alec-livefront@users.noreply.github.com>
Co-authored-by: Jared Snider <116684653+JaredSnider-Bitwarden@users.noreply.github.com>
2024-10-24 15:53:34 -04:00
Bernd Schoolmann
b486fcc689
[Pm-13097] Rename cryptoservice to keyservice and move it to km ownership (#11358)
* Rename cryptoservice to keyservice

* Rename cryptoservice to keyservice

* Move key service to key management ownership

* Remove accidentally added file

* Fix cli build

* Fix browser build

* Run prettier

* Fix builds

* Fix cli build

* Fix tests

* Fix incorrect renames

* Rename webauthn-login-crypto-service

* Fix build errors due to merge conflicts

* Fix linting
2024-10-24 19:41:30 +02:00
Todd Martin
ed4071c7d4
Revert [PM-11312] Add "prevent screenshot" setting (#11685)
This reverts commit 1b7bb014d2.
2024-10-24 12:06:08 -04:00
Bernd Schoolmann
74dabb97bf
Move process reload ownership to key-management (#10853) 2024-10-23 19:05:24 +02:00
Jared Snider
4b67cd24b4
Auth/PM-8112 - UI refresh - Registration Components (#11353)
* PM-8112 - Update classes of existing registration icons

* PM-8112 - Add new icons

* PM-8112 - Export icons from libs/auth

* PM-8112 - RegistrationStart - Add new user icon as page icon

* PM-8112 - Replace RegistrationCheckEmailIcon with new icon so it displays properly

* PM-8112 - RegistrationFinish - Add new icon across clients

* PM-8112 - Registration start comp - update page icon and page title on state change to match figma

* PM-8112 - RegistrationFinish - adding most of framework for changing page title & subtitle when an org invite is in state.

* PM-8112 - Add joinOrganizationName to all clients translations

* PM-8112 - RegistrationFinish - Remove default page title & subtitle and let onInit logic figure out what to set based on flows.

* PM-8112 - RegistrationStart - Fix setAnonLayoutWrapperData calls

* PM-8112 - RegistrationFinish - simplify qParams init logic to make handling loading and page title and subtitle setting easier.

* PM-8112 - Registration Link expired - move icon to page icon out of main content

* PM-8112 - RegistrationFinish - Refactor init logic further into distinct flows.

* PM-8112 - Fix icons

* PM-8112 - Extension AppRoutingModule - move sign up start & finish routes under extension anon layout

* PM-8112 - Fix storybook

* PM-8112 - Clean up unused prop

* PM-8112 - RegistrationLockAltIcon tweaks

* PM-8112 - Update icons to have proper styling

* PM-8112 - RegistrationUserAddIcon - remove unnecessary svg class

* PM-8112 - Fix icons
2024-10-16 18:28:27 -04:00
Oscar Hinton
55ee33206f
Fix log service not binding this (#11551) 2024-10-15 12:21:08 -04:00
Jared Snider
7297d0fccd
Auth/PM-13318 - AnonLayoutWrapperData Refactor to add full Translation support (#11513)
* PM-13318 - AnonLayoutWrapperData refactor to support all possible string scenarios (untranslated string, translated string, and translated string with placeholders)

* PM-13318 - Fix accidental check in

* PM-13318 - Revert the correct change.

* PM-13318 - Fix test failures
2024-10-11 16:02:47 -04:00
Daniel James Smith
005937cb4a
Replace usage of tools-password-generator with tools-credential-generator (#11464)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-10-08 14:28:05 -04:00
✨ Audrey ✨
dc1f014ad8
[PM-8282] credential generator (#11398)
* credential generator browser ui
* switch browser generate screen to extension refresh flag
* consolidate generator components into module
* add `@bitwarden/generator-components` readme
* normalize generator component rx subscriptions
2024-10-08 14:08:34 -04:00
Thomas Rittson
7c72795d1c
[PM-12747] Move CollectionService and models to AC Team (#11278) 2024-10-08 10:14:39 -04:00
Oscar Hinton
9ea9c3a932
[PM-11290] Enable SDK (#11378)
Follow up PR to #10974, flips the compile time flags to enabled and includes some debug logic to detect if users encounter issues with the WASM bundle in preparation for active consumption of the SDK.
2024-10-07 13:56:02 +02:00
Oscar Hinton
c88c5bf1ef
[PM-11766] Introduce SDK client (#10974)
Integrate the SDK into our other clients.
2024-10-07 13:20:50 +02:00
Daniel James Smith
935ae9d238
[PM-13172] Create desktop-specifc full credential-generator component (#11407)
* Create desktop-specifc full credential-generator component

* Add missing entries in en/messages.json

* Import and use conditional routing for new credential generator component

app.component: The original if, didn't make any sense as it meant that it would behave differently on the Send page vs Vault, which it doesn't, in addition to a duplicate message receiver was added in vault.component which I also removed.

Old generator for cipher add/edit is still in place and will be replaced by the vault team

* Update comment to include FIXME which is more easily searchable

* Add fixme comment for future extension

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-10-04 12:53:14 -04:00
Justin Baur
3f8f5bc1fa
[PM-7535] Remove Uses of getUserId (#10837)
* Remove Uses of `getUserId`

* Fix Test
2024-10-03 10:33:24 -04:00
Jared Snider
9ff1db7573
Auth/PM-9449 - UI Refresh + Client component consolidation into new LockV2 Component (#10451)
* PM-9449 - Init stub of new lock comp

* PM-9449 - (1) Add new lock screen title to all clients (2) Add to temp web routing module config

* PM-9449 - LockV2Comp - Building now with web HTML

* PM-9449 - Libs/Auth LockComp - bring in all desktop ts code; WIP, need to stand up LockCompService to facilitate ipc communication.

* PM-9449 - Create LockComponentService for facilitating client logic; potentially will decompose later.

* PM-9449 - Add extension lock comp service.

* PM-9449 - Libs/auth LockComp - bring in browser extension logic

* PM-9449 - Libs/auth LockComp html start

* PM-9449 - Libs/Auth LockComp - (1) Remove unused dep (2) Update setEmailAsPageSubtitle to work.

* PM-9449 - Add getBiometricsError to lock comp service for extension.

* PM-9449 - LockComp - (1) Save off client type as public comp var (2) Rename biometricLock as biometricLockSet

* PM-9449 - Work on lock comp service getAvailableUnlockOptions

* PM-9449 - WIP libs/auth LockComp

* PM-9449 - (1) Remove default lock comp svc (2) Add web lock comp svc.

* PM-9449 - UnlockOptions - replace incorrect type

* PM-9449 - DesktopLockComponentService -get most of observable based getAvailableUnlockOptions$ logic in place.

* PM-9449 - LockCompSvc - getAvailableUnlockOptions in place for all clients.

* PM-9449 - Add getBiometricsUnlockBtnText to LockCompSvc and put TODO for wiring it up later

* PM-9449 - Lock Comp - Replace all manual bools with unlock options.

* PM-9449 - Desktop Lock Comp Svc - adjust spacing

* PM-9449 - LockCompSvc - remove biometricsEnabled method

* PM-9449 - LockComp - Clean up commented out code

* PM-9449 - LockComp - webVaultHostname --> envHostName

* PM-9449 - Fix lock comp svc deps

* PM-9449 - LockComp - HTML progress

* PM-9449 - LockComp cleanup

* PM-9449 - Web Routing Module - wire up lock vs lockv2 using extension swap

* PM-9449 - Wire up loading state

* PM-9449 - LockComp - start wiring up listenForActiveUnlockOptionChanges logic with reactivity

* PM-9449 - Update desktop & extension lock comp service to use new biometrics service vs platform utils for biometrics information.

* PM-9449 - LockV2 - Swap platform util usage with toast svc

* PM-9449 - LockV2Comp - Bring over user id logic from PM-8933

* PM-9449 - LockV2Comp - Adjust everything to use activeAccount.id.

* PM-9449 - LockV2Comp - Progress on wiring up unlock option reactive stream.

* PM-9449 - LockComp ts - some refactoring and minor progress.

* PM-9449 - LockComp HTML - refactoring based on new idea to keep unlock options as separate as possible.

* PM-9449 - Add PIN translation to web

* PM-9449 - (1) Lock HTML refactor to make as independent verticals as possible (2) Refactor Lock ts (3) LockSvc - replace type with enum.

* PM-9449 - LockV2Comp - remove hardcoded await.

* PM-9449 - LockComp HTML - add todo

* PM-9449 - Web - Routing module - cleanup commented out stuff

* PM-9449 - LockV2Comp - Wire up biometrics + mild refactor.

* PM-9449 - Desktop - Wire up lockV2 redirection

* PM-9449 - LockV2 - Desktop - don't focus until unlock opts defined.

* PM-9449 - Fix accidental check in

* PM-9449 - LockV2 - loading state depends on unlock opts

* PM-9449 - LockV2 comp - remove unnecessary hr

* PM-9449 - Migrate  "yourVaultIsLockedV2" translation to desktop & browser.

* PM-9449 - LockV2 - Layout tweaks for biometrics

* PM-9449 - LockV2 - Biometric btn text

* PM-9449 - LockV2 - Wire up biometrics loading / disable state + remove unnecessary conditions around biometricsUnlockBtnText

* PM-9449 - DesktopLockSvc - Per discussion with Bernd, remove interval polling and just check once for biometric support and availability.

* PM-9449 - AuthGuard - Add todo to remove promptBiometric

* PM-9449 - LockV2 - Refactor primary and desktop init logic + misc clean up

* PM-9449 - LockV2 - Reorder init methods

* PM-9449 - LockV2 - Per discussion with Product, deprecate windows biometric settings update warning

* PM-9449 - Add TODO per discussion with Justin and remove TODO

* PM-9449 - LockV2 - Restore hide password on desktop window hidden functionality.

* PM-9449 - Clean up accomplished todo

* PM-9449 - LockV2 - Refactor func name.

* PM-9449 - LockV2 Comp - (1) TODO cleanup (2) Add browser logic to handleBiometricsUnlockEnabled

* PM-9449 - LockCompSvc changes - (1) Observability for isFido2Session (2) Adjust errors and returns per discussion with Justin

* PM-9449 - Per product, no longer need to support special fido2 case on extension.

* PM-9449 - LockCompSvc - add getPreviousUrl support

* PM-9449 - LockV2 - Continued ts cleanup

* PM-9449 - LockV2Comp - clean up unused props

* PM-9449 - LockV2Comp - Rename response to masterPasswordVerificationResponse

* PM-9449 - LockV2 - Remove unused formPromise prop

* PM-9449 - Add missing translations + update desktop to showReadonlyHostName

* PM-9449 - LockV2 - cleanup TODO

* PM-9449 - LockV2 - more cleanup

* PM-9449 - Desktop Routing Module - only allow LockV2 access if extension refresh flag is enabled.

* PM-9449 - Extension - AppRoutingModule - Add extension redirect + new lockV2 route.

* PM-9449 - Extension - AppRoutingModule - Add lockV2 to the ExtensionAnonLayoutWrapperComponent intead of the regular one.

* PM-9449 - Extension - CurrentAccountComp - add null checks as anon layout components don't have a state today. This prevents the account switcher from working on the new lockV2 comp.

* PM-9449 - Extension AppRoutingModule - LockV2 should use ExtensionAnonLayoutWrapperData

* PM-9449 - LockComp - BiometricUnlock - cancelling is a valid action.

* PM-9449 - LockV2 - Biometric autoprompt cleanup

* PM-9449 - LockV2 - (1) Add TODO for KM team (2) Fix submit logic.

* PM-9449 - Tweak TODO to add task #

* PM-9449 - Test WebLockComponentService

* PM-9449 - ExtensionLockComponentService tested

* PM-9449 - Tweak extension lock comp svc test

* PM-9449 - DesktopLockComponentService tested

* PM-9449 - Add task # to TODO

* PM-9449 - Update apps/browser/src/services/extension-lock-component.service.ts per PR feedback

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

* PM-9449 - Per PR feedback, replace from with defer for better reactive execution of promise based functions.

* PM-9449 - Per PR feedback replace enum with type.

* PM-9449 - Fix imports and tests due to key management file moves.

* PM-9449 - Another test file import fix

---------

Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
2024-10-01 16:06:18 -04:00
Bernd Schoolmann
dafe795854
Move asymmetric crypto functions out of crypto service (#10903) 2024-10-01 17:47:41 +02:00
Jared Snider
ffc97c385d
All Clients - Route data typing clean up (#11265) 2024-09-30 13:51:31 -04:00
Bernd Schoolmann
19f547e638
[PM-8836] Move ownership of biometrics to key-management (#10818)
* Move ownership of biometrics to key-management

* Move biometrics ipc ownership to km

* Move further files to km; split off preload / ipc to km

* Fix linting

* Fix linting

* Fix tests

* Fix tests

* Update .github/CODEOWNERS

Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com>

* Update .github/CODEOWNERS

Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com>

* Change ownership of native messaging to key-management

* Move biometrics to libs/key-management

* Add README to capital whitelist

* Update package-lock.json

* Move km to key-management

* Move km to key-management

* Fix build for cli

* Import fixes

* Apply prettier fix

* Fix test

* Import fixes

* Import fixes

* Update libs/key-management/README.md

Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com>

* Update libs/key-management/package.json

Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com>

* Update lock file

* Change imports to top level km package

---------

Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com>
2024-09-30 18:14:32 +02:00
Bernd Schoolmann
8fb97e7b60
Rename biometric integration description to exclude safari (#11233) 2024-09-26 10:44:10 +02:00
Bernd Schoolmann
d92b2cbea2
[PM-11477] Remove deprecated cryptoservice functions (#10854)
* Remove deprecated cryptoservice functions

* Use getUserkeyWithLegacySupport to get userkey

* Fix tests

* Fix tests

* Fix tests

* Remove unused cryptoservice instances

* Fix build

* Remove unused apiService in constructor

* Fix encryption

* Ensure passed in key is used if present

* Fix sends and folders

* Fix tests

* Remove logged key

* Fix import for account restricted keys
2024-09-24 11:28:33 +02:00
Nick Krantz
01e530d02b
[PM-11691] Remove Nord and Solarized Dark from extension (#11013)
* remove nord and solarized dark from AppearanceV2 component
- This component already behind the extension refresh feature flag

* update the users theme to system when nord or solarized dark is selected

* For desktop, still allow all theme types by overriding the default theme service.

* change theme on the fly rather than updating local state.

- When the feature flag is removed then a migration will have to take place
2024-09-19 10:55:40 -05:00
Bernd Schoolmann
1b7bb014d2
[PM-11312] Add "prevent screenshot" setting to windows and mac (#10707)
* Add screenshot protection to windows and mac

* Update messaging of screencapture prevention feature

* Set default state to false
2024-09-18 12:38:35 +02:00
rr-bw
b713e18b1a
remove duplicate route (#11034) 2024-09-13 10:46:31 -07:00
rr-bw
96d116d643
[PM-8116] Auth Browser Refresh: Password Hint Component (#10492)
* setup component, services, and web HTML

* make Web and Browser functional

* make desktop functional

* update template to solidify common client HTML

* simplify template and class

* update browser routing

* move canActivate to correct location

* simplify post submit routing

* update routing to use unauthUiRefreshSwap()

* constrain AnonLayout title/subtitle width, reduce height on destkop to account for header

* reduce height on browser to account for header (otherwise have to scroll to see EnvSelector

* resolve email issue when clicking 'cancel' on extension popout

* update routing for web

* persist email to popout

* update web router and anon-layout min-h based on client

* change anchor link to button

* remove unnecessary formatting changes

* add new icon

* remove unnecessary call to loginEmailService
2024-09-13 09:16:25 -07:00
Bernd Schoolmann
54cc35e29a
[PM-6037] Fix process reload not triggering on inactive account lock/logout (#9805)
* Send loggedOut/locked events on logout/lock event

* Revert "Send loggedOut/locked events on logout/lock event"

This reverts commit 293f2d6131.

* Ensure loggedOut is sent for non-active user logouts too

* Make loggedOut accept userIds

* Add userBeingLoggedOut in desktop app component

* Await updateconnection calls
2024-09-13 18:11:05 +02:00
Bernd Schoolmann
196729fe94
[PM-8316] Fix account switcher on vault logout timeout (#10653)
* Fix account switcher on logged out account on startup

* Undo space removal

* Add additional checks for null values

* Fix account switching on timeout on browser

* Fix linting

* Fix broken init in browser
2024-09-05 11:24:27 +02:00
Thomas Rittson
8344623185
[PM-11450] Move organization-user domain to admin-console lib (#10785)
- move organization-user files from libs/common/src/admin-console into libs/admin-console/src/common
- add barrel files and update imports to use barrel files
- rename OrganizationUserService to OrganizationUserApiService
- rename OrganizationUserServiceImplementation to DefaultOrganizationUserApiService
2024-09-04 18:21:26 -04:00
Bernd Schoolmann
3c9b3ea2cc
[PM-6296] Fix biometrics error prompt when biometrics are temporarily unavailable in browser extension (v2) (#10374)
* Create unavailable message for biometrics when in clamshell mode

* Move browser biometrics

* Inject nativemessagingbackground instead of using constructor

* Fix linting

* Fix build on browser
2024-08-27 06:25:20 +00:00
Bernd Schoolmann
86f3a679ae
[PM-4530] Fix sso in snap desktop (#10548)
* Add localhost callback service for sso

* Fix redirect behaviour

* Update apps/desktop/src/app/app.component.ts

Co-authored-by: Daniel García <dani-garcia@users.noreply.github.com>

* Fix incorrect http response for sso callback

* Add sso error

* Update error message

---------

Co-authored-by: Daniel García <dani-garcia@users.noreply.github.com>
2024-08-26 15:13:45 +02:00
Jordan Aasen
cf53646631
add alt bg to import dialog (#10643) 2024-08-22 12:18:31 +02:00
Bernd Schoolmann
127811166b
Revert "[PM-8316] Fix account switcher on logged out account on startup (#10342)" (#10498)
This reverts commit 2665afffdd.
2024-08-13 15:43:56 +02:00
Bernd Schoolmann
2665afffdd
[PM-8316] Fix account switcher on logged out account on startup (#10342)
* Fix account switcher on logged out account on startup

* Undo space removal

* Add additional checks for null values

* Fix account switching on timeout on browser
2024-08-13 11:13:04 +02:00
Justin Baur
dcb21c2685
Move lastSync State (#10272) 2024-08-06 15:01:42 -04:00
Bernd Schoolmann
2ce8500391
[PM-990] Unix biometrics unlock via Polkit (#4586)
* Update unix biometrics for desktop biometrics rework

* Implement polkit policy setup

* Enable browser integration on Linux

* Remove polkit policy file

* Undo change to messages.json

* Fix biometrics setup, implement missing functions

* Implement osSupportsBiometrics

* Fix polkit settings message

* Remove unwraps in biometrics unix rust module

* Force password reprompt on start on linux with biometrics

* Merge branch 'main' into feature/unix-biometrics

* Allow browser extension to be unlocked on Linux via Polkit

* Implement availability check

* Cleanup

* Add auto-setup, manual setup, setup detection and change localized prompts

* Implement missing methods

* Add i18n to polkit message

* Implement missing method

* Small cleanup

* Update polkit consent message

* Fix unlock and print errors on failed biometrics

* Add dependencies to core crate

* Fix reference and update polkit policy

* Remove async-trait

* Add tsdoc

* Add comment about auto setup

* Delete unused init

* Update help link

* Remove additional settings for polkit

* Add availability-check to passwords implementation on linux

* Add availability test

* Add availability check to libsecret

* Expose availability check in napi crate

* Update d.ts

* Update osSupportsBiometric check to detect libsecret presence

* Improve secret service detection

* Add client half to Linux biometrics

* Fix windows build

* Remove unencrypted key handling for biometric key

* Move rng to rust, align linux bio implementation with windows

* Consolidate elevated commands into one

* Disable snap support in linux biometrics

---------

Co-authored-by: DigitallyRefined <129616584+DigitallyRefined@users.noreply.github.com>
2024-08-06 11:04:17 -04:00
Oscar Hinton
c50a9063bc
[PM-2340] Enable use-lifecycle-interface (#5488)
Enables one of the recommended rules of @angular-eslint. Since this rule was fairly trivial to fix and has no QA effects it seemed reasonable to migrate all code.
2024-08-02 13:59:38 -04:00
Bernd Schoolmann
cc45655b86
Revert "[PM-6296] Fix biometrics error prompt when biometrics are temporarily…" (#10373)
This reverts commit 1184c504d1.
2024-08-02 07:46:54 -04:00
Bernd Schoolmann
1184c504d1
[PM-6296] Fix biometrics error prompt when biometrics are temporarily unavailable in browser extension (#9851)
* Add availability check to biometrics

* Move isbiometricunlockavailable logic to parent component

* Fix availability detection on desktop

* FIx response parsing on browser

* Suppress pending biometric message while checking for availability

* Refactor biometrics functions out of platformutilsservice

* Remove unused constructor

* Remove unused abstract function definitions

* Rename abstract services

* Add documentation

* Rename service abstraction, add comments

* Add comments

* Refactor browser biometrics into background/foreground and remove callbacks

* Remove unused logs

* Remove unused logs
2024-08-02 12:31:11 +02:00
Bernd Schoolmann
ad26f0890a
[PM-4348] Migrate AuthGuards to functions (#9595)
* Migrate auth guards

* Fix remaining auth guard migration

* Fix unauth guard usage

* Add unit tests for auth guard and unauth guard

* Remove unused angular DI code

* Move auth related logic out fo sm guard

* Add tests

* Add more tests for unauth guard

* Fix incorrect merge
2024-07-25 17:00:29 -04:00
renovate[bot]
b9eb4003a1
[deps] Autofill: Update prettier to v3.3.3 (#10228)
* [deps] Autofill: Update prettier to v3.3.3

* prettier formatting changes

* fix SyntaxError for literal @ inline html

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Prusik <jprusik@classynemesis.com>
2024-07-25 11:11:55 -04:00
Bernd Schoolmann
5cf29a655b
[PM-9149] Enable "Timeout on System Lock" on Linux Desktop (#9645)
* Enable system lock detection on linux

* Fix order of vault timeout options

* Port to new plit core / napi desktop native crates

* Make unimplemented implementation panic for on_lock

* Remove unecessary String::from

* Update cargo lock

* Extract generation of vault timeout options
2024-07-25 17:09:03 +02:00
rr-bw
9355a9bb43
[PM-7330] Create SetPasswordComponent (email verification) (#9810)
* setup SetPassword component

* accept query params

* add InputPasswordComponent to template

* add route

* add dynamic translation with org name

* feature flag route

* setup onInit

* add set password logic

* move to libs

* remove comments

* update AuthGuard routing

* use ToastService

* replace deprecated methods

* replace orgId input with policy input

* use getter for msg instead of ngOnInit

* cleanup

* refactor to use services

* more refactoring of service

* address browser routing and translations

* add desktop service

* simplify queryParam handler

* remove ngOnDestroy

* small edits

* use inject()

* add jsdocs

* create basic tests

* add success toasts on successfuly set password

* add tests

* update feature-flag

* move model to service

* refactor client services to override setPassword()

* add error handling to setPassword()

* move auto enroll logic to service

* update tests

* fix test

* adjust padding on password-callout list

* revert refactor of auto enroll logic

* refactor keyPair generation to own method

* update page title and button text

* update pageSubtitle and translations

* fix test
2024-07-25 07:42:32 -07:00
Cesar Gonzalez
974162b1a4
[PM-6426] Create TaskSchedulerService and update long lived timeouts in the extension to leverage the new service (#8566)
* [PM-6426] Create TaskSchedulerService and update usage of long lived timeouts

* [PM-6426] Implementing nextSync timeout using TaskScheduler

* [PM-6426] Implementing systemClearClipboard using TaskScheduler

* [PM-6426] Fixing race condition with setting/unsetting active alarms

* [PM-6426] Implementing clear clipboard call on generatePasswordToClipboard with the TaskSchedulerService

* [PM-6426] Implementing abortTimeout for Fido2ClientService using TaskSchedulerService

* [PM-6426] Implementing reconnect timer timeout for NotificationService using the TaskSchedulerService

* [PM-6426] Implementing reconnect timer timeout for NotificationService using the TaskSchedulerService

* [PM-6426] Implementing sessionTimeout for LoginStrategyService using TaskSchedulerService

* [PM-6426] Implementing eventUploadInterval using TaskScheduler

* [PM-6426] Adding jest tests for the base TaskSchedulerService class

* [PM-6426] Updating jest tests for GeneratePasswordToClipboardCommand

* [PM-6426] Setting up the full sync process as an interval rather than a timeout

* [PM-6426] Renaming the scheduleNextSync alarm name

* [PM-6426] Fixing dependency references in services.module.ts

* [PM-6426] Adding jest tests for added BrowserApi methods

* [PM-6426] Refactoring small detail for how we identify the clear clipboard timeout in SystemService

* [PM-6426] Ensuring that we await clearing an established scheduled task for the notification service

* [PM-6426] Changing the name of the state definition for the TaskScheduler

* [PM-6426] Implementing jest tests for the BrowserTaskSchedulerService

* [PM-6426] Implementing jest tests for the BrowserTaskSchedulerService

* [PM-6426] Adding jest tests for the base TaskSchedulerService class

* [PM-6426] Finalizing jest tests for BrowserTaskScheduler class

* [PM-6426] Finalizing documentation on BrowserTaskSchedulerService

* [PM-6426] Fixing jest test for LoginStrategyService

* [PM-6426] Implementing compatibility for the browser.alarms api

* [PM-6426] Fixing how we check for the browser alarms api

* [PM-6426] Adding jest tests to the BrowserApi implementation

* [PM-6426] Aligning the implementation with our code guidelines for Angular components

* [PM-6426] Fixing jest tests and lint errors

* [PM-6426] Moving alarms api calls out of BrowserApi and structuring them within the BrowserTaskSchedulerService

* [PM-6426] Reworking implementation to register handlers separately from the call to those handlers

* [PM-6426] Adjusting how we register the fullSync scheduled task

* [PM-6426] Implementing approach for incorporating the user UUID when setting task handlers

* [PM-6426] Attempting to re-work implementation to facilitate userId-spcific alarms

* [PM-6426] Refactoring smaller details of the implementation

* [PM-6426] Working through the details of the implementation and setting up final refinments

* [PM-6426] Fixing some issues surrounding duplicate alarms triggering

* [PM-6426] Adjusting name for generate password to clipboard command task name

* [PM-6426] Fixing generate password to clipboard command jest tests

* [PM-6426] Working through jest tests and implementing a method to guard against setting a task without having a registered callback

* [PM-6426] Working through jest tests and implementing a method to guard against setting a task without having a registered callback

* [PM-6426] Implementing methodology for having a fallback to setTimeout if the browser context is lost in some manner

* [PM-6426] Working through jest tests

* [PM-6426] Working through jest tests

* [PM-6426] Working through jest tests

* [PM-6426] Working through jest tests

* [PM-6426] Finalizing stepped setInterval implementation

* [PM-6426] Implementing Jest tests for DefaultTaskSchedulerService

* [PM-6426] Adjusting jest tests

* [PM-6426] Adjusting jest tests

* [PM-6426] Adjusting jest tests

* [PM-6426] Fixing issues identified in code review

* [PM-6426] Fixing issues identified in code review

* [PM-6426] Removing user-based alarms and fixing an issue found with setting steppedd alarm interavals

* [PM-6426] Removing user-based alarms and fixing an issue found with setting steppedd alarm interavals

* [PM-6426] Fixing issue with typing information on a test

* [PM-6426] Using the getUpperBoundDelayInMinutes method to handle setting stepped alarms and setTimeout fallbacks

* [PM-6426] Removing the potential for the TaskScheduler to be optional

* [PM-6426] Reworking implementation to leverage subscription based deregistration of alarms

* [PM-6426] Fixing jest tests

* [PM-6426] Implementing foreground and background task scheduler services to avoid duplication of task scheudlers and to have the background setup as a fallback to the poopup tasks

* [PM-6426] Implementing foreground and background task scheduler services to avoid duplication of task scheudlers and to have the background setup as a fallback to the poopup tasks

* [PM-6426] Merging main into branch

* [PM-6426] Fixing issues with the CLI Service Container implementation

* [PM-6426] Reworking swallowed promises to contain a catch statement allow us to debug potential issues with registrations of alarms

* [PM-6426] Adding jest tests to the ForegroundTaskSchedulerService and the BackgroundTaskSchedulerService

* [PM-6426] Adding jest tests to the ForegroundTaskSchedulerService and the BackgroundTaskSchedulerService

* [PM-6426] Adding jest tests to the ForegroundTaskSchedulerService and the BackgroundTaskSchedulerService

* [PM-6426] Adding jest tests to the ForegroundTaskSchedulerService and the BackgroundTaskSchedulerService

* [PM-6426] Adjusting implementation based on code review feedback

* [PM-6426] Reworking file structure

* [PM-6426] Reworking file structure

* [PM-6426] Adding comments to provide clarity on how the login strategy cache experiation state is used

* [PM-6426] Catching and logging erorrs that appear from methods that return a promise within VaultTimeoutService
2024-07-15 10:32:30 -05:00
Bernd Schoolmann
e977dacdcf
[PM-6797] Prevent account switching race condition on desktop & enable worker decryption (#9312)
* Prevent account switching race condition on desktop

This enables us to allow background thread / multithread bulk decryption on desktop.

* Disable account switcher component during switching
2024-07-11 14:11:51 +02:00
Bernd Schoolmann
7e2b4d9652
[PM-7084] 2/6: Add shared two-factor-auth orchestrator component, and TOTP two-factor component (#9768)
* Add shared two-factor-options component

* Add new refactored two-factor-auth component and totp auth componnet behind feature flag

* Fix default value for twofactorcomponentrefactor featureflag
2024-07-09 16:19:04 +02:00
Justin Baur
053e255a68
Delete Unused Bits of StateService (#9858)
* Delete Unused Bits of StateService

* Fix Tests
2024-07-08 20:38:10 -04:00
Jake Fink
052b3be2eb
[PM-7972] Account switching integration with "remember email" functionality (#9750)
* add account switching logic to login email service

* enforce boolean and fix desktop account switcher order
2024-07-03 09:53:40 -04:00
Daniel James Smith
a613d9c268
[PM-8397] Make vault timeout input standalone (#9366)
* Move vault-timeout-input to @bitwarden/auth/angular

Move vault-timeout-input.component.ts to @bitwarden/auth/angular/vault-timeout-input
Expose via barrel file
Fix imports on clients

* Add dependencies to package.json

Not necessary right now, but good practice for once we move to building each package independently

* Make VaultTimeoutInputComponent a standalone component

* Update selector to present team ownership

* Use new standalone on web

Move vault-timeout-input.component.html to @bitwarden/auth/angular/vault-timeout-input/
Delete old vault-timeout-input.component on web
Register new component on loose-components-module
Update used selector in preferences.component

* Remove unneeded export of VaultTimeoutInputComponent

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-06-28 17:41:17 +02:00
✨ Audrey ✨
1080d46aaf
[PM-9170] generator library migrations (#9812)
* migrate browser to generator libraries
* migrate cli to generator libraries
* migrate desktop to generator libraries
* migrate angular library to generator libraries
* migrate web to generator libraries
2024-06-27 12:16:04 -04:00
Daniel James Smith
8d04731633
[PM-6568][PM-8820][Tech-Debt] Migrate all tools owned toasts to use CL ToastService instead of PlatformUtilsService (#9405)
* Migrate all tools owned toasts to use CL ToastService instead of PlatformUtilsService

* Fix test that was missing a mock

* Fix double checking file and file-content selection

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-06-19 18:28:47 +02:00