Updates the `ChangePasswordService` (`changePassword()` and `changePasswordForAccountRecovery()`) to use the new KM data types :
- `MasterPasswordAuthenticationData`
- `MasterPasswordUnlockData`
This allows us to move away from the deprecated `makeMasterKey()` method (which takes email as salt) as we seek to eventually separate the email from the salt.
Also moves current password validation into the default and web change password services.
Behind feature flag: `pm-27086-update-authentication-apis-for-input-password`
* Refactor user self-revocation message in event service and update localization string. The message now provides a clearer context for the action taken by the user.
* Update user self-revocation message in event service and add corresponding localization string. The new message enhances clarity regarding the user's action of declining organization ownership transfer.
* Update user self-revocation message to include user ID placeholder for improved clarity in localization. This change enhances the context of the user's action when self-revoking from an organization.
* [PM-31696] Add reverse proxy emulator for load balancer cookie testing
Adds a local dev/QA tool that emulates AWS ELB authentication without
real AWS infrastructure. It gates all traffic behind a
BitwardenLoadBalancerCookie and serves a simple auth page to issue it,
enabling testing of the load balancer cookie bootstrap flow (PM-27124).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* [PM-31696] Replace http-proxy with Node.js built-ins
http-proxy has not been published in 6 years and uses the deprecated
util._extend API. Replace it with https.request + piping for HTTP and
tls.connect + socket piping for WebSocket, removing the dependency and
the --no-deprecation workaround entirely.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* [PM-31696] Fix TLS verification for public backends
Extend the default CA bundle with the self-signed cert instead of
replacing it, so both localhost dev servers and public backends
(e.g. vault.bitwarden.com) are trusted without --insecure.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* [PM-31696] Add cookie rotation via R keypress
Press R while the proxy is running to increment the cookie generation,
immediately invalidating all existing session cookies and forcing
clients to re-authenticate on their next request.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* docs: tweak docs
* feat: improve error messages
* docs: update readme
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* Fix bug causing ciphers not to load under certain circumstances.
* Don't set admin flag for non-admin cipher attachment operations
* Use the same flag for getCipherAdmin as for calling Admin API
* Set 'edit' flag on admin
* [PM-27772] Add TrendWidget component with Chart.js implementation (#19078)
Add reusable TrendWidget component with Chart.js line chart for displaying risk trends over time in Access Intelligence.
- Configurable datetime/linear x-axis scales
- Theme-aware colors from design system (brand-700/400, gray-200/600)
- Full i18n support (10 new translation keys)
- Loading spinner and error state handling
- Proper Chart.js lifecycle management
* [PM-28530] Implement period selector UI component (#19162)
* feat(dirt): define TimePeriod type for risk-over-time period selector
Add const object type for 5 time periods (month, 3mo, 6mo, 12mo, all)
following ADR-0025 no-enum pattern. Includes PeriodOption interface
and PERIOD_OPTIONS config for rendering.
[PM-28530]
* feat(dirt): create PeriodSelectorComponent using bit-menu
Custom trigger button with bit-menu dropdown for risk-over-time
time period selection. No clear button, neutral styling matching
Figma design. Check icon marks current selection.
[PM-28530]
* feat(dirt): add barrel export for period selector
[PM-28530]
* feat(dirt): add i18n strings for period selector options
Add translation keys for time period labels: pastMonth, last3Months,
last6Months, last12Months, and timePeriod placeholder.
[PM-28530]
* feat(dirt): add Storybook stories for PeriodSelectorComponent
Stories for default state, pre-selected 3 months, and disabled state.
[PM-28530]
* test(dirt): add unit tests for PeriodSelectorComponent
Tests cover default state, period options with pre-translated labels,
selection changes, and selected label reactivity.
[PM-28530]
* feat(dirt): integrate PeriodSelector into TrendWidget component
Replace placeholder with dirt-period-selector dropdown. Add TimePeriod
to TrendWidgetTimespan mapping layer to bridge the two type systems.
Remove standalone Storybook story and disabled input per review feedback
— component now lives inside TrendWidget, not standalone.
[PM-28530]
* refactor(dirt): replace model() with signal() + output() for PeriodSelector
Switch from Angular's model() API to the signal() + output() pattern
used throughout the Access Intelligence module. This matches the
existing convention in TrendWidget (selectedTimespan/timespanChanged),
app-table-row-scrollable (checkboxChange/selectAllChange), and
review-applications-view (onToggleSelection/onToggleAll).
Changes:
- Replace model<TimePeriod>() with signal<TimePeriod>() for internal state
- Add explicit selectedPeriodChange output for parent notification
- Manual .emit() in selectPeriod() to match module convention
- Update test to verify output emission via subscribe spy
No functional change — both patterns emit selectedPeriodChange events.
The template binding (selectedPeriodChange)="..." is unchanged.
* refactor(dirt): update labels to match Figma and unify type system
Update period selector labels per Figma design:
- "Last 3 months" → "Past 3 months" (past3Months)
- "Last 6 months" → "Past 6 months" (past6Months)
- "Last 12 months" → "Past year" (pastYear)
- "All" → "All time" (allTime, new key — pre-existing "all" key untouched)
Rename TimePeriod const keys to match labels:
- Last3Months → Past3Months
- Last6Months → Past6Months
- Last12Months → PastYear
- All → AllTime
Wire values unchanged ("month", "3mo", "6mo", "12mo", "all") to
preserve server API compatibility.
Remove TrendWidgetTimespan entirely — TrendWidget now uses TimePeriod
directly for signals, outputs, and data model. Eliminates the temporary
mapping layer (timePeriodMap + onPeriodSelectorChange). Period selector
wires directly to onTimespanChange().
[PM-28530]
* [PM-28533] Add view selector to TrendWidget component (#19163)
Adds the view selector button group to the TrendWidget component. Hooks up to existing signal and emits events when the view mode is changed. In future development, the parent component of TrendWidget will need to handle these events to fetch updated chart data from the API.
View options are:
Applications
Passwords
Members
* Fix TimePeriod type errors in TrendWidget stories (#19239)
Replace invalid "past-month" string literals with TimePeriod.PastMonth
constant to match the TimePeriod type definition. The TimePeriod const
object uses "month" as the value for PastMonth, not "past-month".
* [PM-32056] Add feature flag for access intelligence trend chart (#19164)
* feat(dirt): add feature flag for access intelligence trend chart
Register the `pm-26961-access-intelligence-trend-chart` feature flag
to gate the upcoming TrendChart widget in the Activity tab. Default
is FALSE (disabled). PM-32057 will consume this flag when wiring up
the widget component.
[PM-32056]
* feat(dirt): read trend chart feature flag in activity component
Inject ConfigService into AllActivityComponent and read the
AccessIntelligenceTrendChart flag on init. This prepares the
component for the TrendChart widget to be conditionally rendered.
[PM-32056]
* feat(dirt): add conditional wrapper for trend chart widget
Add an @if block gated by the AccessIntelligenceTrendChart feature
flag in the Activity tab template. The TrendChart widget will be
placed inside this block when wired up.
[PM-32056]
* reset package files to main
* install chartjs using node v22
* add chartjs to dirt team deps (#19244)
* [PM-32055] Download TrendWidget chart to PNG and CSV (#19245)
This PR adds a download button to the TrendWidget component that supports downloading the "Risk over time" chart data as a PNG or in CSV format.
Logic to dynamically add a chart title and x/y axis labels is included. This required creating a service that recreates a copy of the chart with title and axis labels applied, in an off screen canvas element, and then exporting to blob for file download. This logic is owned by the ChartExportService.
* Fix readonly variables. Update chart variable to use signal
* Fix any type in test file
---------
Co-authored-by: Brad <44413459+lastbestdev@users.noreply.github.com>
Co-authored-by: Alex <55413326+AlexRubik@users.noreply.github.com>
Co-authored-by: Brad Deibert <bdeibert@bitwarden.com>
* feat(platform): extract vaultUrl from /api/config response
Updates DefaultConfigService to extract the vault URL from the server's
/api/config response and populate it in the ServerCommunicationConfig that
gets passed to the SDK.
The vaultUrl field is extracted from response.environment.vault using
optional chaining to safely handle cases where the environment field may
be undefined. This follows the TypeScript camelCase naming convention and
integrates with the SDK's vault_url parameter added in the previous SDK
commits.
This enables the SDK to receive an explicit vault URL for SSO cookie
acquisition redirects, which fixes two critical issues:
1. Port preservation: Prevents localhost:8000 being stripped to localhost
in local development environments
2. Multi-subdomain routing: Ensures redirects use vault.bitwarden.com
instead of api.bitwarden.com when the cookie domain differs from the
vault hostname
The TypeScript interface definition will be added in the next commit to
complete type safety.
Refs: PM-33352
* fix(platform): add vaultUrl parameter to noop acquireCookies
Updates the NoopServerCommunicationConfigPlatformApiService implementation
to match the SDK's ServerCommunicationConfigPlatformApi trait interface
change from SDK PR #832.
The SDK's acquire_cookies() method now requires both hostname and
vault_url parameters. This commit adds the vaultUrl parameter to the
noop implementation's method signature to maintain TypeScript type
compatibility.
The noop service remains a no-op - it continues to return undefined
but now accepts the additional parameter that the SDK interface expects.
This prevents TypeScript compilation errors when the clients repo updates
to SDK version 0.2.0-main.580 or later.
Refs: PM-33352
* feat: update sdk
* fix: add missing vault_url to tests
* review: guard ssoCookieVendor on vaultUrl
Passing undefined for vaultUrl into the SDK's Rust
SsoCookieVendorConfig struct causes a panic at the WASM
boundary. Extract vaultUrl into a local variable and add a
null guard so that configs missing a vault URL fall back to
{ bootstrap: { type: "direct" } } instead of reaching the
SDK with an incomplete struct.
Update the existing ssoCookieVendor test to assert vaultUrl
in the expected output, and add a new case verifying the
direct fallback when environment is absent.
---------
Co-authored-by: Andreas Coroiu <andreas.coroiu@gmail.com>
This happens because state returns hot observables. There is no guarantee for access token to be present when read, even though it was just written with `await firstValueFrom`. Causes sync to think the auth status for the user is logged out, even though that's false
Updates import statements in autofill-related files to use direct imports
instead of re-exported paths. This prepares for removal of re-exporting
files in a follow-up PR.
Part of PM-33381
Updates import statements in DIRT-related files to use direct imports
instead of re-exported paths. This prepares for removal of re-exporting
files in a follow-up PR.
Part of PM-33381
* feat(accept-organization-component) [PM-29796]: Validate Id expected shape.
* feat(utils) [PM-29796]: Remove invalidUrlParams.
* feat(utils) [PM-29796]: Re-add URL pattern matching detection with updated naming and comments.
* feat(accept-organization) [PM-29796]: Update component handling for id validation.
* feat(utils) [PM-29796]: Improve pattern-matching on utils.
* comment(accept-organization) [PM-29796]: Add comments on handling pattern.
* comment(accept-organization) [PM-29796]: Comments around authedHandler handling.
* refactor(utils) [PM-29796]: One entry per line with trailing comments for Prettier.
* refactor(accept-organization) [PM-29796]: Abstract handleInvalidInvite to its own method.
* docs(utils) [PM-29796]: Add/ungroup comments on declared match patterns.
* test(utils) [PM-29796]: Update tests and comments.
---------
Co-authored-by: Jared Snider <116684653+JaredSnider-Bitwarden@users.noreply.github.com>
* feat(access-intelligence): add V2 data model family, feature flag, and encryption service abstraction
* fix(access-intelligence): remove premature services export from barrel
* adds premium-upsell service
* adds and updates tests
* changes name and type in test file
* fixes strict ts
* Update libs/angular/src/vault/services/premium-upsell.service.spec.ts
fix import
Co-authored-by: Jordan Aasen <166539328+jaasen-livefront@users.noreply.github.com>
* change initial value and fix import order
---------
Co-authored-by: Jordan Aasen <166539328+jaasen-livefront@users.noreply.github.com>
* fix(uif): only apply macOS extra top padding to nav logo in overlay mode
The macOS extra top padding was unconditionally applied to the nav logo.
Now it only applies when the side nav is in overlay mode (open but not push mode).
* PM-33168 - EmergencyAccess - Add / Edit dialog - add missing validation service call to show errors as toasts
* PM-33168 - Per PR feedback, remove catch and let bitSubmit handle logging and showing error.
* PM-32487 - EmergencyAccessAddEditComponent - clean up unused service
* Add new workflow.
* Workflow lints
* More security fixes.
* Claude feedback.
* Don't make empty commit.
* Update job name.
* Updated node version check.
* Print environments.
* Addressed PR feedback.
* Removed concept of distingushing downgrade.
* Updated to reference specific run_id if triggered by one.
* Addressed Claude feedback.
Building upon the prior SSH agent v2 commits, this PR introduces the high level interfaces between the napi layer, the agent, and the underlying server.
Two traits are defined to act as abstraction layers:
AuthPolicy allows the underlying server to externally request authorization to complete the various ssh operation requests it receives. The implementation of this in the BitwardenSshAgent is effectively the agent's business logic, and has unit tests accordingly.
ApprovalRequester allows the agent to externally request approval for those authorization requests.
These interfaces allow better unit test-ability and integration test-ability, and additionally are context-independent from each other; meaning the ssh agent server doesn't know about vault items, or that there is an electron app at all. Similarly, the agent knows it needs to request approval, but it doesn't have to be from an Electron app.
Co-authored-by: Bernd Schoolmann <mail@quexten.com>