Commit Graph

7320 Commits

Author SHA1 Message Date
renovate[bot]
16dbe96f19 [deps]: Update MarkDig to v1 (#7120)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: cyprain-okeke <108260115+cyprain-okeke@users.noreply.github.com>
2026-03-10 12:55:14 +01:00
Matt Gibson
bf9bc84da4 Existing device scene (#7155)
* Existing device scene

* Prefer usings

* Require namespaces

* Return the device id that is created
2026-03-10 09:33:46 +01:00
Mick Letofsky
465cbf3fb3 Reorganize seeder presets into purpose-based folders and remove obsolete presets (#7176) 2026-03-10 06:16:10 +01:00
Thomas Rittson
b35976bc0f Update UseMyItems to use dedicated plan feature (#7101) 2026-03-10 09:15:41 +10:00
Brandon Treston
49ec89d821 remove flagged logic (#7179) 2026-03-09 16:43:50 -04:00
Alex Morask
ed861d89f8 [PM-32581] Refactor organization subscription update process (#7132)
* chore: add CLAUDE.local.md and .worktrees to gitignore

* feat(billing): add Stripe interval and payment behavior constants and feature flag

* feat(billing): add OrganizationSubscriptionChangeSet model and unit tests

* refactor(billing): rename UpdateOrganizationSubscriptionCommand to BulkUpdateOrganizationSubscriptionsCommand

* feat(billing): add UpdateOrganizationSubscriptionCommand with tests

* feat(billing): use UpdateOrganizationSubscriptionCommand in BulkUpdateOrganizationSubscriptions behind feature flag

* feat(billing): use UpdateOrganizationSubscriptionCommand in SetUpSponsorshipCommand behind feature flag

* feat(billing): add UpgradeOrganizationPlanVNextCommand with tests and feature flag gate

* feat(billing): use UpdateOrganizationSubscriptionCommand in OrganizationService.AdjustSeatsAsync behind feature flag

* feat(billing): use UpdateOrganizationSubscriptionCommand in UpdateSecretsManagerSubscriptionCommand behind feature flag

* feat(billing): use UpdateOrganizationSubscriptionCommand in BillingHelpers.AdjustStorageAsync behind feature flag

* chore: run dotnet format

* fix(billing): missed optional owner in OrganizationBillingService.Finalize after merge

* refactor(billing): address PR feedback on UpdateOrganizationSubscription
2026-03-09 15:37:51 -05:00
Stephon Brown
4732d7fcd2 [PM-33061] Tax Id Should Be Added When Upgrading to Teams or Enterprise (#7131)
* refactor(billing): change billing address request type

* feat(billing): add tax id support for international business plans

* feat(billing): add billing address tax id handling

* test: add tests for tax id handling during upgrade

* fix(billing): run dotnet format

* fix(billing): remove extra line

* fix(billing): modify return type of HandleAsync

* test(billing): update tests to reflect updated command signature

* fix(billing): run dotnet format

* tests(billing): fix tests

* test(billing): format
2026-03-09 17:27:15 +00:00
Samuel Warfield
d86b7fa584 [PM-27864] Add PQC TLS Support (#6547)
* Add PQC TLS Support

* Update util/Setup/NginxConfigBuilder.cs

Co-authored-by: Addison Beck <github@addisonbeck.com>

* Update util/Setup/NginxConfigBuilder.cs

Co-authored-by: Addison Beck <github@addisonbeck.com>

* Update util/Setup/NginxConfigBuilder.cs

Co-authored-by: Addison Beck <github@addisonbeck.com>

* Update util/Setup/NginxConfigBuilder.cs

Co-authored-by: Addison Beck <github@addisonbeck.com>

* Update util/Setup/Templates/NginxConfig.hbs

Co-authored-by: Vince Grassia <593223+vgrassia@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Vince Grassia <593223+vgrassia@users.noreply.github.com>

---------

Co-authored-by: Addison Beck <github@addisonbeck.com>
Co-authored-by: Vince Grassia <593223+vgrassia@users.noreply.github.com>
2026-03-09 13:06:57 -04:00
Ike
df09fb6916 [PM-32424] Send Access Enumeration protection (#7166)
feat: add enumeration protection to email protected sends

- Implement enumeration protection for email-based protected sends
- Update SendAccess validator with new protection logic
- Change OTP generation failure logging from warning to error level
- Remove unused constants and update validator tests
2026-03-09 12:46:48 -04:00
Jared Snider
94784bb538 Revert "Revert "refactor(IdentityTokenResponse): [Auth/PM-3287] Remove deprec…" (#7152)
This reverts commit e6c97bd850.
2026-03-09 12:33:08 -04:00
Jared Snider
d6cb80a2b8 Auth/PM-32821 - Finish cleaning up old registration endpoint (#7097) 2026-03-09 12:30:51 -04:00
Jared Snider
72226eb33a Auth/PM-32487 - Emergency Access - invite or update - require min value of 1 for wait time in days. (#7168) 2026-03-09 12:27:33 -04:00
Jared McCannon
f820b7ec87 [PM-18236] - Use Single Org Requirement (#6999)
* Added new methods and ff for single org req

* Changed req messages and added new method for creating orgs

* Updated Requirement and Tests.

* Updated commands and requirement to take a list of org users

* Updated xml docs and renamed to be consistent

* Changes from Code Review

* Removed feature flag check for policy requirements around single org. Aligned error message with what other commands were returning.

* Fixed test names. Updated error messages to be specific for each caller.

* Updated tests to clean up details consturction

* Added test for confirmed accepted user in another org.

* fixed tests to use new factory

* Update test/Core.Test/AdminConsole/OrganizationFeatures/OrganizationUsers/RestoreUser/RestoreOrganizationUserCommandTests.cs

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

* Fixed tests by adding no op for req.

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
2026-03-09 10:55:55 -05:00
renovate[bot]
87d16f1bd0 [deps]: Update MarkDig to 0.45.0 (#7117)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-09 10:51:52 -05:00
Jared
f2dab14188 [PM-25860] Rid of bulk delete error (#6925)
* Rid of bulk delete error

* Fix test

* Fix for test

* Update src/Core/Dirt/Services/Implementations/EventService.cs

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

* Fix formatting issues in DeleteCollectionCommandTests.cs by removing hidden characters and ensuring proper using directives.

* Update src/Core/Dirt/Services/Implementations/EventService.cs

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

* Update src/Core/Dirt/Services/Implementations/EventService.cs

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

* Refactor DeleteCollectionCommandTests.cs to remove hidden characters and improve argument matching for GetManyByManyIdsAsync method.

* Fix deletion error happening in Postgres by utilizing OrganizationId which is always populated by the table row

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
2026-03-09 11:41:29 -04:00
Todd Martin
9efe632e7f chore(flags): [PM-32554] Remove pm-24579-prevent-sso-on-existing-non-compliant-users feature flag
* Remove flag.

* Removed unneccessary dependency

* Remove unnecessary dependency.

* Removed additional temporary test fixtures.

---------

Co-authored-by: Jared Snider <116684653+JaredSnider-Bitwarden@users.noreply.github.com>
2026-03-09 11:36:24 -04:00
Jared Snider
76677899f0 Auth/PM-32416 - Add MultiClientPasswordManagement feature flag (#7169) 2026-03-09 11:05:31 -04:00
Patrick-Pimentel-Bitwarden
3cf94a97b4 fix(feature-flag): [PM-27085] Account Register Uses New Data Types - Removed unnneded feature flag. (#7127) 2026-03-09 10:29:35 -04:00
Jonathan Prusik
693ea0b0fa [PM-33091] Add optional Targeting Rules data resource configuration (#7137)
* add fillAssistRules to environment URIs in config

* add tests

* do not include json file specification in path

* fix warnings
2026-03-09 09:50:53 -04:00
Github Actions
63ca7faf71 Bumped version to 2026.3.0 2026-03-09 10:51:54 +00:00
John Harrington
8d9ace60e2 [PM-33219] Resolve silent auth removal on Sends (#7160)
* remove null assignment to auth props and update tests

* update PutRemoveAuth comment for clarity and assign null to empty email list allowing future client side changes to remove ALL emails

* update test to match email removal expectation

* implement expected behavior and update tests

---------

Co-authored-by: Alex Dragovich <46065570+itsadrago@users.noreply.github.com>
2026-03-06 10:35:53 -08:00
Todd Martin
fa5fde5b94 chore(deps): Add Renovate ownership of MessagePack pinned transitive dependency 2026-03-05 13:19:57 -05:00
Jared Snider
9a14dc1345 PM-21720 - RegisterFinishResponseModel - clean up deprecated CaptchaBypassToken (#7098) 2026-03-05 12:42:59 -05:00
Ike
0d88aa1ca1 [PM-21925] Add MasterPasswordSalt Column to User Table (#6950)
feat: add MasterPasswordSalt column to User table

- Add MasterPasswordSalt column to User table in both Dapper and EF implementations
- Update User stored procedures (Create, Update, UpdateMasterPassword) to handle salt column
- Add EF migrations and update UserView with dependent views
- Set MaxLength constraint on MasterPasswordSalt column
- Update UserRepository implementations to manage salt field
- Add comprehensive test coverage for salt handling and normalization
2026-03-05 11:47:08 -05:00
cyprain-okeke
153c175ed8 Add coupon support to invoice preview and subscription creation (#6994)
* Add coupon support to invoice preview and subscription creation

* Fix the build lint error

* Resolve the initial review comments

* fix  the failing test

* fix the build lint error

* Fix the failing test

* Resolve the unaddressed issues

* Fixed the deconstruction error

* Fix the lint issue

* Fix the lint error

* Fix the lint error

* Fix the build lint error

* lint error resolved

* remove the setting file

* rename the variable name  validatedCoupon

* Remove the owner property

* Update OrganizationBillingService tests to align with recent refactoring

- Remove GetMetadata tests as method no longer exists
- Remove Owner property references from OrganizationSale (removed in d7613365ed)
- Update coupon validation to use SubscriptionDiscountRepository instead of SubscriptionDiscountService
- Add missing imports for SubscriptionDiscount entities
- Rename test for clarity: Finalize_WithNullOwner_SkipsValidation → Finalize_WithCouponOutsideDateRange_IgnoresCouponAndProceeds

All tests passing (14/14)

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

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

* Fix the lint error

* Making the owner non nullable

* fix the failing unit test

* Make the owner nullable

* Fix the bug for coupon in Stripe with no audience restrictions(PM-32756)

* Return validation message for invalid coupon

* Update the valid token message

* Fix the failing unit test

* Remove the duplicate method

* Fix the failing build and test

* Resolve the failing test

* Add delete of invalid coupon

* Add the expired error message

* Delete on invalid coupon in stripe

* Fix the lint errors

* return null if we get exception from stripe

* remove the auto-delete change

* fix the failing test

* Fix the lint build error

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-03-05 17:08:40 +01:00
sven-bitwarden
43d3c414cc [PM-28519] Remove Emergency Access Contacts for AutoConfirm Org Flows (#7123)
* Remove emergency access from all organization users on policy enable, or when accepted/restored

* Use correct policy save system

* Add additional tests

* Implement both PreUpsert and OnSave side effects
2026-03-05 09:56:02 -06:00
Conner Turnbull
6b82875317 [PM-32594] Add authorization to admin-initiated sponsorship endpoints (#7095) 2026-03-05 15:00:40 +00:00
Isaiah Inuwa
dfc736fd20 Return WebAuthn credential record in create response (#7145)
* Return WebAuthn credential record in create response

* Make CreateWebAuthnLoginCredentialCommand null-safe
2026-03-05 08:47:41 -06:00
renovate[bot]
ea1468d2e2 [deps]: Update actions/checkout action to v6.0.2 (#6904)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-05 12:44:58 +01:00
sven-bitwarden
996f479900 Update PoliciesController.Put to forward all behavior to VNext (#7130) 2026-03-04 16:54:05 -06:00
Vijay Oommen
4785e62715 [PM-28531] Remove old proc and use new one (#7110) 2026-03-04 16:21:52 -06:00
Stephon Brown
6b2322de2a [PM-33140] Correct Non-Seat Plan Intial Seat Setting for Upgrade (#7140)
* refactor(billing): update seat logic

* test(billing): update tests for seat logic
2026-03-04 22:06:58 +00:00
Mick Letofsky
2e8807dbfd Disabling Claude attribution (#7146) 2026-03-04 16:30:30 -05:00
Daniel García
9c790a10d2 [PM-32249] Allow custom desktop protocol in CORS (#7080) 2026-03-04 22:09:09 +01:00
Jordan Aasen
2b663d73a1 add feature flag for welcome dialog no ext prompt (#7144) 2026-03-04 20:04:34 +00:00
Graham Walker
0a14d95779 PM-32517 Create Migration for Azure Blob Storage (#7111)
* PM-32517 initial migration commit

* pm-32517 fixing integration unit test

* PM-32517 removing .claude changes

* PM-32517 changing implementation of migration test

* PM-32517 adding type for ReportFile

* PM-32517 adding report file type

* PM-32517 changing unit tests

* PM-32517 adding new statement in migration script
2026-03-04 11:17:28 -06:00
cyprain-okeke
0de7c80804 [PM-32572]Premium to organization upgrade does not set public/private key pair or default collection (#7076)
* Resolve the bug

* Fix the failing test

* removed
2026-03-04 17:55:12 +01:00
Daniel James Smith
1b23447746 Remove Gitter chat badge from README (#7138)
Removed Gitter chat badge from README.
2026-03-04 16:28:31 +00:00
Isaiah Inuwa
165117fc2c [PM-33111] Improve WebAuthn API code generation (#7128)
* Mark WebAuthn PublicKeyCredential creation and assertion options fields as required

* Mark WebAuthn options binary fields as base64.
2026-03-04 07:34:18 -06:00
renovate[bot]
4e6f1b8733 [deps] Tools: Update MailKit to 4.15.0 (#7115)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Alex Dragovich <46065570+itsadrago@users.noreply.github.com>
2026-03-03 19:33:07 -08:00
Vince Grassia
df59502a0d Update publish workflow to take release branch name as input (#7135) 2026-03-04 01:47:02 +00:00
Thomas Rittson
1586c1ce14 [PM-33068] Fix Organization not found error when editing policy after signup (#7126)
The IApplicationCacheService implementation is defective and
does not synchronise between instances. Switch to using
the repository directly to ensure that the organization is always
available. This will be reverted when the cache is fixed.

---------

Co-authored-by: Jared McCannon <jmccannon@bitwarden.com>
2026-03-03 16:42:59 -05:00
Thomas Rittson
8ced0a76c5 [PM-33066] Remove feature flag from DisableSend and SendOptions PolicyRequirements (#7125) 2026-03-04 07:39:58 +10:00
Stephon Brown
ee84237643 [PM-30271] Create Retrieve Eligible Subscription Discounts Endpoint (#7063)
* feat(billing): add subscription discount response model

* feat(billing): implement discount audience filters

* feat(billing): introduce subscription discount service

* feat(billing): add query for applicable discounts

* feat(api): add endpoint for applicable discounts

* chore(billing): register new billing services and queries

* refactor(tests): rename discount audience filter test methods for clarity

* refactor(billing): remove unused Id property from SubscriptionDiscountResponseModel

* feat(billing): add feature flag to GetApplicableDiscountsAsync endpoint

* format(billing): dotnet format and remove pricing import

* refactor(billing): change discount audience filter factory to singleton

* test(discount): add test to verify filter retrieval for all audience types

* feat(billing): add DiscountTierType enum

* feat(billing): define Stripe product IDs and tier mapping

* feat(billing): introduce DiscountEligibility record

* feat(billing): update IDiscountAudienceFilter for tier eligibility

* feat(billing): add ListSubscriptionsAsync to IStripeAdapter

* feat(billing): implement ListSubscriptionsAsync in StripeAdapter

* feat(billing): implement AllUsersFilter for discount audience

* feat(billing): refactor UserHasNoPreviousSubscriptionsFilter for tier eligibility

* feat(billing): update DiscountAudienceFilterFactory for DI

* feat(billing): update ISubscriptionDiscountService for tier eligibility

* feat(billing): implement SubscriptionDiscountService tier eligibility

* feat(billing): update SubscriptionDiscountResponseModel with tier eligibility

* feat(billing): add GetTierEligibilityDictionary utility

* feat(billing): update GetApplicableDiscountsQuery to use tier eligibility

* chore(billing): update DI registrations for discount services

* test(billing): add/update unit tests for discount features

* fix(billing): remove unneeded import

* fix(billing): run dotnet format

* refactor(billing): remove unused Teams and Enterprise discount tiers

* refactor(billing): move DiscountEligibility to Models namespace

* refactor(billing): update discount audience filter DI to scoped

* perf(billing): optimize UserHasNoPreviousSubscriptionsFilter with caching

* refactor(billing): remove StripeProductIds from subscription discount response model

* test(billing): update GetApplicableDiscountsQueryTests after StripeProductIds removal

* fix(billing): Run dotnet format
2026-03-03 13:39:10 -05:00
Rui Tomé
c97ccc1610 [PM-28795] Refactor organization accept-init flow with atomic database operations and upfront validation (#6831)
* Add integration tests for AcceptInit endpoint in OrganizationUsersController

* Add new feature flag for organization acceptance initialization refactor

* Add InitPendingOrganizationVNextAsync for consolidated organization initialization

Introduces a new method that consolidates organization initialization,
user confirmation, email verification, and collection creation into a
single operation with upfront validation.

Key improvements:
- All validation performed before any state changes
- Returns typed errors via CommandResult instead of throwing exceptions
- Reduces three separate command calls into one unified flow
- Maintains backward compatibility via feature flag

The existing InitPendingOrganizationAsync is marked obsolete and will be
removed after feature flag rollout completes.

* Add unit tests for InitPendingOrganizationVNextAsync method

Introduces comprehensive unit tests for the InitPendingOrganizationVNextAsync method, covering various scenarios including valid data initialization, error handling for invalid tokens, organization status checks, and user confirmation requirements.

Key additions:
- Tests for successful organization initialization and user confirmation.
- Error handling tests for invalid tokens, already enabled organizations, and mismatched organization IDs.
- Validation for existing keys and email mismatches.
- Support for creating default collections during initialization.

These tests enhance the reliability and robustness of the organization initialization process.

* Refactor AcceptInit method to support feature flag for organization initialization

Updated the AcceptInit method in OrganizationUsersController to return an IResult type and handle organization initialization based on a feature flag. If the feature is enabled, it utilizes the new InitPendingOrganizationVNextAsync method for atomic organization setup and user confirmation. Integration tests were added to verify the behavior under both feature flag states, ensuring proper initialization and error handling.

* Enhance InitPendingOrganizationCommand with policy validation and feature flag support

Updated the ValidatePoliciesAsync method to enforce the Automatic User Confirmation Policy when the feature flag is enabled. Added new unit tests to cover scenarios for automatic user confirmation and single organization policy violations, ensuring comprehensive validation during organization initialization. This improves error handling and maintains compliance with organizational policies.

* Add InitializePendingOrganizationAsync method for atomic organization initialization

Implemented the InitializePendingOrganizationAsync method in both Dapper and Entity Framework repositories to streamline the initialization of pending organizations. This method enables the organization, confirms the first owner, updates user details, and optionally creates a default collection, all within a single atomic transaction. Enhanced error handling ensures robustness during the initialization process.

* Add unit tests for InitializePendingOrganizationAsync method

Introduced several unit tests for the InitializePendingOrganizationAsync method, covering scenarios such as successful organization initialization with and without collections, exception handling for invalid organization IDs, and rollback behavior on errors. These tests enhance the reliability of the organization initialization process and ensure proper handling of various edge cases.

* Refactor InitPendingOrganizationCommand to use consolidated InitializePendingOrganizationAsync method

Replaced multiple asynchronous calls for organization initialization with a single call to the new InitializePendingOrganizationAsync method. This change streamlines the process by encapsulating organization setup, user confirmation, and collection creation into one atomic operation, enhancing maintainability and reducing complexity in the command logic.

* Enhance InitPendingOrganizationCommandTests with new test cases and refactor existing ones

Added a new test case for InitPendingOrganizationVNextAsync to validate organization initialization with a collection name. Refactored existing tests to improve clarity and maintainability, including the removal of redundant assertions and the consolidation of organization setup logic. This update strengthens the test coverage for the organization initialization process and ensures proper handling of various scenarios.

* Refactor IOrganizationRepository and OrganizationRepository to remove nullable collectionName parameter

Updated the IOrganizationRepository and OrganizationRepository interfaces to change the collectionName parameter from nullable to non-nullable. This change enforces stricter parameter requirements and improves data integrity during organization initialization processes.

* Improve error handling in OrganizationRepository by logging exceptions during transaction rollback

Updated the OrganizationRepository in both Dapper and Entity Framework implementations to log detailed error messages when exceptions occur during the initialization of pending organizations. This enhancement improves traceability and debugging capabilities by providing context on failures, ensuring better maintainability of the organization initialization process.

* Refactor OrganizationRepository to consolidate SaveChangesAsync calls

Updated the OrganizationRepository to reduce multiple SaveChangesAsync calls into a single call at the end of the transaction. This change enhances performance and ensures that all changes are committed atomically, improving the overall maintainability of the organization initialization process.

* refactor: Introduce InitPendingOrganizationRequest model and update InitPendingOrganizationVNextAsync method

- Created InitPendingOrganizationRequest to encapsulate parameters for initializing a pending organization.
- Refactored InitPendingOrganizationVNextAsync method to accept the new request model instead of multiple parameters.
- Updated OrganizationUsersController to use the new request model for improved readability and maintainability.
- Adjusted related tests to accommodate the new request structure.

* Create database update action delegate for organization initialization.

* Add BuildVerifyUserEmailAction method to IUserRepository and implementations in UserRepository classes

- Introduced a new method in IUserRepository to create an action for verifying user emails.
- Implemented the method in both Dapper and Entity Framework UserRepository classes to update the email verification status of users.
- Ensured that the method checks if the user's email is already verified before updating.

* Add BuildCreateDefaultCollectionAction method to ICollectionRepository and implementations in CollectionRepository classes

- Introduced a new method in ICollectionRepository to build an action for creating a default collection with user access.
- Implemented the method in both Dapper and Entity Framework CollectionRepository classes to handle collection creation and user access assignments.
- Enhanced the functionality to support transaction execution for database operations.

* Add BuildConfirmOrganizationUserAction method to IOrganizationUserRepository and implementations in OrganizationUserRepository classes

- Introduced a new method in IOrganizationUserRepository to build an action for confirming an organization user.
- Implemented the method in both Dapper and Entity Framework OrganizationUserRepository classes to handle user confirmation and status updates.
- Enhanced the functionality to support transaction execution for database operations.

* Refactor organization initialization methods in IOrganizationRepository and implementations

- Introduced BuildUpdateOrganizationAction method to create an action for updating organization properties during initialization.
- Replaced the InitializePendingOrganizationAsync method with ExecuteOrganizationInitializationUpdatesAsync to handle multiple update actions in a single transaction.
- Updated Dapper and Entity Framework implementations to support the new action-based approach for organization initialization, enhancing transaction management and code clarity.

* Add integration tests for ExecuteOrganizationInitializationUpdatesAsync

* Refactor InitPendingOrganizationCommand to streamline organization initialization process

- Introduced methods for preparing organization and organization user for initialization.
- Replaced direct calls to repository methods with a new action-based approach for executing multiple database updates in a single transaction.
- Enhanced test cases to validate the new initialization logic and ensure proper handling of organization states.

* Refactor organization user acceptance tests to utilize feature flags

- Converted existing tests to use [Theory] with [InlineData] for feature flag variations.
- Updated assertions to reflect expected status codes based on feature flag state.
- Enhanced user confirmation checks to ensure proper linking and email verification after acceptance.
- Improved test coverage for organization initialization scenarios with and without collections.

* Refactor BuildVerifyUserEmailAction to accept User entity instead of user ID

- Updated IUserRepository and its implementations to change the parameter of BuildVerifyUserEmailAction from Guid userId to User user.
- Modified related repository methods in Dapper and Entity Framework to utilize the User entity for email verification.
- Adjusted tests to reflect the new method signature, ensuring proper functionality and integration with the updated user verification process.

* Revert "Refactor BuildVerifyUserEmailAction to accept User entity instead of user ID"

This reverts commit 71047bee2a.

* Enhance InitPendingOrganizationCommand for null safety and error handling

- Removed nullable disable directive to enable null safety checks.
- Added a null check for the organization retrieval, throwing a BadRequestException if not found.
- Updated validation methods to return nullable Error types, improving error handling in the organization initialization process.

* Add remarks to IInitPendingOrganizationCommand for clarity on organization initialization

- Enhanced the documentation for the InitPendingOrganizationCommand interface by adding remarks to clarify the role of the user initializing the organization.
- Explained the default state assumptions during validation, emphasizing that no policies are enforced at this stage.

* Implement InitPendingOrganizationValidator for improved organization initialization validation

- Introduced IInitPendingOrganizationValidator interface and its implementation to encapsulate validation logic for organization initialization.
- Refactored InitPendingOrganizationCommand to utilize the new validator for token validation, user email matching, organization state checks, and policy enforcement.
- Enhanced dependency injection in OrganizationServiceCollectionExtensions to include the new validator.
- Added comprehensive unit tests for the validator to ensure robust validation logic and error handling.

* Update documentation in IInitPendingOrganizationCommand to clarify organization initialization process

- Revised the summary comment to specify that the method initializes a pending organization created via the Bitwarden Portal on behalf of a Reseller.
- Added a reference to the ResellerClientOrganizationSignUpCommand for better context.
- Emphasized the confirmation of the first owner during the initialization process.

* Update InitPendingOrganizationRequest to allow optional collection name

- Modified the CollectionName property to be nullable, allowing for no collection to be created if the value is null or empty.
- Enhanced documentation to clarify the optional nature of the CollectionName parameter.

* Fix nullability issue in InitPendingOrganizationCommand by enforcing non-null collection name assignment

* Refactor organization key handling in InitPendingOrganization features. Updated OrganizationUsersController to use new key pair data structure. Adjusted InitPendingOrganizationCommand and InitPendingOrganizationRequest to reflect changes in key management.

* Update organization key handling to use the name EncryptedOrganizationSymmetricKey. Refactor OrganizationUsersController, InitPendingOrganizationCommand, and InitPendingOrganizationRequest for consistency in key management.

* Refactor InitPendingOrganizationCommand to utilize TimeProvider for date handling. Updated methods to replace direct DateTime calls with _timeProvider.GetUtcNow().

* Refactor InitPendingOrganization validation methods to rename ValidateBusinessRulesAsync to ValidateFreeOrganizationLimitAsync for clarity and consistency. Updated related command and test files accordingly.

* Refactor InitPendingOrganizationCommand and related classes to streamline validation logic. Introduced InitPendingOrganizationValidationRequest for enriched validation context and updated methods to improve clarity and consistency in error handling. Adjusted tests to reflect changes in validation flow.

* Remove unused dependencies from InitPendingOrganizationCommand

* Refactor InitPendingOrganizationCommand to streamline organization initialization process. Replaced multiple update actions with a single atomic operation for organization and owner confirmation. Updated related repository interfaces and methods for improved clarity and consistency in transaction handling.

* Remove commented-out regions and clean up whitespace in InitPendingOrganizationCommandTests for improved readability.

* Remove unnecessary null check for organization in InitPendingOrganizationCommand

* Revert "Remove unnecessary null check for organization in InitPendingOrganizationCommand"

This reverts commit 1ad7148fc9.

* Refactor organization initialization actions to use DbConnection and DbTransaction instead of SqlConnection and SqlTransaction. Update related interfaces and implementations across repositories for improved database transaction handling.

* Refactor organization and organization user update logic to use null checks for entity existence. Throw exceptions for not found entities to improve error handling during initialization.

* Update InitPendingOrganizationCommandTests to use SendConfirmationAsync for email notifications and added missing using directive for OrganizationConfirmation.

* Remove unnecessary blank lines from CollectionRepository and UserRepository classes for improved code readability.

* Remove redundant test cases from OrganizationUsersControllerAcceptInitTests

* Enhance InitPendingOrganizationCommandTests to validate organization and user properties in repository interactions

* Update RefactorOrgAcceptInit feature flag key to new identifier pm-33082-refactor-org-accept-init
2026-03-03 17:50:31 +00:00
mkincaid-bw
cc12c72854 Update SQL version to SQL 2022 CU22. (#6926) 2026-03-03 08:24:17 -08:00
sven-bitwarden
5be9ccd67d [PM-24788] Remove Org-Based Policy Requirements Queries (#7038)
* Remove usage of policy requirements retrieval by org

* Simplify result model

* Return early if no restored confirmed users exist to create default collections for

* fix merge conflict flog

* Fix test mocks

---------

Co-authored-by: bnagawiecki <107435978+bnagawiecki@users.noreply.github.com>
2026-03-03 10:18:05 -06:00
Vince Grassia
2073d27381 Add multi-arch image support to Docker images (#7122) 2026-03-03 11:03:45 -05:00
Thomas Rittson
e383825de5 Delete temporary UseMyItems data migration tests (#7124) 2026-03-02 20:03:23 -06:00
Jared McCannon
07ead26009 [PM-30886] - Remove FF for Restoring Users (#7071)
* Cleaning up code around feature flag. removing old implementation. will remove flag in subsequent pr.

* Remove unused feature flag

* Fixing test from merge
2026-03-02 11:31:58 -06:00