1
0
mirror of https://github.com/bitwarden/server synced 2026-02-12 06:23:28 +00:00
Commit Graph

1302 Commits

Author SHA1 Message Date
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
John Harrington
fa06fe41ab [PM-30920] Server changes to encrypt send access email list (#6867)
* models, entity, and stored procs updated to work with EmailHashes with migrations

* configure data protection for EmailHashes

* update SendAuthenticationQuery to use EmailHashes and perform validation

* respond to Claude's comments and update tests

* fix send.sql alignment

Co-authored-by: mkincaid-bw <mkincaid@bitwarden.com>

---------

Co-authored-by: Alex Dragovich <46065570+itsadrago@users.noreply.github.com>
Co-authored-by: mkincaid-bw <mkincaid@bitwarden.com>
2026-01-28 07:13:25 -07:00
Matt Gibson
edf694b8d4 Use Scene result for SingleUserScene (#6909)
* Scenes should return resulting data in the result object

The result is for data that cannot be known by the client requesting the scene and the mangle map used for mangling input values to enable parallelizing tests

* Fix filenames

* SingleUserScene now has a return value of various created User data

* 1/100 too frequent for false test failures
2026-01-27 21:55:04 +01:00
Maciej Zieniuk
f578dab94f user reset password key can be empty string (#6871) 2026-01-27 21:38:09 +01:00
Thomas Rittson
80eec2df85 [PM-23768] Public API - add restore and revoke member endpoint (#6859)
* Add restore and revoke to public api

* Follow naming conventions

* Use POST instead of PUT

* hello claude

* Update test names

* Actually fix test names

* Add JsonConstructor attr

* Fix test
2026-01-27 12:11:15 -06:00
Alex Morask
5104ec5f98 [PM-31040] Add logging to bank account setup process (#6898)
* Add logging to bank account setup process

* Missed test file constructor
2026-01-26 11:46:08 -06:00
Anders Åberg
40e293117d PM-2035: PRF Unlock (#6401)
* Initial refactor

* Add WebauthnPRFOptions to syncResponse

* MAYBE: Use KM owned ResponseModel?

* REVERT ^- Keep using PrfUnlockOptions for simplicity

This reverts commit 5a34e7dfa8.

* UserDecryptionOptions: Only send one credential

* format

* Update UserDecryptionOptions.cs

* format

* Added feature flag (#6600)
2026-01-26 07:18:42 -08:00
Rui Tomé
c8124667ee [PM-28842] Add validation to prevent excessive master password policy values (#6807)
* Enhance MasterPasswordPolicyData with validation attributes

Added data annotations for MinComplexity and MinLength properties to enforce validation rules. MinComplexity must be between 0 and 4, and MinLength must be between 12 and 128.

* Implement model validation in PolicyDataValidator and enhance error handling

Added a ValidateModel method to enforce validation rules for policy data. Updated error messages to provide clearer feedback on validation failures. Enhanced unit tests to cover new validation scenarios for MinLength and MinComplexity properties.

* Update PoliciesControllerTests to reflect new validation rules for MinComplexity and MinLength

Modified test cases to use updated values for MinComplexity (4) and MinLength (128). Added new tests to verify that excessive values for these properties return BadRequest responses. Ensured consistency across integration tests for both Admin and Public controllers.

* Enhance MasterPasswordPolicyData with XML documentation for properties

Added XML documentation comments for MinComplexity and MinLength properties to clarify their purpose and constraints. This improves code readability and provides better context for developers using the model.

* Add unit tests for PolicyDataValidator to validate minLength and minComplexity rules

Implemented new test cases to verify the behavior of the ValidateAndSerialize method in PolicyDataValidator. Tests cover scenarios for minimum and maximum values, as well as edge cases for invalid inputs, ensuring robust validation for MasterPassword policy data.
2026-01-26 11:38:06 +00:00
Vijay Oommen
b623e381b4 PM-30799 added validation for DomainName (#6856) 2026-01-23 08:34:19 -06:00
Rui Tomé
bfe2e7717d [PM-30615] Fix Public API List Collections returning Default Collections (#6841) 2026-01-23 11:07:56 +00:00
Dave
93e2c971df feat(emergency-access) [PM-29584] Create Email for Emergency Access Removal (#6793)
* feat(emergency-access) [PM-29584]: Add email template.

* refactor(emergency-access) [PM-29584]: Move Emergency Access to Auth/UserFeatures.

* refactor(emergency-access) [PM-29584]: Move EmergencyAccess tests to UserFeatures space.

* feat(emergency-access) [PM-29584]: Add compiled EmergencyAccess templates.

* test(emergency-access) [PM-29584]: Add mailer-specific tests.

* refactor(emergency-access) [PM-29584]: Move mail to UserFeatures area.

* feat(emergency-access) [PM-29584]: Update link for help pages, not web vault.

* test(emergency-access) [PM-29584]: Update mail tests for new URL and single responsibility.

* refactor(emergency-access) [PM-29584]: Add comments for added test.
2026-01-22 20:24:15 -05:00
Mike Amirault
0cc72127d7 [PM-26405] Fix cipher favorite info being saved incorrectly on import (#6776) 2026-01-22 20:11:56 -05:00
Alex Morask
b686da18dc [PM-30626] Fetch provided storage from Pricing Service when determining storage limit (#6845)
* Fetch provided storage from Pricing Service

* Run dotnet format

* Gbubemi's feedback
2026-01-22 09:01:06 -06:00
Alex Morask
75a857055e [PM-30697] [PM-30698] Renewal email copy updates (#6875)
* feat(families-renewal): Update copy

* feat(premium-renewal): Add new var, update copy
2026-01-21 11:52:36 -06:00
Rui Tomé
7fb2822e05 [PM-28023] Fix restoring revoked invited users in Free Organizations (#6861)
* Fix null reference when restoring invited users in Free orgs

Add null check before querying for other free org ownership. Invited
users don't have a UserId yet, causing NullReferenceException.

* Add regression test for restoring revoked invited users with null UserId.
2026-01-21 11:27:24 +00:00
Alex Morask
2e4dd061e3 [PM-30855] Pay prorated storage adjustment immediately with Braintree for Premium PayPal users (#6850)
* fix: Pay prorated storage invoice immediately with Braintree for PayPal users

* Run dotnet format
2026-01-20 09:18:27 -06:00
Todd Martin
c37412bacb chore(flags): Remove pm-1632-redirect-on-sso-required feature flag
* Remove feature flag.

* Update test title.

* Fixed some test failures.

* Fixed tests

* Removed method that's no longer used.

* Removed unneeded directive.
2026-01-20 10:03:33 -05:00
Thomas Rittson
ad19efcff7 [PM-22236] Fix invited accounts stuck in intermediate claimed status (#6810)
* Exclude invited users from claimed domain checks.
  These users should be excluded by the JOIN on
  UserId, but it's a known issue that some invited
  users have this FK set.
2026-01-17 10:47:21 +10:00
Stephon Brown
8d30fbcc8a Billing/pm 30882/defect pm coupon removed on upgrade (#6863)
* fix(billing): update coupon check logic

* tests(billing): update tests and add plan check test
2026-01-16 18:13:57 -05:00
Justin Baur
aa33a67aee [PM-30858] Fix excessive logs (#6860)
* Add tests showing issue & workaround

- `AddSerilogFileLogging_LegacyConfig_InfoLogs_DoNotFillUpFile` fails
- `AddSerilogFileLogging_LegacyConfig_WithLevelCustomization_InfoLogs_DoNotFillUpFile` fails
- `AddSerilogFileLogging_NewConfig_InfoLogs_DoNotFillUpFile` fails
- `AddSerilogFileLogging_NewConfig_WithLevelCustomization_InfoLogs_DoNotFillUpFile` works

* Allow customization of LogLevel with legacy path format config

* Lower default logging levels

* Delete tests now that log levels have been customized
2026-01-16 10:33:17 -05:00
Thomas Rittson
ebb0712e33 [PM-28555] Add idempotent sproc to create My Items collections (#6801)
* Add sproc to create multiple default collections. 
  SqlBulkCopy implementation is overkill for most cases.
  This provides a lighter weight sproc implementation for smaller
  data sets.
* DRY up collection arrangement
* DRY up tests because bulk and non-bulk share same behavior
* use EF native AddRange instead of bulk insert, because
  we expect smaller data sizes on self-host
2026-01-15 22:49:25 +00:00
Patrick-Pimentel-Bitwarden
029a5f6a2d Revert "feat(register): [PM-27084] Account Register Uses New Data Types (#6715)" (#6854)
This reverts commit 8cb8030534.
2026-01-15 21:19:16 +00:00
Patrick-Pimentel-Bitwarden
8cb8030534 feat(register): [PM-27084] Account Register Uses New Data Types (#6715)
* feat(register): [PM-27084] Account Register Uses New Data Types - Implementation

* test(register): [PM-27084] Account Register Uses New Data Types - Added tests
2026-01-15 15:55:27 -05:00
Justin Baur
44249c38e0 Add some integration tests for the Server project (#6839)
* Add some integration tests for the Server project

* Not sure why this project got removed?

* Format

* capture debug output

* Update tests to work with the now legacy WebHostBuilder

- I accidentally had the updated Program locally and that was why tests were working for me locally

* Formatting...again
2026-01-15 03:52:00 -05:00
Jordan Aasen
b86a31160a [PM-30448] - remove edit requirement for cipher archiving (#6830)
* remove edit requirement for cipher archiving

* update cipher_archive/unarchive sql

* update cipher_archive/unarchive sql

* fix sql

* update sql

* update sql
2026-01-14 15:55:09 -08:00
John Harrington
fa845a4753 [Tools] Update SendAuthenticationQuery, add new non-anonymous endpoints, and add PutRemoveAuth endpoint (#6786)
* update send api models to support new `email` field

* normalize authentication field evaluation order

* document send response converters

* add FIXME to remove unused constructor argument

* add FIXME to remove unused constructor argument

* introduce `tools-send-email-otp-listing` feature flag

* add `ISendOwnerQuery` to dependency graph

* fix broken tests

* added AuthType prop to send related models with test coverage and debt cleanup

* dotnet format

* add migrations

* dotnet format

* make SendsController null safe (tech debt)

* add AuthType col to Sends table, change Emails col length to 4000, and run migrations

* dotnet format

* update SPs to expect AuthType

* include SP updates in migrations

* remove migrations not intended for merge

* Revert "remove migrations not intended for merge"

This reverts commit 7df56e346a.

undo migrations removal

* extract AuthType inference to util method and remove SQLite file

* fix lints

* address review comments

* fix incorrect assignment and adopt SQL conventions

* fix column assignment order in Send_Update.sql

* remove space added to email list

* assign SQL default value of NULL to AuthType

* update SPs to match migration changes

* remove FF, update SendAuthQuery, and update tests

* new endpoints added but lack test coverage

* dotnet format

* add PutRemoveAuth endpoint with test coverage and tests for new non-anon endpoints

* update RequireFeatureFlag comment for clarity

* respond to Claude's findings

* add additional validation logic to new auth endpoints

* enforce auth policies on individual action methods

* remove JsonConverter directive for AuthType

* remove tools-send-email-otp-listing feature flag

---------

Co-authored-by:  Audrey  <audrey@audreyality.com>
Co-authored-by:  Audrey  <ajensen@bitwarden.com>
Co-authored-by: Daniel James Smith <2670567+djsmith85@users.noreply.github.com>
Co-authored-by: Alex Dragovich <46065570+itsadrago@users.noreply.github.com>
2026-01-14 14:07:46 -07:00
Alex Morask
e1b6e496f9 fix(start-premium): Need to expand 'customer' on first invoice (#6844) 2026-01-14 14:34:42 -06:00