Commit Graph

38 Commits

Author SHA1 Message Date
Bernd Schoolmann
1ad0d902b2
[Shared Unlock] [PM-35083] Add shared unlock typescript drivers and services (#20589)
* Add shared unlock TS services

* Add newline

* Small cleanup

* Fix type error

* Fix type issue

* Eslint and prettier fixes

* Cleanup

* Prevent eslint error

* Prettier

* Add tests

* Cleanup

* Fix type issue

* Cleanup

* Implement basic version of flagged biometrics ipc over sdk ipc

* Move code

* Noop ipc service

* Clean up unlock service

* Undo change to spec ts

* Rename unlock decrypted key

* Remove unused var

* Remove unused import

* Prettier

* Fix eslint

* Ensure connected

* Undo changes to electron key service

* Newline

* Newline

* Remove biometrics.ts

* Fix

* Use unlock service for unlocking on shared unlock

* Cleanup comment

* Cleanup

* Prettier and eslint cleanup

* Prettier

* Fix test

* Eslint

* Fix types

* Remove log

* Remove service

* Remove unused file

* Cleanup

* Fix DI

* Set unlock service on biometric service

* Address feedback

* Await floating promise

* Prettier

* Convert driver to class

* Relative imports

* Relative imports

* Remove unused code

* Non null assertion
2026-06-01 09:26:21 -04:00
Vijay Oommen
cdbe896d63
[PM-35058]welcome modal post scan state (#20672) 2026-05-19 11:28:27 -05:00
Alex Morask
ce9358e876
fix(billing): persist premium modal dismissal across browser restarts (#20182) 2026-05-11 09:33:42 -05:00
Brandon Treston
7c6a0bc24f
[PM-34394] Organization invite service (#20367)
* Scaffold generate invite link lib, api service WIP

* add missing properties

* refresh lock file

* revert lockfile

* lock file

* clean up lock file (used wrong node version)

* fix lock file

* implement invite link state and service

* clean up

* clean up

* fix tests
2026-04-30 12:24:18 -04:00
rr-bw
7103bbaf7e
fix(sso-required-cache): (Auth) [PM-30447] ssoRequiredCache fix (#19879)
Updates the `ssoRequiredCache` structure from `string[]` to `SsoRequiredCacheEntry[]`, which stores both the email and the webVaultUrl at the time of a successful SSO login.

This change was necessary because the previous `string[]` structure only stored email strings, but if a user used the same email to create an account on multiple different environments — where one account was required to use SSO and the other was not — then Extension and Desktop would fail to distinguish between these two accounts. Extension/Desktop would simply see that the email is in the cache, and then disable alternate login buttons any time that email was entered, regardless of environment (i.e. regardless of whether the user was truly required to use SSO.)

The new `SsoRequiredCacheEntry[]` format allows us to distinguish between accounts that have the same email, but are created on different environments and therefore might have dissimilar SSO Required policies applied.
2026-04-29 10:26:37 -07:00
cd-bitwarden
a5ef32620c
enable jest/no-alias-methods (#20187)
* enable jest/no-alias-methods

Added eslint-plugin-jest with jest/no-alias-methods rule to enforce canonical Jest assertion method names (e.g., toHaveBeenCalled instead of toBeCalled).

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* enable jest/no-alias-methods

Added eslint-plugin-jest with jest/no-alias-methods rule to enforce canonical Jest assertion method names (e.g., toHaveBeenCalled instead of toBeCalled).

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* lint fixes

* lint fixes

* removing claude file

---------

Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
2026-04-16 18:07:49 +02:00
Bernd Schoolmann
3d2e552e68
[Shared Unlock] [PM-34073] Implement vault timeout supression (#19934) 2026-04-16 09:31:36 +09:00
Ben Brooks
6d696f5dd8
[PM-8458] Change ClearClipboardDelay to strings and change default (#17756)
* [pm-8458] Change to strings and update necessary logic; change default
* [pm-8458] Draft migration
* [pm-8458] Register migration; draft tests
* [pm-8458] Import ClearClipboardDelay in settings.component.ts
* [pm-8458] Migrate null to "never" instead of "fiveMinutes"
* [pm-8458] Add migration flag to track users before clipboard default change
* [pm-8458] Add state management for notification
* [pm-8458] Add clipboard notification UI with auto-dismiss and anchor navigation
* [pm-8458] Add badge service for clipboard setting notification
* [pm-8458] Replace strings with constants in convertClearClipboardDelayToMs
* [pm-8458] Add badge on Autofill; adjust Jump button behavior
* [pm-8458] Add mock for AutofillSettingsServiceAbstraction; add tests
* [pm-8458] Update migration to limit flag to users with null value
* [pm-8458] Implement berry on Settings nav item
* [pm-8458] Replace bitLink with bitButton and update style
* [pm-8458] Update style to make badges circular; add numeric badge count to storybook
* [pm-8458] Revert badge style and storybook changes
* [pm-8458] Update migration to migrate null/Never to 5 minutes
* [pm-8458] remove stale currentValue check from notification observable
* [pm-8458] make init() async to match how it is called
* [pm-8458] use proper type instead of string for clipboard delay setting parameter
* [pm-8458] remove icon from jump-to-setting button
* [pm-8458] add unit tests for ClipboardNotificationBadgeUpdaterService
* [pm-8458] improve comment RE potential migration rollback data loss
* [pm-8458] decrease space between text and button
* [pm-33459] revert space between text and button
* [pm-8458] decrease space between text and button
* [pm-8458] remove duplicate imports

---------

Signed-off-by: Ben Brooks <bbrooks@bitwarden.com>
2026-04-10 11:38:16 -07:00
Todd Martin
63e0d07a39
chore(docs): Update state readme warning callout. 2026-04-03 16:21:23 -04:00
Jordan Aasen
6ee1f7eba5
[PM-32085] - popup width migration (#19408)
* add popup width migration

* fix width names

* add type guard for popupWidthOption
2026-03-31 12:45:09 -07:00
Daniel James Smith
d4c5f85bd7
[PM-29149] Add ServerCommunicationConfigService (#18837)
* Add state- and key-definitions for persisting serverCommunicationConfig(s)

* Add implementation of the SDK-defined ServerCommunicationConfigRepository

* Add ServerCommunicationConfigService

* Add state- and key-definitions for persisting serverCommunicationConfig(s)

* Add implementation of the SDK-defined ServerCommunicationConfigRepository

* Add ServerCommunicationConfigService

* Fix instantiation of ServerCommunicationConfigClient due to additional dependency on ServerCommunicationConfigPlatformApi

* Fix broken tests

* Fix ts-strict error

* Call setCommunicationType when ConfigService.serverCommunicationConfig$ emits (#19218)

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

* Move service instantiation to desktop's service.module

* Deleted unused tests

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2026-03-09 14:06:05 +01:00
Nick Krantz
0a1baa7e42
[PM-31060] Product Update Notification (#19027)
* add feature flag

* temp

* add ping animation with filled info icon

* add ping animation to stop after 4 goes around

* add local state for autofill-icon

* add logic to avoid new accounts

* fix closing of popover

* fix strict typings

* remove `creationDate` logic from being considered for autofill notification

* remove "now," from the autofill description

* remove height and width in the svg
2026-02-24 13:42:45 -06:00
Nick Krantz
a610ce01a2
[PM-31433] Welcome Dialog with Extension Prompt (#18849)
* add welcome prompt when extension is not installed

* add feature flag

* move prompt logic to internal service and add day prompt

* rename dialog component

* remove feature flag hardcode and add documentation

* use i18n for image alt

* move state into service

* be more explicit when the account or creation date is not available

* remove spaces

* fix types caused by introducing a numeric feature flag type

* add `typeof` for feature flag typing
2026-02-20 10:23:59 -06:00
Jordan Aasen
46a2af38a0
[PM-31974] - Vault Welcome dialog (#18960)
* premium upgrade prompt and onboarding dialog

* finalize onboard vault dialog

* vault welcome dialog no ext

* finish welcome dialog prompt

* revert changes to unified upgrade prompt service

* rename component

* rename feature flag

* add welcome dialog service

* fix tests

* fix footer position in welcome dialog

* present dialog in order

* fix tests

* fix padding
2026-02-19 09:29:54 -08:00
Bernd Schoolmann
f7a5ad712f
[PM-29208] Remove individual cryptographic-key states & migrate key service (#18164)
Some checks failed
Chromatic / Check PR run (push) Has been cancelled
Scan / Check PR run (push) Has been cancelled
Testing / Run typechecking (push) Has been cancelled
Testing / Run tests - ${{ matrix.test-group.name }} (map[artifact:jest-coverage-browser junit:junit-browser.xml name:Browser paths:apps/browser bitwarden_license/bit-browser]) (push) Has been cancelled
Testing / Run tests - ${{ matrix.test-group.name }} (map[artifact:jest-coverage-cli junit:junit-cli.xml name:CLI paths:apps/cli bitwarden_license/bit-cli]) (push) Has been cancelled
Testing / Run tests - ${{ matrix.test-group.name }} (map[artifact:jest-coverage-desktop junit:junit-desktop.xml name:Desktop paths:apps/desktop]) (push) Has been cancelled
Testing / Run tests - ${{ matrix.test-group.name }} (map[artifact:jest-coverage-libs junit:junit-libs.xml name:Libs paths:libs bitwarden_license/bit-common]) (push) Has been cancelled
Testing / Run tests - ${{ matrix.test-group.name }} (map[artifact:jest-coverage-web junit:junit-web.xml name:Web paths:apps/web bitwarden_license/bit-web]) (push) Has been cancelled
Testing / Run Rust tests on ${{ matrix.os }} (macos-14) (push) Has been cancelled
Testing / Run Rust tests on ${{ matrix.os }} (ubuntu-22.04) (push) Has been cancelled
Testing / Run Rust tests on ${{ matrix.os }} (windows-2022) (push) Has been cancelled
Testing / Rust Coverage (push) Has been cancelled
Chromatic / Chromatic (push) Has been cancelled
Scan / Checkmarx (push) Has been cancelled
Scan / Sonar (push) Has been cancelled
Testing / Upload to Codecov (push) Has been cancelled
Testing / Run tests (push) Has been cancelled
* Remove inividual user key states and migrate to account cryptographic state

* Fix browser

* Fix tests

* Clean up migration

* Remove key-pair creation from login strategy

* Add clearing for the account cryptographic state

* Add migration

* Cleanup

* Fix linting
2026-02-09 12:39:55 +01:00
Daniel James Smith
03a60a61cb
Revert "[PM-29149] Add ServerCommunicationConfigService (#18815)" (#18821)
This reverts commit f1b9408e3f.
2026-02-06 21:15:12 +00:00
Daniel James Smith
f1b9408e3f
[PM-29149] Add ServerCommunicationConfigService (#18815)
* Add state- and key-definitions for persisting serverCommunicationConfig(s)

* Add implementation of the SDK-defined ServerCommunicationConfigRepository

* Add ServerCommunicationConfigService

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2026-02-06 21:40:03 +01:00
Stephon Brown
fa45110420
[PM-29061] Remove Feature Flag 24996 (#18009)
* refactor(billing): remove FF from vault banner

* refactor(billing): remove from prompt service

* chore(billing): remove feature flag

* fix(billing): remove premium banner

* tests(billing): remove premium banner tests

* chore(vault): clean up premium banner dependencies

* fix(billing): revert formatting

* fix(billing): revert formatting

* fix(billing): remove old FF

* fix(billling): revert formatting
2026-01-07 12:19:54 -05:00
Mark Youssef
ccb9a0b8a1
[CL-132] Implement resizable side nav (#16533)
Co-authored-by: Vicki League <vleague@bitwarden.com>
2025-12-29 14:08:33 -05:00
Bernd Schoolmann
51d29f777e
[PM-24353] Drop legacy pin support (#17328)
* Drop legacy pin support

* Fix cli build

* Fix browser build

* Remove pin key

* Fix comment

* Fix CI / tests

* Add migration to remove key

* Inline export key

* Extract vault export key generation

* Cleanup

* Add migrator

* Fix mv2 build
2025-12-11 13:01:09 +01:00
Bernd Schoolmann
6e2203d6d4
[PM-18026] Implement forced, automatic KDF upgrades (#15937)
* Implement automatic kdf upgrades

* Fix kdf config not being updated

* Update legacy kdf state on master password unlock sync

* Fix cli build

* Fix

* Deduplicate prompts

* Fix dismiss time

* Fix default kdf setting

* Fix build

* Undo changes

* Fix test

* Fix prettier

* Fix test

* Update libs/angular/src/key-management/encrypted-migration/encrypted-migrations-scheduler.service.ts

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

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

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

* Update libs/angular/src/key-management/encrypted-migration/encrypted-migrations-scheduler.service.ts

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

* Only sync when there is at least one migration

* Relative imports

* Add tech debt comment

* Resolve inconsistent prefix

* Clean up

* Update docs

* Use default PBKDF2 iteratinos instead of custom threshold

* Undo type check

* Fix build

* Add comment

* Cleanup

* Cleanup

* Address component feedback

* Use isnullorwhitespace

* Fix tests

* Allow migration only on vault

* Fix tests

* Run prettier

* Fix tests

* Prevent await race condition

* Fix min and default values in kdf migration

* Run sync only when a migration was run

* Update libs/common/src/key-management/encrypted-migrator/default-encrypted-migrator.ts

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

* Fix link not being blue

* Fix later button on browser

---------

Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com>
2025-12-03 19:04:18 +01:00
Andreas Coroiu
ed2d8b9549
[PM-18046] Implement session storage (#17346)
* feat: add support for IPC client managed session storage

* feat: update SDK

* fix: using undecorated service in jslib module directly

* feat: add test case for web

* chore: document why we use any type

* fix: `ipc` too short

* typo: omg

* Revert "typo: omg"

This reverts commit 559b05eb5a.

* Revert "fix: `ipc` too short"

This reverts commit 35fc99e10b.

* fix: use camelCase
2025-11-14 08:51:38 +01:00
Brandon Treston
19626d1b3e
[PM-26363] Add one time setup dialog for auto confirm (#17104)
Some checks failed
Chromatic / Check PR run (push) Has been cancelled
Scan / Check PR run (push) Has been cancelled
Testing / Run tests (push) Has been cancelled
Testing / Run Rust tests on ${{ matrix.os }} (macos-14) (push) Has been cancelled
Testing / Run Rust tests on ${{ matrix.os }} (ubuntu-22.04) (push) Has been cancelled
Testing / Run Rust tests on ${{ matrix.os }} (windows-2022) (push) Has been cancelled
Testing / Rust Coverage (push) Has been cancelled
Chromatic / Chromatic (push) Has been cancelled
Scan / Checkmarx (push) Has been cancelled
Scan / Sonar (push) Has been cancelled
Testing / Upload to Codecov (push) Has been cancelled
* add one time setup dialog for auto confirm

* add one time setup dialog for auto confirm

* fix copy, padding, cleanup observable logic

* cleanup

* cleanup

* refactor

* clean up

* more cleanup

* Fix deleted files

This reverts commit 7c18a5e512.
2025-11-07 15:58:39 -05:00
rr-bw
5c33b2dc89
(Billing) [PM-27562] Create PremiumInterestStateService (#17139)
Creates a `PremiumInterestStateService` that manages state which conveys whether or not a user intends to setup a premium subscription. Implemented in Web only. No-op for other clients.

This will apply for users who began the registration process on https://bitwarden.com/go/start-premium/, which is a marketing page designed to streamline users who intend to setup a premium subscription after registration.
2025-11-03 14:42:21 -08:00
Will Martin
7ac6a67835
[PM-26944] phishing data checksum diffing + daily patches (#16983)
* expose local db file to extension

* fetch from local db as fallback; only fetch new data on changed checksum; fetch from cdn

* check for undefined chrome runtime (for easy Storybook mocking)

* update capital letters lint

* add audit api tests

* add bash script to fetch local db info and split it to meet FF size limits

* add readme

* Rename README.md to readme.md

* remove leftover file

* remove unused methods from audit service

* remove local db logic

* wip

* revert local db build changes

* add tests; sub to updates directly; refactor teardown logic

* fix eslint crashing

* remove temp premium override

* remove unused test

* update timer value

* run prettier

* refetch all domains on app version change

* fix log statement

* harden fetching

* filter empty domains

* fix type issue

* fix typo

* fix type error

* fix cleanup
2025-11-03 08:49:33 -06:00
Thomas Avery
fd45689745
[PM-27342] Fix state migration (#17018)
* Fix migration

* Update test
2025-10-27 09:55:31 -05:00
Thomas Avery
2d34a19b23
[PM-25287] Add AddMasterPasswordUnlockData state migration (#16202)
* Add AddMasterPasswordUnlockData state migration
2025-10-23 13:41:38 -05:00
Jason Ng
0340a881ae
[PM-20040] all tasks complete banner (#16033)
* saved WIP

* created at risk password callout service to hold state for callout data. wip

* update at-risk-password-callout to use states for tracking showing and dismissing success banner

* adding spec file for new serive

* update styles to match figma

* minor wording changes

* fix undefined lint error in at risk password callout

* moved service to libs

* added another route guard so when user clears all at risk items they are directed back to the vault page

* small cleanup in at risk callout component and at risk pw guard

* clean up code in at risk password callout component

* update state to memory

* refactor for readability at risk password callout component

* move state update logic from component to at risk password callout service

* fix: bypass router cache on back() in popout

* Revert "fix: bypass router cache on back() in popout"

This reverts commit 23f9312434.

* refactor updatePendingTasksState call

* refactor at risk password callout component and service. remove signals, implement logic through observables. Completed value for tasks utilized.

* clean up completedTasks in at risk password callout service

* add updated state value to prevent banner among diff clients

* move hasInteracted call to page component to avoid looping

* remove excess call in service

* update icon null logic in banner component

* update the callout to use a new banner

* fix classes

* updating banners in at risk password callout component

* anchor tag

* move at-risk callout to above nudges

* update `showCompletedTasksBanner$` variable naming

---------

Co-authored-by: Andreas Coroiu <andreas.coroiu@gmail.com>
Co-authored-by: Nick Krantz <nick@livefront.com>
2025-10-22 11:37:58 -05:00
Brandon Treston
3812e5d81b
[PM-26371] Add state definition for auto confirm (#16953)
* add state definition for auto confirm

* typo
2025-10-22 12:14:55 -04:00
Andreas Coroiu
2ddf1c34b2
[PM-25488] Badge stays after lock when using pin (#16436)
* wip

* feat: add dynamic states

* feat: re-implement badge service with dynamic state functions

* feat: completely remove old static states

* feat: debounce calls to badge api per tab

* feat: use group-by to avoid re-setting all tabs on 1 tab change

* feat: simplify autofill badge updater

* feat: add hanging function test

* chore: clean up badge service

* feat: simplify private updateBadge

* feat: remove unnecessary Set usage

* fix: tests that broke after setState rename

* chore: clean up badge api
2025-10-03 09:01:49 +02:00
Jared Snider
4313dd2ecb
feat(SendAccess): [Auth/PM-22661] SendTokenService + SDK Integration (#16007)
* PM-22661 - Start bringing in code from original PR

* PM-22661 - SendTokenService - implement and test hash send password

* PM-22661 - Starting to pull in SDK state to SendTokenService

* PM-22661 - WIP on default send token service

* PM-22661 - Build out TS helpers for TryGetSendAccessTokenError

* PM-22661 - WIP

* PM-22661 - Decent progress on getting _tryGetSendAccessToken wired up

* PM-22661 - Finish service implementation (TODO: test)

* PM-22661 - DefaultSendTokenService - clear expired tokens

* PM-22661 - SendTokenService - tests for tryGetSendAccessToken$

* PM-22661 - DefaultSendTokenService - more tests.

* PM-22661 - Refactor to create domain facing type for send access creds so we can internally map to SDK models instead of exposing them.

* PM-22661 - DefaultSendTokenService tests - finish testing error scenarios

* PM-22661 - SendAccessToken - add threshold to expired check to prevent tokens from expiring in flight

* PM-22661 - clean up docs and add invalidateSendAccessToken

* PM-22661 - Add SendAccessToken tests

* PM-22661 - Build out barrel files and provide send token service in jslib-services.

* PM-22661 - Improve credential validation and test the scenarios

* PM-22661 - Add handling for otp_generation_failed

* PM-22661 - npm i sdk version 0.2.0-main.298 which has send access client stuff

* PM-22661 - Bump to latest sdk changes for send access for testing.

* PM-22661 - fix comment to be accurate

* PM-22661 - DefaultSendTokenService - hashSendPassword - to fix compile time error with passing a Uint8Array to Utils.fromBufferToB64, add new overloads to Utils.fromBufferToB64 to handle ArrayBuffer and ArrayBufferView (to allow for Uint8Arrays). Then, test new scenarios to ensure feature parity with old fromBufferToB64 method.

* PM-22661 - Utils.fromBufferToB64 - remove overloads so ordering doesn't break test spies.

* PM-22661 - utils.fromBufferToB64 - re-add overloads to see effects on tests

* PM-22661 - revert utils changes as they will be done in a separate PR.

* PM-22661 - SendTokenService tests - test invalidateSendAccessToken

* PM-22661 - DefaultSendTokenService - add some storage layer tests

* PM-22661 - Per PR feedback fix comment

* PM-22661 - Per PR feedback, optimize writes to state for send access tokens with shouldUpdate.

* PM-22661 - Per PR feedback, update clear to be immutable vs delete (mutation) based.

* PM-22661 - Per PR feedback, re-add should update for clear method.

* PM-22661 - Update libs/common/src/auth/send-access/services/default-send-token.service.ts

Co-authored-by: rr-bw <102181210+rr-bw@users.noreply.github.com>

* PM-22661 - Update libs/common/src/auth/send-access/services/default-send-token.service.ts

Co-authored-by: rr-bw <102181210+rr-bw@users.noreply.github.com>

* PM-22661 - Update libs/common/src/auth/send-access/services/default-send-token.service.ts

Co-authored-by: rr-bw <102181210+rr-bw@users.noreply.github.com>

---------

Co-authored-by: rr-bw <102181210+rr-bw@users.noreply.github.com>
2025-10-02 08:55:04 -04:00
Addison Beck
b481063810
fix(basic-lib generator): Ensure all project.json files have a rootDir value (#16384)
* fix(nx): add rootDir to existing project.json files

The @nx/js:tsc executor was creating builds with a structural mismatch where TypeScript
output files lived in a nested src/ directory, but package.json pointed to non-existent
dist/ paths. This caused "Cannot find module" errors throughout the dependency chain.

This fix adds the rootDir configuration to flatten the build output structure and updates
all package.json main/types fields to match the actual file locations.

Changes applied systematically across all affected libraries:
• Added "rootDir": "libs/{name}/src" to project.json build options
• Updated package.json "main" from "dist/index.js" to "index.js"
• Updated package.json "types" from "dist/index.d.ts" to "index.d.ts"

* fix(nx-plugin): set rootDir for any newly generated libs

The basic-lib generator was creating new libraries with the same package.json path bugs
that we just fixed in existing libraries. Without this template fix, any newly generated
library would inherit the broken configuration pattern.

Updated the generator templates to include:
• Added rootDir configuration to project.json template
• Fixed package.json template paths to use flattened structure
• Corrected template syntax bug (missing space in <%= name %>)

This ensures all future libraries created with "nx generate @bitwarden/nx-plugin:basic-lib"
will have proper build configuration from the start, preventing regression of the
systematic rootDir issue.
2025-09-22 12:32:23 -04:00
rr-bw
3bbc6c564c
feat(SSO): (Auth/[PM-22110] Remove Alternate Login Options when SSO Required (#16340)
If a user is part of an org that has the `RequireSso` policy, when that user successfully logs in we add their email to a local `ssoRequiredCache` on their device. The next time this user goes to the `/login` screen on this device, we will use that cache to determine that for this email we should only show the "Use single sign-on" button and disable the alternate login buttons.

These changes are behind the flag: `PM22110_DisableAlternateLoginMethods`
2025-09-22 08:32:20 -07:00
Maciej Zieniuk
203a24723b
[PM-23243] In sync response and identity success response add MasterPasswordUnlockDataResponse in decryption options response model. (#15916)
* added master password unlock and decryption option fields into identity token connect response

* incorrect master password unlock response parsing

* use sdk

* use sdk

* better type checking on response parsing

* not using sdk

* revert of bad merge conflicts

* revert of bad merge conflicts

* master password unlock setter in state

* unit test coverage for responses processing

* master password unlock in identity user decryption options

* unit test coverage

* unit test coverage

* unit test coverage

* unit test coverage

* lint error

* set master password unlock data in state on identity response and sync response

* revert change in auth's user decryption options

* remove unnecessary cast

* better docs

* change to relative imports

* MasterPasswordUnlockData serialization issue

* explicit undefined type for `syncUserDecryption`

* incorrect identity token response tests
2025-09-05 16:13:56 +02:00
Addison Beck
5f7c0ae999
build: ensure new libraries are added to the root jest.config (#16166)
* Add missing libs to jest.config.js

Added 15 missing libraries to the jest projects array:
- libs/assets
- libs/client-type
- libs/core-test-utils
- libs/dirt/card
- libs/guid
- libs/logging
- libs/messaging-internal
- libs/messaging
- libs/serialization
- libs/state-test-utils
- libs/state
- libs/storage-core
- libs/storage-test-utils
- libs/tools/export/vault-export/vault-export-ui
- libs/user-core

This ensures all existing libraries with jest.config.js files are included in CI test runs.

* Update basic-lib generator to add new libs to jest.config.js

- Added updateJestConfig function that automatically adds new libraries to jest.config.js
- Function finds the appropriate alphabetical position for the new library
- Added comprehensive tests for the new functionality
- Ensures new libraries are included in CI test runs from creation

This prevents the issue where new libraries are created but their tests
are not run in CI because they are missing from the jest configuration.

* Fix import statements in state-definitions and deserialization-helpers tests

- Fixed ClientLocations import in state-definitions.spec.ts to use @bitwarden/storage-core instead of relative import
- Simplified deserialization-helpers.spec.ts import to use library root @bitwarden/serialization
2025-08-27 11:56:42 -04:00
Justin Baur
5f7f1d1924
Resolve state <-> state-test-utils circular dependency (#16093)
* Resolve state <-> state-test-utils circular dependency

* Fix type errors
2025-08-25 12:38:28 -04:00
Justin Baur
939fd402c3
[PM-24677] Slim StateService down so it can be moved to state lib (#16021)
* Slim StateService down so it can be moved to state lib

* Fix accidental import changes

* Add `switchAccount` assertion

* Needs to use mock
2025-08-18 12:37:25 -04: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