1
0
mirror of https://github.com/bitwarden/server synced 2026-02-20 03:13:35 +00:00
Commit Graph

1328 Commits

Author SHA1 Message Date
renovate[bot]
0753d0584a [deps] Tools: Pin dependencies 2026-02-19 18:00:23 +00:00
Brandon Treston
31fe7b0e12 [PM-26378] Auto confirm events (#7017)
* implement auto confirm push notification

* fix test

* fix test

* simplify LINQ

* add event logging for auto confirm

* fix test
2026-02-19 11:10:28 -06:00
Alex Morask
71a8116d4c [PM-29089] Remove FF: pm-26793-fetch-premium-price-from-pricing-service - Logic (#6989)
* refactor: [PM-39087] remove PM-26793 feature flag from PricingClient

* test: add ListPremiumPlans and GetAvailablePremiumPlan coverage to PricingClientTests
2026-02-19 08:57:29 -06:00
sven-bitwarden
4d91350fb7 [PM-29498] Remove Premium Feature Flagged Logic (#6967)
* Remove feature flag logic and fix unit tests

* Simplify query

* Fix test

* Fix local review
2026-02-19 08:06:17 -06:00
Alex Morask
cfd5bedae0 [PM-31040] Replace ISetupIntentCache with customer-based approach (#6954)
* docs(billing): add design document for replacing SetupIntent cache

* docs(billing): add implementation plan for replacing SetupIntent cache

* feat(db): add gateway lookup stored procedures for Organization, Provider, and User

* feat(db): add gateway lookup indexes to Organization, Provider, and User table definitions

* chore(db): add SQL Server migration for gateway lookup indexes and stored procedures

* feat(repos): add gateway lookup methods to IOrganizationRepository and Dapper implementation

* feat(repos): add gateway lookup methods to IProviderRepository and Dapper implementation

* feat(repos): add gateway lookup methods to IUserRepository and Dapper implementation

* feat(repos): add EF OrganizationRepository gateway lookup methods and index configuration

* feat(repos): add EF ProviderRepository gateway lookup methods and index configuration

* feat(repos): add EF UserRepository gateway lookup methods and index configuration

* chore(db): add EF migrations for gateway lookup indexes

* refactor(billing): update SetupIntentSucceededHandler to use repository instead of cache

* refactor(billing): simplify StripeEventService by expanding customer on SetupIntent

* refactor(billing): query Stripe for SetupIntents by customer ID in GetPaymentMethodQuery

* refactor(billing): query Stripe for SetupIntents by customer ID in HasPaymentMethodQuery

* refactor(billing): update OrganizationBillingService to set customer on SetupIntent

* refactor(billing): update ProviderBillingService to set customer on SetupIntent and query by customer

* refactor(billing): update UpdatePaymentMethodCommand to set customer on SetupIntent

* refactor(billing): remove bank account support from CreatePremiumCloudHostedSubscriptionCommand

* refactor(billing): remove OrganizationBillingService.UpdatePaymentMethod dead code

* refactor(billing): remove ProviderBillingService.UpdatePaymentMethod

* refactor(billing): remove PremiumUserBillingService.UpdatePaymentMethod and UserService.ReplacePaymentMethodAsync

* refactor(billing): remove SubscriberService.UpdatePaymentSource and related dead code

* refactor(billing): update SubscriberService.GetPaymentSourceAsync to query Stripe by customer ID

Add Task 15a to plan - this was a missed requirement for updating
GetPaymentSourceAsync which still used the cache.

* refactor(billing): complete removal of PremiumUserBillingService.Finalize and UserService.SignUpPremiumAsync

* refactor(billing): remove ISetupIntentCache and SetupIntentDistributedCache

* chore: remove temporary planning documents

* chore: run dotnet format

* fix(billing): add MaxLength(50) to Provider gateway ID properties

* chore(db): add EF migrations for Provider gateway column lengths

* chore: run dotnet format

* chore: rename SQL migration for chronological order
2026-02-18 13:20:25 -06:00
Alex Morask
2ce98277b4 chore: [PM-29055] remove pm-25379-use-new-organization-metadata-structure feature flag (#6966)
Remove the fully-released feature flag and clean up the old code path:
- Remove flag constant from FeatureFlagKeys
- Remove [RequireFeature] gate from VNext billing controllers
- Remove old GetMetadataAsync endpoint from OrganizationBillingController
- Remove GetMetadata from IOrganizationBillingService and implementation
- Remove IsOnSecretsManagerStandalone private helper
- Remove associated tests
2026-02-18 09:06:06 -06:00
Jared McCannon
8fefae98e4 [PM-18715] - SCIM Revoke User v2 (#7024)
* Migrated SCIM revoke user call to the v2 implementation.

* Correcting feature string
2026-02-18 08:09:45 -06:00
Kyle Denney
f0c69cedc2 [PM-30108] import discount from stripe (#6982)
* [PM-30108] import discount from stripe

* fix repo tests

* pr feedback

* wrap discounts in feature flag

* claude pr feedback
2026-02-17 12:57:14 -06:00
sven-bitwarden
0874163911 [PM-24759] Add Method for Retrieving Policy Requirements for Multiple Users (#6876)
* Adds new method for retrieving policy requirements for a collection of user IDs

* Use Single instead of First for explicit correctness

* Fix xmldoc

* Refactor return type to include user ID
2026-02-17 10:33:27 -06:00
Mick Letofsky
67f704d5d1 Removing useless Claude generated tests. (#7016) 2026-02-17 17:12:09 +01:00
Mick Letofsky
07049b367a Seeder Enhancements - Phase 3 (#6973) 2026-02-17 07:42:53 +01:00
Rui Tomé
e65ed484f9 [PM-21740 / PM-27878] Update join organization email templates (#6941)
* Add new feature flag for updating the join organization email templates

* Add new MJML email template for organization invite to existing users

* Add new MJML email template for organization invite to new users

* Add new MJML email template for organization invite to existing families

* Add new MJML email template for organization invite to families for new users

* Add new MJML email template for organization invite to free users

* Add OrganizationInviteBaseView model for organization invite email templates

* Add required properties for email title customization in OrganizationInviteBaseView

* Add new MJML email templates for organization invites to existing and new users, including families and free users.

* Enhance SendInvitesRequest to include optional InvitingUserId and update related methods in OrganizationService for improved user invitation tracking.

* Refactor organization invite email handling to support customized templates for existing and new users, incorporating inviting user information and enhancing the SendInvitesRequest structure.

* Refactor OrganizationInviteBaseView and SendOrganizationInvitesCommand to remove unnecessary properties, streamlining the organization invite email structure and focusing on essential information for user invitations.

* Refactor SendOrganizationInvitesCommand to improve email invitation logic by removing the OrganizationCategory enum and consolidating plan type checks. Introduce a new method for formatting expiration dates to enhance code clarity and maintainability.

* Update organization invite email templates to enhance styling

* Enhance SendOrganizationInvitesCommand to include additional plan types for organization invites, allowing support for TeamsStarter, TeamsStarter2023, and Custom plans in the invitation logic.

* Add tests for SendOrganizationInvitesCommand to validate email sending logic for various plan types, including Enterprise, Teams, Families, Free, and Custom plans, based on user existence and feature flags.

* Update organization invite email templates to improve styling and layout consistency across various user types, including adjustments to padding, font weights, and vertical alignment for a more polished appearance.

* Refactor organization invite email templates to improve styling consistency and layout across various user types, including adjustments to padding, font families, and visibility of icon rows for a more polished appearance.

* [PM-30610] Break shared components into AC versions

* Revert changes to shared MJML components

* Refactor organization invite email templates to use admin console MJML components

* Update organization invite email templates to utilize new admin console MJML components

* Enhance organization invite email templates by adding bullet point for mobile views

* Update organization invite email templates to improve layout and visibility of bullet points by changing display properties and adding inline text spans.

---------

Co-authored-by: Jimmy Vo <huynhmaivo82@gmail.com>
2026-02-16 11:26:34 +00:00
Dave
ca35b9e26f [PM-29890] Refactor Two-factor WebAuthn Methods Out of UserService (#6920)
* refactor(2fa-webauthn) [PM-29890]: Add command for start 2fa WebAuthn.

* refactor(2fa-webauthn) [PM-29890]: Put files into iface-root /implementations structure to align with other feature areas.

* refactor(2fa-webauthn) [PM-29890]: Add complete WebAuthn registration command.

* test(2fa-webauthn) [PM-29890]: Refactor and imrove 2fa WebAuthn testing from UserService.

* refactor(2fa-webauthn) [PM-29890]: Add delete WebAuthn credential command.

* test(2fa-webauthn) [PM-29890]: Add tests for delete WebAuthn credential command.

* refactor(2fa-webauthn) [PM-29890]: Update docs.

* refctor(2fa-webauthn) [PM-29890]: Re-spell docs.

* refactor(2fa-webauthn) [PM-29890]: Add comment around last-credential deletion.
2026-02-13 13:35:42 -05:00
cyprain-okeke
84521a67c8 [PM-30908]Correct Premium subscription status handling (#6877)
* Implement the correct changes

* failing test has been removed

* Add unit testing and logs

* Resolve the pr comment on missed requirements

* fix the lint error

* resolve the build lint

* Fix the failing test

* Fix the failing test

* Add the IncompleteExpired status

* resolve the lint error

* Fix the build lint error

* Implement the IncompleteExpired flow
2026-02-13 18:56:26 +01:00
Brandon Treston
bf9cc01459 [PM-26379] Implement auto confirm push notification (#6980)
* implement auto confirm push notification

* fix test

* fix test

* simplify LINQ
2026-02-13 11:50:12 -05:00
Alex Dragovich
94f7266feb [PM-31483] adding guard for when email verification FF is disabled (#6927)
* [PM-31483] adding guard for when email verification FF is disabled

* [PM-31483] removing need for client fallback endpoint

* [PM-31483] fixing test after main merge

* [PM-31483] changing error when email protected send should not be allowed to be viewed
2026-02-12 13:58:44 -08:00
Rui Tomé
17166dc0f5 [PM-28300] Remove BlockClaimedDomainAccountCreation feature flag checks (#6934)
* [PM-28300] Remove BlockClaimedDomainAccountCreation feature flag checks

* Fix user registration tests by adding proper email domains

* Remove redundant feature flag checks from user registration tests

* Remove BlockClaimedDomainAccountCreation constant from FeatureFlagKeys
2026-02-11 22:10:59 +00:00
John Harrington
d9b6df2692 [PM-31611] Improve readability by explicitly setting AuthType in SendRequestModel (#6962)
* improve readability by  explicitly setting AuthType in SendRequestModel

* fix failing tests to match updated behavior expectations
2026-02-11 13:37:41 -07:00
Jared McCannon
0566de90d6 [PM-27145] - Block Auto Confirm Enable Admin Portal (#6981)
* Extracted policy compliance checking for the organization out and added a check when attempting to enable auto user confirm via Admin Portal

* Moved injection order. Fixed error message.
2026-02-11 09:59:18 -06:00
Derek Nance
de330e987d [PM-32007] Use kebab instead of snake case for cookie vendor (#6977) 2026-02-10 15:26:19 -06:00
Jared McCannon
c1ee27f42c Fixes concurrency issue with auto confirm test (#6964) 2026-02-10 14:40:35 -06:00
Matt Gibson
902be7dfb8 Require password when seeding a new user (#6978) 2026-02-10 19:01:50 +00:00
Alex Morask
81e3044b91 [PM-31140] Consolidate unpaid subscription handling (#6918)
* Consolidate unpaid subscription handling

* Move enable/disable operations to SubscriberService

* Revert "Move enable/disable operations to SubscriberService"

This reverts commit fe0bc1516b.
2026-02-10 11:24:00 -06:00
Alex Morask
e2c0861050 [PM-31359] Show new price to premium users who have yet to be migrated (#6963)
* test: add tests for legacy pricing pivot in GetBitwardenSubscriptionQuery

* feat(billing): preview next charge at new price for users on legacy Premium pricing

* chore: apply dotnet format
2026-02-10 11:23:16 -06:00
renovate[bot]
065d971dc4 [deps] Billing: Update swashbuckle-aspnetcore monorepo to v10 (major) (#6729)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Derek Nance <dnance@bitwarden.com>
2026-02-10 11:11:44 -05:00
John Harrington
bc94934808 [PM-31787] Users can access the sends after the limit was reached (#6958)
* fix file type send increment behavior

* fix text send access increment behavior

* fix & update tests

* cleanup unused service

* fix broken test constructor expecting unused service
2026-02-10 07:57:43 -07:00
Alex Dragovich
6d43cc43e3 [PM-31684] Remove email hashing for send access (#6945)
* [PM-31684] Remove email hashing for send access

* [PM-31684] switching the order of migration files

* [PM-31684] adding more migrations

* [PM-31684] Removing anon access emails field  and reusing emails field

* [PM-31684] cleanup before adding migrations back

* [PM-31684] restore original snapshots

* [PM-31684] restore original postgres snapshots

* [PM-31684] adding migrations

* [PM-31684] removing encryption attributes from emails request model

* [PM-31684] adding missing stored proc alters

* [PM-31684] Improved formatting for stored proc defs

* [PM-31684] adding necessary comment back

* [PM-31684] adding case-insensitive check on the server for send auth
2026-02-09 12:58:57 -08:00
Jared
7c216366a7 [PM-31153] email updates for domain claim pt 2 (#6965)
* [PM-31361] Enhance domain claimed email notifications

* Updated the email template to include the claimed domain name and user email.
* Modified the `ClaimedUserDomainClaimedEmails` model to include the domain name.
* Adjusted the `SendClaimedDomainUserEmailAsync` method to pass the domain name to the email message.
* Added a new test for rendering the domain claimed email to ensure proper content delivery.

* Update email templates for domain claimed notifications

* Adjusted styles and formatting in the DomainClaimedByOrganization email template for improved readability.
* Modified the TitleContactUs layout to ensure proper rendering of titles.
* Updated the HandlebarsMailService to include HTML line breaks in the email title for better presentation.

* Update TitleContactUs email template to center-align title text for improved presentation

* Refine TitleContactUs email template by removing unnecessary text-align property for improved consistency in styling

* Fix PR comments

* Update test/Core.Test/Platform/Mail/DomainClaimedEmailRenderTest.cs

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>

* Update test/Core.Test/Platform/Mail/DomainClaimedEmailRenderTest.cs

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>

* Update test/Core.Test/Platform/Mail/DomainClaimedEmailRenderTest.cs

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>

* Remove unnecessary comments

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
2026-02-09 14:38:50 -05:00
Jason Ng
2413ce10ab [PM-31745] Allow user to perm delete unassigned items (#6956)
* update DeleteAdmin to grab items that are unassigned and ciphersControllerTests
2026-02-09 10:46:30 -05:00
sven-bitwarden
70c01bcfb2 [PM-25106] Refactor Misleading Stored Procedure/Repository Language (#6890)
* Begin migration to appropriately named sprocs

* Update method and parameter names

* Remove incorrect change

* Changes EF to match collection type comparison

* Adds integration test verifying excluded collections

* Changes EF to match collection type comparison

* Fix whitespacing

* Fix dedented if
2026-02-09 09:25:10 -06:00
cyprain-okeke
67ba9bcca5 [PM 30100][Server] Subscription Discount Database Infrastructure (#6936)
* Implement the detail Subscription Discount Database Infrastructure

* Change string to string list

* fix lint error

* Create all missing database object definition files

* Regenerate EF migrations with Designer files

The previous migrations were missing .Designer.cs files. This commit:
- Removes the incomplete migration files
- Regenerates all three provider migrations (MySQL, Postgres, SQLite) with proper Designer files
- Updates DatabaseContextModelSnapshot.cs for each provider

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* fix failing database

* Resolve the lint  warnings

* Resolve the database failure

* Fix the build Lint

* resolve the dbops reviews

* Add the default value

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-02-06 18:24:26 +01:00
sven-bitwarden
3e21d12202 Ensure org user belongs to org they're being invited to (#6937) 2026-02-05 14:44:59 -06:00
Patrick-Pimentel-Bitwarden
ef37f3d3dd feat(emergency-access): [PM-31636] Emergency Access Takeover Salt (#6939)
* feat(emergency-access): [PM-31636] Emergency Access Takeover Salt - Added salt to response of emergency access takeover response.

* test(emergency-access): [PM-31636] Emergency Access Takeover Salt - Added tests.
2026-02-05 10:19:57 -05:00
Mick Letofsky
4eb9c4cf3c Enhance seeder with additional cipher types and architectural refactorings (#6935) 2026-02-04 19:27:09 +01:00
Derek Nance
26b62bc766 [PM-27260] SSO cookie vending (#6903) 2026-02-04 16:31:42 +01:00
Patrick-Pimentel-Bitwarden
c52f2e0d09 feat(register): [PM-27084] Account Register Uses New Data Types - Repush (#6855)
* feat(register): [PM-27084] Account Register Uses New Data Types - Changes.

* test(register): [PM-27084] Account Register Uses New Data Types - Added tests.

* fix(register): [PM-27084] Account Register Uses New Data Types - Added constant for feature flag.
2026-02-04 10:03:55 -05:00
Ike
5afdfa6fd1 [PM-30563] Change error response on Send Access token request (#6911)
* feat: remove invalid email response and instead return email and OTP required to protect against enumeration attacks.

* fix: fixing tests and dotnet format
2026-02-04 09:42:32 -05:00
Alex Morask
4667af6cf9 [PM-30444] Handle missing Braintree customer in GetPaymentMethodQuery (#6899)
* Handle missing Braintree customer in GetPaymentMethodQuery

* Allow addition of PayPal payment method when bad Braintree customer ID is linked

* Run dotnet format
2026-02-04 07:48:06 -06:00
Ike
68e67e1853 [PM-26376] Emergency Access Delete Command (#6857)
* feat: Add initial DeleteEmergencyContactCommand

* chore: remove nullable enable and add comments

* test: add tests for new delete command

* test: update tests to test IMailer was called.

* feat: add delete by GranteeId and allow for multiple grantors to be contacted.

* feat: add DeleteMany stored procedure for EmergencyAccess

* test: add database tests for new SP

* feat: commands use DeleteManyById for emergencyAccessDeletes

* claude: send one email per grantor instead of a bulk email to all grantors. Modified tests to validate.

* feat: change revision dates for confirmed grantees; 

* feat: add AccountRevisionDate bump for grantee users in the confirmed status

* test: update integration test to validate only confirmed users are updated as well as proper deletion of emergency access
2026-02-03 16:43:44 -05:00
Kyle Denney
4f4ccac2de [PM-29599] create proration preview endpoint (#6858)
* [PM-29599] create proration preview endpoint

* forgot to inject user and fixing stripe errors

* updated proration preview and upgrade to be consistent

also using the correct proration behavior and making the upgrade flow start a trial

* missed using the billing address

* changes to proration behavior

and returning more properties from the proration endpoint

* missed in refactor

* pr feedback
2026-02-03 10:08:14 -06:00
John Harrington
d3aed59fcb [PM-30247] Previously archived items are not archived after import (#6824)
* support importing archived ciphers
* preserve archived ciphers across org imports
2026-02-02 14:39:01 -07:00
Stephon Brown
0e72257ea1 [PM-31360] Remove Reversion Related Code (#6922)
* fix(billing): remove stripe constants

* fix(billing): remove redundant metadate

* tests(billing): remove obsolete metadata checks
2026-02-02 13:44:15 -05:00
Todd Martin
a27eda7df6 chore(flags): [PM-30613] Remove unused mjml-based-email-templates feature flag
* Removed old method.

* Removed IFeatureService.

* Fixed test.

* Renamed the v2 endpoint.

* Removed old Handlebars templates.

* Renamed v2 templates to remove v2 suffix.
2026-02-02 11:36:39 -05:00
Justin Baur
d4de03a762 Introduce the Server SDK to the rest of our services (#6915) 2026-02-02 10:27:25 -05:00
Mick Letofsky
5941e830d2 Refactor to correctly implement statics and remove hardcoded organization keys (#6924) 2026-01-30 16:03:56 +01:00
Mick Letofsky
bfc645e1c1 Add cipher seeding with Rust SDK encryption to enable cryptographically correct test data generation (#6896) 2026-01-30 13:53:24 +01:00
sven-bitwarden
93a28eed40 [PM-29246] Simplify Usage of Organization Policies (#6837)
* Initial implementation of new policy query

* Remove unused using

* Adjusts method name to better match repository method

* Correct namespace

* Initial refactor of policy loading

* Add xml doc, incorporate shim data model

* Updates usages to reflect new shim model

* Prune extranneous data from policy detail response model, format code

* Fix broken test, delete inapplicable test

* Adds test cases covering query

* Adjust codebase to use new PolicyQueryçˆ

* Format code

* Fix incorrect mock on test

* Fix formatting

* Adjust method name

* More naming adjustments

* Add PolicyData constructor, update test usages

* Rename PolicyData -> PolicyStatus

* Remove unused using
2026-01-29 14:11:20 -06:00
Alex Dragovich
0544ec41d5 [PM-31394] use email address hash for send access email verification (#6921)
* [PM-31394] use email address hash for send access email verification

* [PM-31394] fixing identity server tests for send access

* [PM-31394] fixing more identity server tests for send access
2026-01-29 11:48:12 -08:00
Jared McCannon
ddbaffad59 [PM-28627] Create Default Collection Restore (#6879)
* Add default collection name to call stack for restore user command

* Committing feature flag and request model.

* Added tests

* fix for tests.

* added empty string to test

* figured out the mystery commit.

* added vnext onto method name.

* updating tests and command to include feature flag

* moved event call

* last few changes.

* opting for null instead of empty string.
2026-01-28 09:05:29 -06:00
Brandon Treston
a677eb9b39 remove feature flagged logic (#6901) 2026-01-28 09:31:49 -05:00