1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-02-11 00:31:45 +01:00
Commit Graph

1156 Commits

Author SHA1 Message Date
Patrick-Pimentel-Bitwarden
0523ce0b40
refactor(active-user-state-refactor): [PM-12040] Remove ActiveUserStatus For SSO Login Component (#13149)
* refactor(active-user-state-refactor): [PM-12040] Remove ActiveUserState from SSO Service - First pass of work to update the state. In the middle of testing.

* fix(active-user-state-refactor): [PM-12040] Remove ActiveUserState from SSO Service - Fix for jslib-services.module.ts

* fix(active-user-state-refactor): [PM-12040] Remove ActiveUserState from SSO Service - Fix main.background.ts

* test(active-user-state-refactor): [PM-12040] Remove ActiveUserState from SSO Service - Added simple tests

* fix(active-user-state-refactor): [PM-12040] Remove ActiveUserState from SSO Service - Tiny touchups.

* fix(active-user-state-refactor): [PM-12040] Remove ActiveUserState from SSO Service - Few fixes to resolve comments.

* fix(active-user-state-refactor): [PM-12040] Remove ActiveUserState from SSO Service - Changed place where userId is loaded.

* test(active-user-state-refactor): [PM-12040] Remove ActiveUserState from SSO Service - Fixed test.
2025-02-04 13:31:36 -05:00
Daniel James Smith
2c367444ff
Group tools-owned feature flags (#13239)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2025-02-04 17:18:24 +00:00
Alex Morask
cf7a174d11
[PM-15179] Implement add-existing-organization-dialog.component (#13010)
* Implement add-existing-organization-dialog.component

* Add missing button type

* Thomas' feedback

* Import order issue
2025-02-04 09:02:12 -05:00
Andreas Coroiu
d7c46bb3a5
[PM-16231] Improved SDK referencing (#12475)
* feat: implement Rc

* feat: use Rc in sdk service

* docs: add an example to `take()`

* fix: clarify function doc

* Add custom eslint rule package with enforced `using` rule (#13009)

* feat: add custom eslint rule

* feat: check for `UsingRequired` instead of hardcoding `Rc`

* chore: move package to libs

* wip: add tests. Tests work when run from same folder but not from root

* fix: add dependencies to renovate

* fix: add empty ts file to avoid typechecking throwing errors

* fix: tests not running from root

* chore: remove unecessary config

* fix: linting

* docs: add readme

* chore: add platform ownership

* chore: clean up comment

* Add support for flat config to "Improved sdk referencing" (#13054)

* WIP flat config for eslint

* Add rxjs

* Configure vscode to use flat config

* Fix some new linting errors

* Remove directory overrides of .eslintrc

* Remove explicit dependencies on typescript-eslint/ and @angular-eslint/

* Add missing rules

* Add rxjs recommended rules

* Add storybook and enabled rxjs-angular rule

* Add buildNoRestrictedImports helper

* Ignore platform import restrictions

* Remove unused ignores

* feat: migrate rules over to .mjs and flat config

* feat: implement support for .mjs tests

* chore: remove old package approach

* chore: update package-lock

* fix: add empty TS file to stop errors

* chore: clean up comments

---------

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

* fix: update CODEOWNERS to match folder name

* fix: renovate.json after merge

* fix: package.json, pin versions, sort order

* fix: update package-lock.json

---------

Co-authored-by: Hinton <hinton@users.noreply.github.com>
2025-02-03 15:09:25 +01:00
Vincent Salucci
22edfd4283
fix: move feature flag to correct grouping, update casing, update callers, refs PM-17763 (#13184) 2025-01-31 12:18:17 -06:00
Jimmy Vo
7a1121dff4
[pm-17763] Add limitItemDeletion property to UI. (#13162) 2025-01-30 15:30:34 -05:00
Jimmy Vo
cbba1a686c
[pm-17363] Add LimitItemDeletion property to models (#13087) 2025-01-30 11:09:04 -05:00
Shane Melton
db2b405421
Fix noop notification service registration (#13131)
* Re-order the constructor dependencies to match between Noop and Default notification service

* Fix test file

* One more missed constructor
2025-01-29 12:58:01 -05:00
Tom
ab197049f5
[PM-14562] Risk insights notification feature flag (#13095)
* Risk insights notification feature flag

* Feature flag should be false
2025-01-29 10:26:54 -05:00
Ike
60e569ed9d
[PM-15605] Add new device protection opt out (#12880)
* feat(newdeviceVerificaiton) : adding component and request model

* feat(newDeviceverification) : adding state structure to track verify devices for active user; added API call to server.

* feat(newDeviceVerification) : added visual elements for opting out of new device verification.

* Fixing tests for account service.
fixed DI for account service

* Fixing strict lint issues

* debt(deauthorizeSessionsModal) : changed modal to dialog. fixed strict typing for the new dialog for deviceVerification.

* fixing tests

* fixing desktop build DI

* changed dialog to standalone fixed names and comments.

* Adding tests for AccountService

* fix linting

* PM-15605 - AccountComp - fix ngOnDestroy erroring as it was incorrectly decorated with removed property.

* PM-15605 - SetAccountVerifyDevicesDialogComponent - only show warning about turning off new device verification if user doensn't have 2FA configured per task description

---------

Co-authored-by: Jared Snider <116684653+JaredSnider-Bitwarden@users.noreply.github.com>
Co-authored-by: Jared Snider <jsnider@bitwarden.com>
2025-01-29 09:49:56 -05:00
Justin Baur
b07d6c29a4
Add Web Push Support (#11346)
* WIP: PoC with lots of terrible code with web push

* fix service worker building

* Work on WebPush Tailored to Browser

* Clean Up Web And MV2

* Fix Merge Conflicts

* Prettier

* Use Unsupported for MV2

* Add Doc Comments

* Remove Permission Button

* Fix Type Test

* Write Time In More Readable Format

* Add SignalR Logger

* `sheduleReconnect` -> `scheduleReconnect`

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

* Capture Support Context In Connector

* Remove Unneeded CSP Change

* Fix Build

* Simplify `getOrCreateSubscription`

* Add More Docs to Matrix

* Update libs/common/src/platform/notifications/internal/worker-webpush-connection.service.ts

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

* Move API Service Into Notifications Folder

* Allow Connection When Account Is Locked

* Add Comments to NotificationsService

* Only Change Support Status If Public Key Changes

* Move Service Choice Out To Method

* Use Named Constant For Disabled Notification Url

* Add Test & Cleanup

* Flatten

* Move Tests into `beforeEach` & `afterEach`

* Add Tests

* Test `distinctUntilChanged`'s Operators More

* Make Helper And Cleanup Chain

* Add Back Cast

* Add extra safety to incoming config check

* Put data through response object

* Apply TS Strict Rules

* Finish PushTechnology comment

* Use `instanceof` check

* Do Safer Worker Based Registration for MV3

* Remove TODO

* Switch to SignalR on any WebPush Error

* Fix Manifest Permissions

* Add Back `webNavigation`

* Sorry, Remove `webNavigation`

* Fixed merge conflicts.

---------

Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
Co-authored-by: Todd Martin <tmartin@bitwarden.com>
Co-authored-by: Todd Martin <106564991+trmartin4@users.noreply.github.com>
2025-01-29 08:49:01 -05:00
Nick Krantz
7c2bf504a3
[PM-11249] Sync attachment updates across platforms (#11758)
* update extension refresh form when an attachment is added or removed

- This is needed because the revision date was updated on the server and the locally stored cipher needs to match.

* receive updated cipher from delete attachment endpoint

- deleting an attachment will now alter the revision timestamp on a cipher.

* patch the cipher when an attachment is added or deleted

* migrate vault component to use the `cipherViews$` observable

* reference `cipherViews$` on desktop for vault-items

- This avoid race conditions where ciphers are cleared out in the background. `cipherViews` should always emit the latest views

* return CipherData from cipher service so that consumers have the updated cipher right away

* use the updated cipher from attachment endpoints to refresh the details within the add/edit components on desktop
2025-01-28 10:01:23 -06:00
Oscar Hinton
70ea75d8f7
[PM-17496] Migrate eslint to flat config (#12806)
The legacy config is deprecated and will be removed in eslint 10. The flat config also allows us to write js functions which will assist in handling limitations with multiple identical rules.
2025-01-28 16:40:52 +01:00
Brandon Treston
da422fd1bb
remove getUserId operator (#13091) 2025-01-27 13:17:06 -05:00
Matt Gibson
8577aae879
Test existing Login URI icon retrieval behavior (#12845) 2025-01-27 10:12:58 -05:00
Maciej Zieniuk
9d987a2513
PM-16220: Account does not exist during login race condition (#12488)
Wait for an account to become available from separate observable, instead of blindly accepting that the value is there using `firstValueFrom`, while it's sometimes not there immediately.
2025-01-27 16:11:42 +01:00
✨ Audrey ✨
1fc20b55f2
[PM-15200] add "generated credential" screen reader notification (#12877)
replaces website$ dependency with `GenerateRequest`
2025-01-24 13:44:42 -06:00
Timshel
9a5ebf94a0
Prevent parallel refreshToken calls (#10799)
Co-authored-by: Todd Martin <106564991+trmartin4@users.noreply.github.com>
Co-authored-by: Patrick-Pimentel-Bitwarden <ppimentel@bitwarden.com>
2025-01-24 14:23:22 -05:00
Alex Morask
f630ee5f4e
[PM-11730] Remove feature flag: AC-2476-deprecate-stripe-sources-api (#13032)
* Remove FF from trial-billing-step.component

* Remove FF from user-subscription.component

* Remove FF from individual-billing-routing.module

* Remove FF from organization-billing.service

* Remove FF from organization-subscription-cloud.component

* Remove FF from organization-billing-routing.mdoule

* Remove FF from organization-plans.component

* Remove FF from change-plan-dialog.component

* Remove FF

* Remove legacy payment.component

* Rename V2: adjust-payment-dialog.component

* Rename V2: adjust-storage-dialog.component

* Rename V2: payment-label.component

* Rename V2: payment.component

* Rename V2: premium.component

* Patrick's feedback
2025-01-24 13:38:44 -05:00
Jared Snider
6acaa6c711
Auth/PM-17197 - UnauthGuard Trusted Devices Lock State Refactor (#12938)
* PM-17197 - Refactor DeviceTrustService to deprecate active user state as I need to call with a user id per latest best practice

* PM-17197 - Refactor Unauth Guard to be aware of TDE lock state + use active user best practice.
2025-01-24 13:20:42 -05:00
Shane Melton
b1744c4e0a
[PM-17541] Fix folder service key definition (#13060)
* [PM-17541] Switch folder key definition back to "folders" and add migration script for users that have switched to the incorrect key

* [PM-17541] Fix import path

* [PM-17541] Fix implicit any in spec file
2025-01-24 10:12:52 -08:00
Brandon Treston
b23a41ac86
[PM-17465] refactor PolicyService.getAll$ to make userId not optional (#13031)
* refactor PolicyService.getAll$ to make userId not optional

* add fix to browser

* fix test to read from mock singleUserState

* remove nested pipes, cleanup
2025-01-24 09:58:38 -05:00
Jordan Aasen
dbb1639e72
[PM-17213] - allow changing of item owner from personal to org (#13034)
* allow changing of item owner from personal to org

* avoid unecessary api calls when updating item parent

* move comment up a line

* add localData to cipher instance
2025-01-23 15:43:42 -08:00
Matt Gibson
f9f30f8ec4
[PM-17479] Load-sdk-once (#12764)
* create service to load sdk on application init

* Eagerly load CLI SDK

* Remove wasm logging to api

* Fix imports

* Eagerly load Desktop renderer SDK

Note: If the main process ever requires an SDK, we'll need to load it there, too.
In that event, it's probably a good idea to move to IPC for all SDK functions to avoid
loading the SDK for every window.

* init wasm module from sdk load service

* Use default client factory

* Fix type imports

* Resolve jest module import errors

A CLI sdk load service that async imports our wasm binary doesn't seem to be needed to run, but jest isn't dealing with the ESM import properly.

* Fix linting

* remove example code
2025-01-23 14:34:22 -05:00
Alec Rippberger
aa1c0ca0ee
feat(auth): [PM-8221] implement device verification for unknown devices
Add device verification flow that requires users to enter an OTP when logging in from an unrecognized device. This includes:

- New device verification route and guard
- Email OTP verification component
- Authentication timeout handling

PM-8221
2025-01-23 12:57:48 -06:00
Maciej Zieniuk
abb18881b6
[PM-14445] TS strict for Key Management KDF (#13007)
* PM-14445: TS strict for Key Management KDF

* state deserializer can return null
2025-01-23 10:45:33 +01:00
Brandon Treston
a949f793ed
[PM-15506] Implement vNextOrganizationService (#12839)
* [PM-15506] Wire up vNextOrganizationService for libs/common and libs/angular (#12683)

* Wire up vNextOrganizationService in PolicyService

* Wire vNextOrganizationService in SyncService

* wire vNextOrganizationService for EventCollectionService

* wire vNextOrganizationService for KeyConnectorService

* wire up vNextOrganizationService for CipherAuthorizationService

* Wire up vNextOrganizationService in PolicyService

* Wire vNextOrganizationService in SyncService

* wire vNextOrganizationService for EventCollectionService

* wire vNextOrganizationService for KeyConnectorService

* wire up vNextOrganizationService for CipherAuthorizationService

* wire vNextOrganizationService for share.component

* wire vNextOrganizationService for collections.component

* wire vNextOrganizationServcie for add-account-credit-dialog

* wire vNextOrganizationService for vault-filter.service

* fix browser errors for vNextOrganizationService implementation in libs

* fix desktop errors for vNextOrganizationService implementation for libs

* fix linter errors

* fix CLI errors on vNextOrganizationServcie implementations for libs

* [PM-15506] Wire up vNextOrganizationService for web client (#12810)

PR to a feature branch, no need to review until this goes to main.

* implement vNextOrganization service for browser client (#12844)

PR to feature branch, no need for review yet.

* wire vNextOrganizationService for licence and some web router guards

* wire vNextOrganizationService in tests

* remove vNext notation for OrganizationService and related

* Merge branch 'main' into ac/pm-15506-vNextOrganizationService

* fix tsstrict error

* fix test, fix ts strict error
2025-01-22 15:20:25 -05:00
Nick Krantz
5c32e5020d
[PM-9111] Extension: persist add/edit form (#12236)
* remove todo

* Retrieve cache cipher for add-edit form

* user prefilled cipher for add-edit form

* add listener for clearing view cache

* clear local cache when clearing global state

* track initial value of cache for down stream logic that should only occur on non-cached values

* add feature flag for edit form persistence

* add tests for cipher form cache service

* fix optional initialValues

* add services to cipher form storybook

* fix strict types

* rename variables to be platform agnostic

* use deconstructed collectionIds variable to avoid them be overwritten

* use the originalCipherView for initial values

* add comment about signal equality

* prevent events from being emitted when adding uris to the existing form

- This stops other values from being overwrote in the initialization process

* add check for cached cipher when adding initial uris
2025-01-22 11:49:07 -05:00
Thomas Rittson
25987bc2fe
Group AC Team feature flags (#13002) 2025-01-22 14:04:37 +00:00
Andreas Coroiu
c97e937333
Fix sdk client undefined (#13003)
* feat: remove undefined from `client$`

* feat: add undefined to `userClient$`

* feat: implement TS strict for SdkService
2025-01-22 14:25:10 +01:00
Shane Melton
5e1d5bad07
[PM-14416] Risk Insights - Initial security task service (#12446)
* [PM-14416] Add initial SecurityTask models and enums

* [PM-14416] Add support for PATCH request method and 204 No Content response

* [PM-14416] Add initial task service abstraction

* [PM-14416] Add SecurityTask state/key definitions

* [PM-14416] Add DefaultTaskService implementation

* [PM-14416] Add DefaultTaskService tests

* [PM-14416] Add better null checking to new models

* [PM-14416] Improve null value filtering for task service
2025-01-21 09:50:50 -08:00
Patrick-Pimentel-Bitwarden
eb99eba284
refactor(email-verification-feature-flag): [PM-7882] Email Verificati… (#12718)
* refactor(email-verification-feature-flag): [PM-7882] Email Verification - Removed email feature flag.
2025-01-21 11:16:32 -05:00
Brandon Treston
b92a98110e
replace provider clients components with vNext implementation (#12934) 2025-01-21 09:50:58 -05:00
Jonas Hendrickx
c6a3055184
[PM-14894] Remove old sales tax rates references (#12784) 2025-01-20 16:51:57 +01:00
Jordan Aasen
457aa07aa9
return updated folder when saving a folder (#12894) 2025-01-17 09:12:54 -08:00
Oscar Hinton
e5f83ff086
[PM-17031] Create UI-common (#12831)
Extract core functionality from `libs/angular` to allow teams to depend on `libs/ui-common` instead.

Moves the following functionality to `ui-common`.
- `I18nPipe`. `libs/angular` still has an old copy but `components` depends on the new variant from `ui-common`.
- `safeProvider`, `SafeProvider` and `SafeInjectionToken`. `libs/angular`re-exports these to avoid needing to update all consumers.
2025-01-17 10:42:31 -05:00
Daniel James Smith
9eecfbc8af
[PM-17189] Remove LP fileless importer (#12918)
* Remove LP fileless importer

- Remove content scripts
- Remove additions to message handlers and notifcation queue
- Remove UI elements for the importer
- Remove the actual importer code
- Remove unsued keys from en/messages.json
Remove feature flag "browser-fileless-
import"
Update webpack.config and manifest files to no longer include content scripts

* Move feature flag idp-auto-submit-login under autofill grouping

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2025-01-17 15:56:09 +01:00
Thomas Rittson
e4e436b768
[PM-15182] Remove remove-provider-export-permission feature flag (#12878)
* Remove remove-provider-export feature flag

* Remove ts-strict comment

* Revert changes to tests
2025-01-16 13:12:29 +10:00
Merissa Weinstein
334dd4cebe
[PM-10429] remove onboarding module for the browser refresh (#12759)
* remove onboarding module

* revert package.json commit
2025-01-15 11:53:03 -06:00
✨ Audrey ✨
58bd44fa2f
replace toBeTrue() with toBe(true) (#12893) 2025-01-15 16:49:26 +00:00
✨ Audrey ✨
e79dab8689
[PM-16789] introduce extension metadata (#12717) 2025-01-15 10:47:02 -05:00
Thomas Rittson
8c13ea894b
[PM-16917] Remove jest-extended dependency (#12798)
* add toContainPartialObjects matcher (replacing toIncludeAllPartialMembers from jest-extended)
* replace jest-extended matchers with equivalent default matchers
2025-01-15 10:43:26 -05:00
Addison Beck
55e4b5ee09
fix: Use WeakMap in DerivedStateProvider to separate user state caches (#12866)
Bug fix for PM-15914 where switching users would incorrectly share cached
derived states. The `DerivedStateProvider` now uses a `WeakMap` to maintain
separate caches for each user's state `Observable`.

- Modifies `DefaultDerivedStateProvider` to use `WeakMap` for caching
- Each user's state `Observable` gets its own definition cache
- Added test to verify correct behavior during user switching
- Allows proper garbage collection of unused state caches

This fixes issues where:
- Users would see other users' cached states after switching accounts
- Derived states weren't properly isolated between users
- Cache keys didn't distinguish between different user states
2025-01-15 11:41:44 +01:00
Evan Bassler
5fb383d7dc
[PM-16248] add notification refresh feature flag (#12859)
* add notification refresh feature flag

* update order

---------

Co-authored-by: Evan Bassler <evanbassler@Mac.attlocal.net>
2025-01-14 17:10:57 -05:00
Graham Walker
8621e8aa6a
PM-16170 remove methods using deprecated send endpoints (#12751) 2025-01-14 13:16:26 -06:00
Bernd Schoolmann
318a3ac6a9
[PM-17038] Fix biometrics autoprompt in firefox and chrome (#12853)
* Fix biometrics not working in firefox or windows

* Remove logs

* Update badge after biometric unlock

* Add removal todo note

* Remove debug logging

* Fix type warnings

* Fix userkey typing in background biometrics service

* Simplify types for userkey in foreground-browser-biometrics and runtime.background.ts

* Add process reload logging

* Fix autoprompt not working when no process reload happened

* Fix instant reprompt on firefox lock

* Fix biometrics enabling error on chrome

* Update apps/browser/src/key-management/biometrics/foreground-browser-biometrics.ts

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

* FIx build & linting

---------

Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com>
2025-01-14 18:29:52 +01:00
renovate[bot]
62e879940c
[deps] SM: Update typescript-eslint monorepo to v8 (major) (#10601)
* [deps] SM: Update typescript-eslint monorepo to v8

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Hinton <hinton@users.noreply.github.com>
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2025-01-14 11:23:59 -05:00
Oscar Hinton
fbb1211a7b
[PM-17029] Convert libs/common to relative imports (#12852)
Convert absolute paths in lib/common to relative.
2025-01-14 10:11:37 -05:00
Jonathan Prusik
6d07a4932a
group client feature flags (#12849) 2025-01-14 09:33:37 -05:00
Jared Snider
1fcdf25bf7
Auth/PM-16947 - Web - Device Management - Add Manage Auth Requests support (#12809)
* PM-16947 - JsLibServices - register default DefaultLoginApprovalComponentService

* PM-16947 - DeviceResponse - add interface for DevicePendingAuthRequest

* PM-16947 - Web translations - migrate all LoginApprovalComponent translations from desktop to web

* PM-16947 - LoginApprovalComp - (1) Add loading state (2) Refactor to return proper boolean results (3) Don't create race condition by trying to respond to the close event in the dialog and re-sending responses upon approve or deny click

* PM-16947 - DeviceManagementComponent - added support for approving and denying auth requests.

* PM-16947 - LoginApprovalComp - Add validation error

* PM-16947 - LoginApprovalComponent - remove validation service for now.

* PM-16947 - Re add validation

* PM-16947 - Fix LoginApprovalComponent tests
2025-01-13 14:39:48 -05:00