1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-06 00:13:28 +00:00
Commit Graph

1705 Commits

Author SHA1 Message Date
Bernd Schoolmann
2e9a47721e Remove legacy key support in vault code (#15348) 2025-08-04 08:15:26 -07:00
Bernd Schoolmann
6bd8638ad8 [PM-24126] Move pin service to km ownership (#15821)
* Move pin service to km ownership

* Run format

* Eslint

* Fix tsconfig

* Fix imports and test

* Clean up imports

* Remove unused dependency on PinService

* Fix comments

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2025-08-04 17:01:39 +02:00
Addison Beck
361f7e3447 refactor: introduce @bitwarden/state and other common libs (#15772)
* refactor: introduce @bitwarden/serialization

* refactor: introduce @bitwarden/guid

* refactor: introduce @bitwaren/client-type

* refactor: introduce @bitwarden/core-test-utils

* refactor: introduce @bitwarden/state and @bitwarden/state-test-utils

Creates initial project structure for centralized application state management. Part of modularization effort to extract state code from common.

* Added state provider documentation to README.

* Changed callouts to Github format.

* Fixed linting on file name.

* Forced git to accept rename

---------

Co-authored-by: Todd Martin <tmartin@bitwarden.com>
2025-08-04 11:01:28 -04:00
Bernd Schoolmann
0cc473fb0f Remove legacy key support form platform code (#15351) 2025-08-01 13:06:22 -05:00
Alex Morask
18bce185f0 Fix TaxService.previewTaxAmountForOrganizationTrial return type (#15848) 2025-07-31 08:19:20 -05:00
Justin Baur
4f9b2b618f [PM-24280] Remove account service from state (#15828)
* Introduce ActiveUserAccessor

* Use ActiveUserAccessor over AccountService

* Updates tests and testing utils to support ActiveUserAccessor

* Update all injection points

* Fix types test

* Use ternary instead
2025-07-31 09:09:14 -04:00
Bernd Schoolmann
021d275c43 [PM-24079] Switch EncryptedString to SDK type (#15796)
* Update usages of sdk to type-safe SDK type

* Update sdk version

* Update to "toSdk"
2025-07-30 23:49:50 +02:00
Bernd Schoolmann
5dae5267d9 [PM-22623] Remove most TS encryption code, remove service workers (#15153)
* Add new encrypt service functions

* Undo changes

* Cleanup

* Fix build

* Fix comments

* Switch encrypt service to use SDK functions

* Move remaining functions to PureCrypto

* Tests

* Increase test coverage

* Enforce sdk.ready and drop unused codepaths

* Delete unused code

* Delete unused code

* Delete more code

* Add forgotten sdk init logic

* Fix build

* Fix cli

* Fix tests

* Fix build

* Fix browser build

* Remove compare and add more comments / warnings

* Run prettier

* Remove unused feature flags

* Add hazmat warning to aesDecrypt

* Fix build

* Fix comment

* Fix test
2025-07-30 15:50:00 +02:00
Bernd Schoolmann
a7d3c0f5c2 [PM-23809] Add simplified interface to MP service (#15631)
* Add new mp service api

* Fix tests

* Add test coverage

* Add newline

* Fix type

* Rename to "unwrapUserKeyFromMasterPasswordUnlockData"

* Fix build

* Fix build on cli

* Fix linting

* Re-sort spec

* Add tests

* Fix test and build issues

* Fix build

* Clean up

* Remove introduced function

* Clean up comments

* Fix abstract class types

* Fix comments

* Cleanup

* Cleanup

* Update libs/common/src/key-management/master-password/types/master-password.types.ts

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>

* Update libs/common/src/key-management/master-password/services/master-password.service.ts

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>

* Update libs/common/src/key-management/master-password/abstractions/master-password.service.abstraction.ts

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>

* Update libs/common/src/key-management/master-password/types/master-password.types.ts

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>

* Update libs/common/src/key-management/master-password/abstractions/master-password.service.abstraction.ts

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>

* Add comments

* Fix build

* Add arg null check

* Cleanup

* Fix build

* Fix build on browser

* Update libs/common/src/key-management/master-password/abstractions/master-password.service.abstraction.ts

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>

* Update libs/common/src/key-management/master-password/abstractions/master-password.service.abstraction.ts

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>

* Update libs/common/src/key-management/master-password/abstractions/master-password.service.abstraction.ts

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>

* Add tests for null params

* Cleanup and deprecate more functions

* Fix formatting

* Prettier

* Clean up

* Update libs/key-management/src/abstractions/key.service.ts

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>

* Make emailToSalt private and expose abstract saltForUser

* Add tests

* Add docs

* Update libs/common/src/key-management/master-password/abstractions/master-password.service.abstraction.ts

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>

* Update libs/common/src/key-management/master-password/abstractions/master-password.service.abstraction.ts

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>

---------

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>
2025-07-29 18:53:17 +02:00
adudek-bw
33ed9ac6ac [PM-19976] Implement SDK generator engines (#15063)
* Hook up sdk engines to feature flag

---------

Co-authored-by:  Audrey  <ajensen@bitwarden.com>
2025-07-28 16:52:19 -04:00
Shane Melton
b48d7d4b97 [PM-23085] Use SDK to get rotated cipher data (#15670)
* [PM-23085] Add encryptWithKey method to CipherEncryptionService

* [PM-23085] Use new encryptWithKey() SDK method in getRotatedData() based on feature flag

* [PM-23085] Rename cipher encryption method to encryptCipherForRotation to better reflect intended use case

* [PM-23085] Update @bitwarden/sdk-internal package version

* [PM-23085] Fix failing test after method rename

* [PM-23085] Fix other failing test

* [PM-23085] Typo
2025-07-28 10:36:34 -07:00
Bernd Schoolmann
edeb0f4597 Remove decrypt with key from EncString, domain-base (#15702) 2025-07-28 18:18:36 +02:00
Alex Morask
f4254ba920 [PM-21821] Provider portal takeover states (#15725)
* Updates:

- Update simple dialog to disallow user to close the dialog on acceptance
- Split payment components to provide a "require" component that cannot be closed out of
- Add provider warning service to manage the various provider warnings

* Fix test

* Will's feedback and sync on payment method success
2025-07-28 09:26:19 -05:00
Tom
b358d5663d [PM-23822] [PM-23823] Organization integration and configuration api services (#15763)
* Adding the organization integration api service and test cases

* Adding configuration api files and test cases. Fixing the id guids and integration type and event type nullable

* Adding get endpoint methods to the integration and config service and test cases

* fixing type check issues

* lowercase directory name
2025-07-25 09:43:41 -04:00
Todd Martin
b3db1b79ce chore(feature flags): [PM-19034] Remove feature flags and old components for Set/Change Password
* Removed flag and components.

* More cleanup

* Removed ChangePasswordComponent.

* Removed old EmergencyAccessTakeover

* Removed service initialization.

* Fixed test failures.

* Fixed tests.

* Test changes.

* Updated comments

* Fixed tests.

* Fixed tests.

* Fixed merge conflict.

* Removed style and routing references.

* Better comments.

* Removed ResetPasswordComponent
2025-07-24 12:46:18 -04:00
Vijay Oommen
df8e0ed094 [PM-23825] setup crowdstrike card (#15728) 2025-07-24 08:53:03 -05:00
Brandon Treston
d0d1359ff4 [PM-12048] Wire up vNextCollectionService (#14871)
* remove derived state, add cache in service. Fix ts strict errors

* cleanup

* promote vNextCollectionService

* wip

* replace callers in web WIP

* refactor tests for web

* update callers to use vNextCollectionServcie methods in CLI

* WIP make decryptMany public again, fix callers, imports

* wip cli

* wip desktop

* update callers in browser, fix tests

* remove in service cache

* cleanup

* fix test

* clean up

* address cr feedback

* remove duplicate userId

* clean up

* remove unused import

* fix vault-settings-import-nudge.service

* fix caching issue

* clean up

* refactor decryption, cleanup, update callers

* clean up

* Use in-memory statedefinition

* Ac/pm 12048 v next collection service pairing (#15239)

* Draft from pairing with Gibson

* Add todos

* Add comment

* wip

* refactor upsert

---------

Co-authored-by: Brandon <btreston@bitwarden.com>

* clean up

* fix state definitions

* fix linter error

* cleanup

* add test, fix shareReplay

* fix item-more-options component

* fix desktop build

* refactor state to account for null as an initial value, remove caching

* add proper cache, add unit test, update callers

* clean up

* fix routing when deleting collections

* cleanup

* use combineLatest

* fix ts-strict errors, fix error handling

* refactor Collection and CollectionView properties for ts-strict

* Revert "refactor Collection and CollectionView properties for ts-strict"

This reverts commit a5c63aab76.

---------

Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
2025-07-23 19:05:15 -04:00
Tom
6b76581918 Removing the notifications feature flag and logic (#15551) 2025-07-23 09:51:02 -04:00
Nick Krantz
2f47add6f1 [PM-23596] Redirect to /setup-extension (#15641)
* remove current redirection from auth code

* update timeouts of the web browser interaction

* add guard for setup-extension page

* decrease timeout to 25ms

* avoid redirection for mobile users + add tests

* add tests

* condense variables

* catch error from profile fetch

---------

Co-authored-by: Shane Melton <smelton@bitwarden.com>
2025-07-22 17:08:09 -07:00
Oscar Hinton
c37965174b Migrate platform owned abstract service to strict ts (#15734) 2025-07-22 22:00:24 +02:00
Oscar Hinton
8aeeb92958 [PM-24030] Migrate abstract services in libs/common strict TS (#15727)
Migrates the abstract classes in libs/common to be strict ts compatible. Primarily by adding abstract to every field and converting it to a function syntax instead of lambda.
2025-07-22 11:48:00 -05:00
Justin Baur
a563e6d910 Add messaging & messaging-internal libraries (#15711) 2025-07-22 11:47:25 -04:00
cyprain-okeke
96f31aac3a [PM 18701]Optional payment modal after signup (#15384)
* Implement the planservice

* Add the pricing component and service

* Add the change plan type service

* resolve the unit test issues

* Move the changeSubscriptionFrequency endpoint

* Rename planservice to plancardservice

* Remove unused and correct typos

* Resolve the double asignment

* resolve the unit test failing

* Remove default payment setting to card

* remove unnecessary check

* Property initialPaymentMethod has no initializer

* move the logic to service

* Move estimate tax to pricing service

* Refactor thr pricing summary component

* Resolve the lint unit test error

* Add changes for auto modal

* Remove custom role for sm

* Resolve the blank member page issue

* Changes on the pricing display
2025-07-22 15:58:17 +01:00
✨ Audrey ✨
5290e0a63b [PM-19054] configure send with email otp authentication via cli (#15360) 2025-07-22 09:33:34 -04:00
Shane Melton
2a07b952ef [PM-24000] Convert string date values to Date objects for CipherExport types (#15715) 2025-07-22 09:32:00 -04:00
Bernd Schoolmann
481910b823 Fix breaking sdk change and update to 231 (#15617) 2025-07-22 13:03:04 +02:00
Bernd Schoolmann
b54944da41 Deprecate encstring's decrypt function (#15703) 2025-07-22 12:35:55 +02:00
Shane Melton
391f540d1f [PM-22136] Implement SDK cipher encryption (#15337)
* [PM-22136] Update sdk cipher view map to support uknown uuid type

* [PM-22136] Add key to CipherView for copying to SdkCipherView for encryption

* [PM-22136] Add fromSdk* helpers to Cipher domain objects

* [PM-22136] Add toSdk* helpers to Cipher View objects

* [PM-22136] Add encrypt() to cipher encryption service

* [PM-22136] Add feature flag

* [PM-22136] Use new SDK encrypt method when feature flag is enabled

* [PM-22136] Filter out null/empty URIs

* [PM-22136] Change default value for cipher view arrays to []. See ADR-0014.

* [PM-22136] Keep encrypted key value on attachment so that it is passed to the SDK

* [PM-22136] Keep encrypted key value on CipherView so that it is passed to the SDK during encryption

* [PM-22136] Update failing attachment test

* [PM-22136] Update failing importer tests due to new default value for arrays

* [PM-22136] Update CipherView.fromJson to handle the prototype of EncString for the cipher key

* [PM-22136] Add tickets for followup work

* [PM-22136] Use new set_fido2_credentials SDK method instead

* [PM-22136] Fix missing prototype when decrypting Fido2Credentials

* [PM-22136] Fix test after sdk change

* [PM-22136] Update @bitwarden/sdk-internal version

* [PM-22136] Fix some strict typing errors

* [PM-23348] Migrate move cipher to org to SDK (#15567)

* [PM-23348] Add moveToOrganization method to cipher-encryption.service.ts

* [PM-23348] Use cipherEncryptionService.moveToOrganization in cipherService shareWithServer and shareManyWithServer methods

* [PM-23348] Update cipherFormService to use the shareWithServer() method instead of encrypt()

* [PM-23348] Fix typo

* [PM-23348] Add missing docs

* [PM-22136] Fix EncString import after merge with main
2025-07-21 23:27:01 -07:00
Bernd Schoolmann
8b5e6adc37 [PM-21378] Switch encrypt service to use SDK functions (#14538)
* Add new encrypt service functions

* Undo changes

* Cleanup

* Fix build

* Fix comments

* Switch encrypt service to use SDK functions

* Move remaining functions to PureCrypto

* Tests

* Increase test coverage

* Enforce sdk.ready and drop unused codepaths

* Delete unused code

* Add forgotten sdk init logic

* Fix build error

* Fix browser extension failing to unlock after process reload due to outdated usage of decryptString

* Fix send encryption

* Fix client key half decryption being stuck

* Attempt to fix sharereplay

* Fix build

* Fix type / add filter / add distinctuntilchange

* Fix capitalization
2025-07-21 15:52:38 +02:00
Brandon Treston
92bbe0a3c2 [PM-22100] Enforce restrictions based on collection type (#15336)
* enforce restrictions based on collection type, set default collection type

* fix ts strict errors

* fix default collection enforcement in vault header

* enforce default collection restrictions in vault collection row

* enforce default collection restrictions in AC vault header

* enforce default collection restriction for select all

* fix ts strict error

* switch to signal, fix feature flag

* fix story

* clean up

* remove feature flag, move check for defaultCollecion to CollecitonView

* fix test

* remove unused configService

* fix test: coerce null to undefined for collection Id

* clean up leaky abstraction for default collection

* fix ts-strict error

* fix parens

* rename defaultCollection getter

* clean up
2025-07-18 10:53:12 -04:00
Nick Krantz
b4120e0e3f [PM-22134] Migrate list views to CipherListView from the SDK (#15174)
* add `CipherViewLike` and utilities to handle `CipherView` and `CipherViewLike`

* migrate libs needed for web vault to support `CipherViewLike`

* migrate web vault components to support

* add  for CipherView.  will have to be later

* fetch full CipherView for copying a password

* have only the cipher service utilize SDK migration flag

- This keeps feature flag logic away from the component
- Also cuts down on what is needed for other platforms

* strongly type CipherView for AC vault

- Probably temporary before migration of the AC vault to `CipherListView` SDK

* fix build icon tests by being more gracious with the uri structure

* migrate desktop components to CipherListViews$

* consume card from sdk

* add browser implementation for `CipherListView`

* update copy message for single copiable items

* refactor `getCipherViewLikeLogin` to `getLogin`

* refactor `getCipherViewLikeCard` to `getCard`

* add `hasFido2Credentials` helper

* add decryption failure to cipher like utils

* add todo with ticket

* fix decryption failure typing

* fix copy card messages

* fix addition of organizations and collections for `PopupCipherViewLike`

- accessors were being lost

* refactor to getters to fix re-rendering bug

* fix decryption failure helper

* fix sorting functions for `CipherViewLike`

* formatting

* add `CipherViewLikeUtils` tests

* refactor "copiable" to "copyable" to match SDK

* use `hasOldAttachments` from cipherlistview

* fix typing

* update SDK version

* add feature flag for cipher list view work

* use `CipherViewLikeUtils` for copyable values rather than referring to the cipher directly

* update restricted item type to support CipherViewLike

* add cipher support to `CipherViewLikeUtils`

* update `isCipherListView` check

* refactor CipherLike to a separate type

* refactor `getFullCipherView` into the cipher service

* add optional chaining for `uriChecksum`

* set empty array for decrypted CipherListView

* migrate nudge service to use `cipherListViews`

* update web vault to not depend on `cipherViews$`

* update popup list filters to use `CipherListView`

* fix storybook

* fix tests

* accept undefined as a MY VAULT filter value for cipher list views

* use `LoginUriView` for uri logic (#15530)

* filter out null ciphers from the `_allDecryptedCiphers$` (#15539)

* use `launchUri` to avoid any unexpected behavior in URIs - this appends `http://` when missing
2025-07-17 14:55:32 -05:00
Alec Rippberger
00b6b0224e feat(extension-login-approvals): [Auth/PM-14939] devices list view for browser (#14620)
Creates a new `DeviceManagementComponent` that fetches devices and formats them before handing them off to a view component for display.

View components:

- `DeviceManagementTableComponent` - displays on medium to large screens
- `DeviceManagementItemGroupComponent` - displays on small screens

Feature flag: `PM14938_BrowserExtensionLoginApproval`
2025-07-17 10:43:49 -07:00
Oscar Hinton
67d3035aa5 [PM-22544] Add Performance measurement tools (#15475)
Adds logService.mark and logService.measure which are wrappers around performance.mark and performance.measure with extra debug logging for more visibility outside the performance tool.
2025-07-17 15:03:57 +02:00
rr-bw
682503e2bd docs(authStatus): [Auth/PM-22699] [BEEEP] Document AuthenticationStatus (#15197)
Add documentation to `AuthenticationStatus`
2025-07-16 16:58:19 -07:00
SmithThe4th
4b7dd3dcb8 Add filter to wait for user key availabilty before decrypting folders (#15645) 2025-07-16 22:12:05 +00:00
Rui Tomé
aa8505128f [PM-20167] Refactor: Remove SeparateCustomRolePermissions feature flag and flagged logic (#15628) 2025-07-16 16:36:34 +01:00
Bernd Schoolmann
60855c734f [PM-17666] Move Encstring to KM ownership (#15457)
* Move Encstring to KM ownership

* Fix wrong import

* Fix build

* Fix remaining imports

* Fix tests
2025-07-16 11:15:24 -04:00
Todd Martin
97ec9a6339 fix(SignalR): Revert "[PM-23062] Fix extra signalr connections"
This reverts commit ec7a2613cc.
2025-07-15 17:25:45 -04:00
SmithThe4th
6cb6316afd Handle string, enc string (split is not a function) errors during browser extension deserialization (#15586) 2025-07-15 17:21:15 -04:00
Colton Hurst
d545912b67 [PM-22783] Add Feature Flag, Settings Toggle, and Services for Autotype MVP (#15262)
* [PM-22783] Add initial feature flag and settings toggle for autotype MVP

* [PM-22783] Undo Cargo.lock changes

* [PM-22783] Disable console.log block

* [PM-22783] Lint fix

* [PM-22783] Small updates

* [PM-22783] Build fix

* [PM-22783] Use combineLatest in updating the desktop autotype service

* [PM-22783] Check if the user is on Windows

* [PM-22783] Undo access selector html change, linting keeps removing this

* [PM-22783] Fix failing test

* [PM-22783] Update autotypeEnabled to be stored in service

* [PM-22783] Add todo comments

* [PM-22783] Add SlimConfigService and MainDesktopAutotypeService

* [PM-22783] Small fixes
2025-07-15 11:49:15 -04:00
Thomas Avery
4412dbb502 [PM-21883] Add back RemoveUnlockWithPin exemption (#15223) 2025-07-15 09:58:32 -05:00
Maciej Zieniuk
c6fd7b65e6 Feature flag for ForceUpdateKDFSettings (#15618) 2025-07-15 16:11:44 +02:00
Bernd Schoolmann
d1f0c40e2f [PM-23386] Fix fix usages of encrypt service (#15476)
* Fix incorrect usages of encrypt service

* Add docs

* Fix types
2025-07-15 11:56:19 +02:00
Bernd Schoolmann
8250e40c6c [PM-22271] Switch to SDK argon2 implementation, and drop other impls (#15401)
* Switch to SDK argon2 implementation

* Cleanup and update to the latest sdk

* Update package lock

* Remove copy patch

* Fix builds

* Fix test build

* Remove error

* Fix tests

* Fix build

* Run prettier

* Remove argon2 references

* Regenerate index.d.ts for desktop_native napi

* Replace mocked crypto function service type
2025-07-15 11:53:58 +02:00
Brandon Treston
4f84d6b0f6 fix bulk restore for unassigned items (#15533) 2025-07-14 15:50:13 -04:00
Justin Baur
ec7a2613cc [PM-23062] Fix extra signalr connections (#15432)
* Add `globalEnvironment$` property to `EnvironmentService`

* Update `ConfigService` to emit less and have higher quality fallbacks when no user config is available

* Remove debug code

* Fix strict null problems
2025-07-14 09:11:56 -04:00
Jared Snider
c9f642e491 feat(new SendPasswordService): [Auth/PM-23700] Create KM SendPasswordService (#15570)
* PM-23700 - SendPasswordService - create and test

* PM-23700 - SendPassword Service comment clean up

* PM-23700 - Use barrel file exports and register default service.

* PM-23700 - DefaultSendPasswordService - work with Bernd to deliver better service
2025-07-11 13:05:31 -04:00
SmithThe4th
3c6f763233 [PM-23306] "Show cards in autofill" is defaulting to on when the setting is enabled (#15534)
* disable card autofill

* Fixed dependency issues
2025-07-11 12:50:31 -04:00
Jason Ng
bf50160a47 [PM-19562] remove flag pm-18520-desktop-cipher-forms (#15524)
* removing the desktop flag and replacing the route in desktop app routing. removing code from old desktop
2025-07-10 15:30:23 -04:00
Todd Martin
c5be837b51 chore(feature-flag) [PM-22604] Remove 2FA persistence feature flag
* Removed flag.

* Fixed tests to no longer reference flag.

* Fixed test.

* Removed duplicate test class.

* Moved files into folders for yubikey and authenticator

* Removed TwoFactorAuthEmailComponentService since it is no longer needed

* Removed export

* Fixed export
2025-07-10 15:00:49 -04:00