1
0
mirror of https://github.com/bitwarden/server synced 2025-12-06 00:03:34 +00:00
Commit Graph

6368 Commits

Author SHA1 Message Date
Stephon Brown
5dbce33f74 [PM-24273] Milestone 2C (#6544)
* feat(billing): add mjml template and updated templates

* feat(billing): update maileservices

* feat(billing): add milestone2 discount

* feat(billing): add milestone 2 updates and stripe constants

* tests(billing): add handler tests

* fix(billing): update mailer view and templates

* fix(billing): revert mailservice changes

* fix(billing): swap mailer service in handler

* test(billing): update handler tests
2025-11-06 13:21:29 -05:00
Nick Krantz
087c6915e7 when ciphers are soft deleted, complete any associated security tasks (#6492) 2025-11-06 08:28:13 -06:00
Oscar Hinton
a1be1ae40b Group sdk-internal dep (#6530)
* Disable renovate for updates to internal sdk-internal

* Group instead

* Add trailing comma
2025-11-06 14:44:44 +01:00
Rui Tomé
4aed97b76b [PM-26690] Wire VNextSavePolicyCommand behind PolicyValidatorsRefactor feature flag (#6483)
* Add PolicyValidatorsRefactor constant to FeatureFlagKeys in Constants.cs

* Add Metadata property and ToSavePolicyModel method to PolicyUpdateRequestModel

* Refactor PoliciesController to utilize IVNextSavePolicyCommand based on feature flag

- Added IFeatureService and IVNextSavePolicyCommand dependencies to PoliciesController.
- Updated PutVNext method to conditionally use VNextSavePolicyCommand or SavePolicyCommand based on the PolicyValidatorsRefactor feature flag.
- Enhanced unit tests to verify behavior for both enabled and disabled states of the feature flag.

* Update public PoliciesController to to utilize IVNextSavePolicyCommand based on feature flag

- Introduced IFeatureService and IVNextSavePolicyCommand to manage policy saving based on the PolicyValidatorsRefactor feature flag.
- Updated the Put method to conditionally use the new VNextSavePolicyCommand or the legacy SavePolicyCommand.
- Added unit tests to validate the behavior of the Put method for both enabled and disabled states of the feature flag.

* Refactor VerifyOrganizationDomainCommand to utilize IVNextSavePolicyCommand based on feature flag

- Added IFeatureService and IVNextSavePolicyCommand dependencies to VerifyOrganizationDomainCommand.
- Updated EnableSingleOrganizationPolicyAsync method to conditionally use VNextSavePolicyCommand or SavePolicyCommand based on the PolicyValidatorsRefactor feature flag.
- Enhanced unit tests to validate the behavior when the feature flag is enabled.

* Enhance SsoConfigService to utilize IVNextSavePolicyCommand based on feature flag

- Added IFeatureService and IVNextSavePolicyCommand dependencies to SsoConfigService.
- Updated SaveAsync method to conditionally use VNextSavePolicyCommand or SavePolicyCommand based on the PolicyValidatorsRefactor feature flag.
- Added unit tests to validate the behavior when the feature flag is enabled.

* Refactor SavePolicyModel to simplify constructor usage by removing EmptyMetadataModel parameter. Update related usages across the codebase to reflect the new constructor overloads.

* Update PolicyUpdateRequestModel to make Metadata property nullable for improved null safety
2025-11-06 11:35:07 +00:00
Todd Martin
3668a445e5 chore(docs): Add docs for legacy mail service
* Added docs for legacy mail service.

* Updated namespaces.

* Consolidated under Platform.Mail namespace

* Updated obsolete comment.

* Linting

* Linting

* Replaced documentation in original readme after accidental deletion.
2025-11-04 11:54:39 -05:00
Alex Morask
04ed8abf5a Re-add missing checkbox (#6532) 2025-11-04 07:25:42 -06:00
Bernd Schoolmann
7e54773a6e Add summary comments for MasterKeyWrappedUserKey in response models (#6531) 2025-11-04 12:42:07 +01:00
Vincent Salucci
b4d6f3cb35 chore: fix provider account recovery flag key, refs PM-24192 (#6533) 2025-11-03 13:32:09 -06:00
Dave
bda2bd8ac1 fix(base-request-validator) [PM-21153] Recovery Code Not Functioning for SSO-required Users (#6481)
* chore(feature-flag-keys) [PM-21153]: Add feature flag key for BaseRequestValidator changes.

* fix(base-request-validator) [PM-21153]: Add validation state model for composable validation scenarios.

* fix(base-request-validator) [PM-21153]: Update BaseRequestValidator to allow validation scenarios to be composable.

* fix(base-request-validator) [PM-21153]: Remove validation state object in favor of validator context, per team discussion.

* feat(base-request-validator) [PM-21153]: Update tests to use issue feature flag, both execution paths.

* fix(base-request-validator) [PM-21153]: Fix a null dictionary check.

* chore(base-request-validator) [PM-21153]: Add unit tests around behavior addressed in this feature.

* chore(base-request-validator) [PM-21153]: Update comments for clarity.

* chore(base-request-validator-tests) [PM-21153]: Update verbiage for tests.

* fix(base-request-validator) [PM-21153]: Update validators to no longer need completed scheme management, use 2FA flag for recovery scenarios.

* fix(base-request-validator-tests) [PM-21153]: Customize CustomValidatorRequestContext fixture to allow for setting of request-specific flags as part of the request validation (not eagerly truthy).
2025-11-03 12:24:00 -05:00
Robyn MacCallum
b329305b77 Update description for AutomaticAppLogIn policy (#6522) 2025-11-03 11:11:42 -05:00
Rui Tomé
1e2e4b9d4d [PM-26429] Add validation to policy data and metadata (#6460)
* Enhance PolicyRequestModel and SavePolicyRequest with validation for policy data and metadata.

* Add integration tests for policy updates to validate handling of invalid data types in PolicyRequestModel and SavePolicyRequest.

* Add missing using

* Update PolicyRequestModel for null safety by making Data and ValidateAndSerializePolicyData nullable

* Add integration tests for public PoliciesController to validate handling of invalid data types in policy updates.

* Add PolicyDataValidator class for validating and serializing policy data and metadata based on policy type.

* Refactor PolicyRequestModel, SavePolicyRequest, and PolicyUpdateRequestModel to utilize PolicyDataValidator for data validation and serialization, removing redundant methods and improving code clarity.

* Update PolicyRequestModel and SavePolicyRequest to initialize Data and Metadata properties with empty dictionaries.

* Refactor PolicyDataValidator to remove null checks for input data in validation methods

* Rename test methods in SavePolicyRequestTests to reflect handling of empty data and metadata, and remove null assignments in test cases for improved clarity.

* Enhance error handling in PolicyDataValidator to include field-specific details in BadRequestException messages.

* Enhance PoliciesControllerTests to verify error messages for BadRequest responses by checking for specific field names in the response content.

* refactor: Update PolicyRequestModel and SavePolicyRequest to use nullable dictionaries for Data and Metadata properties; enhance validation methods in PolicyDataValidator to handle null cases.

* test: Add integration tests for handling policies with null data in PoliciesController

* fix: Catch specific JsonException in PolicyDataValidator to improve error handling

* test: Add unit tests for PolicyDataValidator to validate and serialize policy data and metadata

* test: Update PolicyDataValidatorTests to validate organization data ownership metadata
2025-11-03 15:44:44 +00:00
Rui Tomé
de56b7f327 [PM-26099] Update public list members endpoint to include collections (#6503)
* Add CreateCollectionAsync method to OrganizationTestHelpers for collection creation with user and group associations

* Update public MembersController List endpoint to include associated collections in member response model

* Update MembersControllerTests to validate collection associations in List endpoint. Add JsonConstructor to AssociationWithPermissionsResponseModel

* Refactor MembersController by removing unused IUserService and IApplicationCacheService dependencies.

* Remove nullable disable directive from Public MembersController
2025-11-03 15:24:40 +00:00
Github Actions
0ea9e2e48a Bumped version to 2025.11.0 2025-11-03 14:29:04 +00:00
Thomas Rittson
e11458196c [PM-24192] Move account recovery logic to command (#6184)
* Move account recovery logic to command
  (temporarily duplicated behind feature flag)

* Move permission checks to authorization handler

* Prevent user from recovering provider member account
  unless they are also provider member
2025-11-01 07:55:25 +10:00
Github Actions
09564947e8 Bumped version to 2025.10.2 2025-10-31 21:38:53 +00:00
Jimmy Vo
21cc0b38b0 [PM-26401] Add logging logic (#6523) 2025-10-31 14:47:22 -04:00
Daniel James Smith
d40d705aac Revert feature flag removal for Chromium importers (#6526)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2025-10-31 18:40:54 +01:00
Alex Morask
410e754cd9 [PM-27553] Resolve premium purchase for user with account credit that used payment method (#6514)
* Update payment method for customer purchasing premium who has account credit but used a payment method

* Claude feedback + dotnet run format
2025-10-31 12:37:01 -05:00
Vijay Oommen
e102a7488e [PM-26967] Added new metric properties (#6519) 2025-10-30 16:54:05 -05:00
MtnBurrit0
b8325414bf Disable environment synchronization in workflow (#6525) 2025-10-30 12:55:28 -07:00
Jared McCannon
07a18d31a9 [PM-27594] - Update Org and License with Token (#6518)
* Updating the license and org with claims when updating via license token.

* Removing the fature flag check and adding a null check.

* Added to method.
2025-10-30 14:34:18 -05:00
Stephon Brown
cfe818e0aa Milestone 2b Update (#6515)
* feat(billing): add feature flag

* feat(billing): implement feature flag

* fix(billing): update logic

* fix(billing): revert spacing
2025-10-29 13:12:16 -04:00
Kyle Denney
ca0d5bf8cb [PM-23713] plans controller needs app authorize so desktop and browser can use (#6512) 2025-10-29 10:18:49 -05:00
mkincaid-bw
4b1685d346 Change recovery model for db's in full mode with no t-log backups (#6474) 2025-10-29 08:10:17 -07:00
Ben Brooks
d97593e91d Add validation to URI Match Default Policy for Single Org prerequisite (#6454)
* Add validation to URI Match Default Policy for Single Org prerequisite

Signed-off-by: Ben Brooks <bbrooks@bitwarden.com>

* Remove nullable enable; Replace Task.FromResult(0) with Task.CompletedTask

Signed-off-by: Ben Brooks <bbrooks@bitwarden.com>

* Add unit test for our new validator

Signed-off-by: Ben Brooks <bbrooks@bitwarden.com>

* Improve comments and whitespace for unit test

Signed-off-by: Ben Brooks <bbrooks@bitwarden.com>

* Remove unnecessary whitespace in unit test

Signed-off-by: Ben Brooks <bbrooks@bitwarden.com>

* Remove unneccessary unit tets

Signed-off-by: Ben Brooks <bbrooks@bitwarden.com>

* Re-add using NSubstitute

Signed-off-by: Ben Brooks <bbrooks@bitwarden.com>

* Revert unintended changes to AccountControllerTest.cs

Signed-off-by: Ben Brooks <bbrooks@bitwarden.com>

* Revert unintended changes to AccountControllerTest.cs

Signed-off-by: Ben Brooks <bbrooks@bitwarden.com>

* Revert unintended changes to HubHelpersTest.cs

Signed-off-by: Ben Brooks <bbrooks@bitwarden.com>

* Add IEnforceDependentPoliciesEvent interface to UriMatchDefaultPolicyValidator

Signed-off-by: Ben Brooks <bbrooks@bitwarden.com>

---------

Signed-off-by: Ben Brooks <bbrooks@bitwarden.com>
2025-10-29 07:53:48 -07:00
Alex Morask
5f0e0383a5 Remove FF (#6456) 2025-10-29 07:41:42 -05:00
Jordan Aasen
8f2f2046b7 [PM-27554] - add autofill confirm from search flag (#6511)
* add autofill confirm from search flag

* move flag
2025-10-28 15:08:03 -07:00
Matt Bishop
394e91d639 Handle null cipher or organization with event submission (#6509)
* Handle null cipher

* Check for an org being null too

* Add unit and integration tests

* Clean up unused members
2025-10-28 16:31:05 -04:00
renovate[bot]
880a1fd13d [deps] Auth: Update webpack to v5.102.1 (#6445)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-28 15:10:25 -04:00
Bryan Cunningham
d307b843f9 Revert "[deps]: Update mjml to v4.16.1 (#6391)" (#6510)
This reverts commit a111aa9fcd.
2025-10-28 14:33:48 -04:00
renovate[bot]
a111aa9fcd [deps]: Update mjml to v4.16.1 (#6391)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Bryan Cunningham <bryan.cunningham@me.com>
2025-10-28 12:22:02 -04:00
Graham Walker
2b10907ef3 PM-26966 added new metric columns to organization report table (#6486)
* PM-26966 added new metric columns to organization report table

* PM-26966 fixing migration

* PM-26966 fixing formatting issue.

* PM-26966 updating unit tests

* PM-26966 fixing SQL to read from view
2025-10-28 11:17:45 -05:00
Oscar Hinton
653de07bd7 [PM-23493] Generic mailer proposal (#5958)
This implements a new Mailer service which supersedes the `HandlebarsMailService`. It allows teams to create emails without having to extend a generic service.

The `IMailer` only contains a single method, `SendEmail`, which sends an instance of `BaseMail`.
2025-10-28 15:55:36 +01:00
Alex Morask
62a0936c2e [PM-25183] Update the BitPay purchasing procedure (#6396)
* Revise BitPay controller

* Run dotnet format

* Kyle's feedback

* Run dotnet format

* Temporary logging

* Whoops

* Undo temporary logging
2025-10-28 09:31:59 -05:00
Kyle Spearrin
02be34159d fix(vuln): Change OTP and Email providers to use time-constant equality operators
Co-authored-by: Todd Martin <106564991+trmartin4@users.noreply.github.com>
2025-10-28 09:51:24 -04:00
renovate[bot]
76d7534d85 [deps] Auth: Update sass to v1.93.2 (#6324)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Patrick-Pimentel-Bitwarden <ppimentel@bitwarden.com>
2025-10-27 21:42:18 -04:00
Patrick-Pimentel-Bitwarden
a71eaeaed2 feat(prevent-bad-existing-sso-user): [PM-24579] Prevent Existing Non Confirmed and Accepted SSO Users (#6348)
* feat(prevent-bad-existing-sso-user): [PM-24579] Precent Existing Non Confirmed and Accepted SSO Users - Added in logic to block existing sso org users who are not in the confirmed or accepted state.

* fix(prevent-bad-existing-sso-user): [PM-24579] Precent Existing Non Confirmed and Accepted SSO Users - Added docs as well as made clear what statuses are permissible.

* test(prevent-bad-existing-sso-user): [PM-24579] Precent Existing Non Confirmed and Accepted SSO Users - Added tests.
2025-10-27 14:21:24 -04:00
Brant DeBow
df1d7184f8 Add template context fields for Elastic integration (#6504) 2025-10-27 13:23:01 -04:00
cyprain-okeke
427600d0cc [PM-26194] Fix: Provider Portal not automatically disabled, when subscription is cancelled (#6480)
* Add the fix for the bug

* Move the org disable to job
2025-10-27 13:19:42 +01:00
Rui Tomé
9b313d9c0a [PM-25923] Simplify and align response models for Organization members and Provider users (#6385)
* Update ProviderUserOrganizationDetailsView to include SSO configuration data

* Updated the ProviderUserOrganizationDetailsViewQuery to join with SsoConfigs and select SSO-related fields.
* Modified the SQL view to reflect the inclusion of SSO configuration data.
* Added a new migration script for the updated view structure.

* Add SSO configuration properties to ProviderUserOrganizationDetails model

* Add SSO configuration handling to ProfileProviderOrganizationResponseModel

* Introduced properties for SSO configuration, including SSO enabled status and KeyConnector details.
* Implemented deserialization of SSO configuration data to populate new fields in the response model.

* Add integration tests for ProviderUserRepository.GetManyOrganizationDetailsByUserAsync

* Add BaseUserOrganizationDetails model to encapsulate common properties

* Introduced a new abstract class to define shared properties for organization users and provider organization users

* Add BaseProfileOrganizationResponseModel to encapsulate organization response properties

* Introduced a new abstract class that ensures all properties are fully populated for profile organization responses.

* Update ProviderUserOrganizationDetailsViewQuery to include missing ProviderUserId

* Refactor OrganizationUserOrganizationDetails and ProviderUserOrganizationDetails to inherit from BaseUserOrganizationDetails

* Updated both models to extend BaseUserOrganizationDetails, promoting code reuse and ensure they have the same base properties

* Refactor ProfileOrganizationResponseModel and ProfileProviderOrganizationResponseModel to inherit from BaseProfileOrganizationResponseModel

* Refactor ProviderUserRepositoryTests to improve organization detail assertions

* Consolidated assertions for organization details into a new method, AssertProviderOrganizationDetails, enhancing code readability and maintainability.
* Updated test cases to verify all relevant properties for organizations with and without SSO configurations.

* Add integration test for GetManyDetailsByUserAsync to verify SSO properties

* Implemented a new test case to ensure that the SSO properties are correctly populated for organizations with and without SSO configurations.
* The test verifies the expected behavior of the method when interacting with the user and organization repositories, including cleanup of created entities after the test execution.

* Add unit tests for ProfileOrganizationResponseModel and ProfileProviderOrganizationResponseModel

* Introduced tests to validate the constructors of ProfileOrganizationResponseModel and ProfileProviderOrganizationResponseModel, ensuring that all properties are populated correctly based on the provided organization details.
* Verified expected behavior for both organization and provider models, including SSO configurations and relevant properties.

* Update SyncControllerTests.Get_ProviderPlanTypeProperlyPopulated to nullify SSO configurations in provider user organization details

* Refactor BaseProfileOrganizationResponseModel and ProfileOrganizationResponseModel for null safety

Updated properties in BaseProfileOrganizationResponseModel and ProfileOrganizationResponseModel to support null safety by introducing nullable types where appropriate.

* Enhance null safety in BaseUserOrganizationDetails and OrganizationUserOrganizationDetails

Updated properties in BaseUserOrganizationDetails and OrganizationUserOrganizationDetails to support null safety by introducing nullable types where appropriate, ensuring better handling of potential null values.

* Move common properties from ProfileOrganizationResponseModel to BaseProfileOrganizationResponseModel

* Refactor organization details: Remove BaseUserOrganizationDetails and introduce IProfileMemberOrganizationDetails interface for improved structure and clarity in organization user data management.

* Enhance OrganizationUserOrganizationDetails: Implement IProfileMemberOrganizationDetails interface

* Refactor ProviderUserOrganizationDetails: Implement IProfileMemberOrganizationDetails interface

* Refactor ProfileOrganizationResponseModelTests and ProfileProviderOrganizationResponseModelTests: Update constructors to utilize Organization and ProviderUserOrganizationDetails, enhancing property population and test coverage.

* Enhance ProviderUserOrganizationDetails: Add UseResetPassword, UseSecretsManager, and UsePasswordManager properties to the query and SQL views

* Update BaseProfileOrganizationResponseModel documentation: Clarify purpose and usage of organization properties for OrganizationUsers and ProviderUsers.

* Rename ProfileOrganizationResponseModel to ProfileMemberOrganizationResponseModel, update references and update related test names

* Add XML documentation for ProfileMemberOrganizationResponseModel and ProfileProviderOrganizationResponseModel to clarify their purpose and relationships

* Remove unnecessary cleanup code from OrganizationUserRepositoryTests

* Remove unnecessary cleanup code from ProviderUserRepositoryTests

* Rename test method in ProviderUserRepositoryTests to improve clarity on property population

* Add CreateFullOrganization method to ProviderUserRepositoryTests for improved organization setup in tests

* Refactor organization creation in tests to use CreateTestOrganizationAsync for consistency and improved setup

* Rename IProfileMemberOrganizationDetails to IProfileOrganizationDetails

* Rename ProfileMemberOrganizationResponseModel back to ProfileOrganizationResponseModel

* Refactor organization response models to remove Family Sponsorship properties from BaseProfileOrganizationResponseModel and reintroduce them in ProfileOrganizationResponseModel. Update related interfaces and tests accordingly.

* Bump date on migration script

* Update OrganizationUserOrganizationDetailsViewQuery to include UseAutomaticUserConfirmation property
2025-10-24 20:42:28 +01:00
Mick Letofsky
bd52cf56e7 Implement reusable Claude code review workflow (#6476) 2025-10-24 18:18:27 +02:00
Mick Letofsky
86eb86dac5 Update Claude owners (#6493) 2025-10-24 16:04:22 +02:00
Shane Melton
0b4ce8765e [PM-23904] Add risk insights for premium feature flag (#6491) 2025-10-24 09:42:10 -04:00
Stephon Brown
ff4b3eb9e5 [PM-27123] Account Credit not Showing for Premium Upgrade Payment (#6484)
* feat(billing): add PaymentMethod union

* feat(billing):  add nontokenized payment method

* feat(billing): add validation for tokinized and nontokenized payments

* feat(billing): update and add payment method requests

* feat(billing): update command with new union object

* test(billing): add tests for account credit for user.

* feat(billing): update premium cloud hosted subscription request

* fix(billing): dotnet format

* tests(billing): include payment method tests

* fix(billing): clean up tests and converter method
2025-10-23 14:47:23 -04:00
Conner Turnbull
b15913ce73 Fix HubHelpers field references causing build error (#6487) 2025-10-23 16:04:47 +02:00
Maciej Zieniuk
dd1f0a120a Notifications service unit test coverage with small refactor (#6126) 2025-10-23 14:40:57 +02:00
Brant DeBow
69f0464e05 Refactor Azure Service Bus to use the organization id as a partition key (#6477)
* Refactored Azure Service Bus to use the organization id as a partition key

* Use null for partition key instead of empty string when organization id is null
2025-10-23 08:08:09 -04:00
Nik Gilmore
76de64263c [PM-22992] Check cipher revision date when handling attachments (#6451)
* Add lastKnownRevisionDate to Attachment functions

* Add lastKnownRevisionDate to attachment endpoints

* Change lastKnownCipherRevisionDate to lastKnownRevisionDate for consistency

* Add tests for RevisionDate checks in Attachment endpoints

* Improve validation on lastKnownRevisionDate

* Harden datetime parsing

* Rename ValidateCipherLastKnownRevisionDate - removed 'Async' suffix

* Cleanup and address PR feedback
2025-10-22 16:19:43 -07:00
Ike
9ce1ecba49 [PM-25240] Send Access OTP email in MJML format (#6411)
feat: Add MJML email templates for Send Email OTP
feat: Implement MJML-based email templates for Send OTP functionality
feat: Add feature flag support for Send Email OTP v2 emails
feat: Update email view models and call sites for Send Email OTP

fix: Modify the directory structure for MJML templates to have Auth directory for better team ownership
fix: Rename `hero.js` to `mj-bw-hero.js`

---
Co-authored-by: Todd Martin <106564991+trmartin4@users.noreply.github.com>
2025-10-22 15:13:31 -04:00
Alex Morask
6a3fc08957 [PM-26793] Fetch premium plan from pricing service (#6450)
* Fetch premium plan from pricing service

* Run dotnet format
2025-10-22 14:13:16 -05:00