1
0
mirror of https://github.com/bitwarden/server.git synced 2025-05-28 23:04:50 -05:00

459 Commits

Author SHA1 Message Date
tangowithfoxtrot
88159d16bb
Merge branch 'main' into test-container-workflow-changes 2025-05-21 07:27:59 -07:00
Alex Morask
18d146406c
[PM-21099] (NO LOGIC) Organize Billing provider code (#5819)
* [NO LOGIC] Organize Billing provider code

* Run dotnet format

* Run dotnet format'

* Fixed using after merge

* Fixed test usings after merge
2025-05-21 09:04:30 -04:00
Rui Tomé
725a793863
[PM-15161] Create ProviderClientOrganizationSignUpCommand command (#5764)
* Extract OrganizationService.SignupClientAsync into new ResellerClientOrganizationSignUpCommand

* Refactor ResellerClientOrganizationSignUpCommand to remove unused dependencies and simplify SignupClientAsync method signature

* Add unit tests for ResellerClientOrganizationSignUpCommand

* Rename SignUpProviderClientOrganizationCommand

* Rename ProviderClientOrganizationSignUpCommand

* Register ProviderClientOrganizationSignUpCommand for dependency injection

* Refactor ProviderService to use IProviderClientOrganizationSignUpCommand for organization signup process

* Refactor error handling in ProviderClientOrganizationSignUpCommand to use constants for error messages

* Remove SignupClientAsync method from IOrganizationService and OrganizationService, along with associated unit tests
2025-05-20 14:35:47 +01:00
tangowithfoxtrot
8e399b8396
fmt: apply consistent spacing and rm redundant WORKDIR directive 2025-05-19 13:43:58 -07:00
tangowithfoxtrot
54f3d6b977
fix: rm extraneous source revision id arg 2025-05-19 13:42:49 -07:00
Alex Morask
7b3e2a80f4
[PM-21092] Set tax exemption to reverse charge for non-US business-use customers (#5812)
* Set automatic tax to enabled and tax exempt to reverse where applicable when ff is on

* Fix and add tests

* Run dotnet format

* Run dotnet format

* PM-21745: Resolve defect

* PM-21770: Resolve defect

* Run dotnet format'
2025-05-19 14:53:48 -04:00
tangowithfoxtrot
9d4a96b078
build: restore previous method for getting the GIT_HASH 2025-05-19 11:20:42 -07:00
tangowithfoxtrot
30369d9a8a
build: optimize for simpler builds over caching 2025-05-19 10:52:07 -07:00
Brandon Treston
b3f7265129
[PM-21727] Add feature to plan and license constructor (#5834)
* add feature to plan

* add license to ctor for old license file creation method
2025-05-16 17:30:51 -04:00
Alex Morask
d72d721684
Set BU trial length to 4 (#5824) 2025-05-16 09:00:40 -04:00
renovate[bot]
07de9aa8bc
[deps] Auth: Update expose-loader to v5.0.1 (#5688)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-15 15:41:19 -04:00
Alex Morask
53f7d9655e
[PM-20087] [PM-21104] Preview tax amount for organization trial initiation (#5787)
* [NO LOGIC] [PM-21104] Organize Core.Billing tax code

* Add PreviewTaxAmountCommand and expose through TaxController

* Add PreviewTaxAmountCommandTests

* Run dotnet format
2025-05-13 09:28:31 -04:00
Alex Morask
082bfa3c6a
[PM-21257] Revert MaxProjects license changes, limit MaxProjectsQuery to cloud-only for 2-person organizations (#5776)
* Revert "Add SmMaxProjects to OrganizationLicense (#5678)"

This reverts commit 7fe022e26fce3c3f032757e832df50e9478e6658.

* Use PricingClient in MaxProjectsQuery and limit to cloud-only (free 2-person)
2025-05-13 08:51:36 -04:00
Thomas Rittson
5b3d3d6e20
CommandResult and ValidationResult tweaks (#5772)
* Simplify and align CommandResult and ValidationResult.
  In particular, 1 error per Failure/Invalid.

* Move these files to a common namespace

* Remove unused code
2025-05-09 10:46:49 +10:00
Justin Baur
4fe99ab6ba
Revert "fix: build failures caused by bad merge"
This reverts commit 3e4639489b6b6c06b5a977a069002fe0c0eb2057.
2025-05-07 16:52:18 -04:00
Justin Baur
5909f6ef8e
Revert "Use IHttpMessageHandlerFactory For HTTP Communication"
This reverts commit c93be6d52b12599040d3c3d8a7b3bc854c6c6802.
2025-05-07 16:51:51 -04:00
Justin Baur
b1efa88c6d
Remove X509ChainCustomization activation code 2025-05-06 13:39:10 -04:00
tangowithfoxtrot
30e38a7136
Merge branch 'main' into feat/pm-14496-non-root-self-hosted-images 2025-05-06 10:14:12 -07:00
tangowithfoxtrot
b6322dd764
fix: try using .net core certificate handling 2025-05-06 10:12:23 -07:00
Alex Morask
7fe022e26f
Add SmMaxProjects to OrganizationLicense (#5678)
* Add SmMaxProjects to OrganizationLicense

* Run dotnet format
2025-05-05 09:48:43 -04:00
tangowithfoxtrot
4bbf003104
Merge branch 'main' into feat/pm-14496-non-root-self-hosted-images 2025-05-02 10:41:39 -07:00
Alex Morask
e77acbc5ad
[PM-19956] [PM-18795] Require provider payment method during setup behind FF (#5752)
* Require provider payment method during setup behind FF

* Fix failing test

* Run dotnet format

* Rui's feedback
2025-05-01 12:12:45 -04:00
tangowithfoxtrot
7a99f5dc5d
Revert "build: we don't need to copy the .git dir"
This reverts commit 32c2f6236a894534de09ffe847ffff064a7174bd.
2025-04-30 13:35:38 -07:00
tangowithfoxtrot
32c2f6236a
build: we don't need to copy the .git dir 2025-04-30 13:28:09 -07:00
tangowithfoxtrot
3e4639489b
fix: build failures caused by bad merge 2025-04-30 13:27:14 -07:00
tangowithfoxtrot
761e794f7f
Merge branch 'main' into feat/pm-14496-non-root-self-hosted-images 2025-04-30 12:44:44 -07:00
Alex Morask
db0079cebb
[PM-19009] Remove feature flag: pm-15179-add-existing-orgs-from-provider-portal (#5664)
* Remove feature flag

* Run dotnet format
2025-04-28 16:22:20 -04:00
Alex Morask
5184d10995
Create customer for client organization that was converted to BU upon unlinking (#5706) 2025-04-25 13:06:06 -04:00
tangowithfoxtrot
5bd7d2fa4a
feat: allow images to run as non-root user 2025-04-23 13:45:09 -07:00
renovate[bot]
d265e62f6d
[deps] Auth: Lock file maintenance (#5507)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Patrick-Pimentel-Bitwarden <ppimentel@bitwarden.com>
2025-04-23 15:59:20 -04:00
tangowithfoxtrot
c93be6d52b
Use IHttpMessageHandlerFactory For HTTP Communication
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
2025-04-23 11:25:43 -07:00
Todd Martin
465ec08f3a
fix(sso): Revert [deps] Auth: Update Duende.IdentityServer to 7.1.0
This reverts commit 4c5bf495f31f42036d492b088535b28590037aa1.
2025-04-22 10:02:47 -04:00
Alex Morask
4379e326a5
Revert "[PM-20264] Replace StaticStore with PricingClient in `MaxProjects…" (#5665)
This reverts commit e943a2f051a254c4a031f39f2638d418bdd2e4a2.
2025-04-17 14:37:11 -04:00
Alex Morask
e943a2f051
[PM-20264] Replace StaticStore with PricingClient in MaxProjectsQuery (#5651)
* Replace StaticStore with PricingClient in MaxProjectsQuery

* Run dotnet format
2025-04-16 12:35:44 -04:00
Alex Morask
54e7fac4d9
[PM-18770] Convert Organization to Business Unit (#5610)
* [NO LOGIC] Rename MultiOrganizationEnterprise to BusinessUnit

* [Core] Add IMailService.SendBusinessUnitConversionInviteAsync

* [Core] Add BusinessUnitConverter

* [Admin] Add new permission

* [Admin] Add BusinessUnitConverterController

* [Admin] Add Convert to Business Unit button to Organization edit page

* [Api] Add OrganizationBillingController.SetupBusinessUnitAsync action

* [Multi] Propagate provider type to sync response

* [Multi] Put updates behind feature flag

* [Tests] BusinessUnitConverterTests

* Run dotnet format

* Fixing post-main merge compilation failure
2025-04-10 10:06:16 -04:00
Jared McCannon
0d7363c6af
[PM-16811] - SCIM Invite Users Optimizations (#5398)
* WIP changes for Invite User optimization from Scim

* feature flag string

* Added plan validation to PasswordManagerInviteUserValidation. Cleaned up a few things.

* Added Secrets Manager Validations and Tests.

* Added bulk procedure for saving users, collections and groups from inviting. Added test to validate Ef and Sproc

* Created SendOrganizationInvitesCommand and moved some tests from OrgServiceTests. Fixed some tests in org service in relation to moving out SendOrgInviteCommand code.

Added side effects to InviteOrganizationUsersCommand

* First test of new command.

* Added test to verify valid request with a user calls db method and sends the invite

* Added more tests for the updates

* Added integration test around enabling feature and sending invite via scim. Did a bit of refactoring on the SM validation. Fixed couple bugs found.

* Switching over to a local factory.

* created response model and split interface out.

* switched to initialization block

* Moved to private method. Made ScimInvite inherit the single invite base model. Moved create methods to constructors. A few more CR changes included.

* Moved `FromOrganization` mapper method to a constructor

* Updated to use new pricing client. Supressed null dereference errors.

* Fixing bad merge.

* Rename of OrgDto

* undoing this

* Moved into class

* turned into a switch statement

* Separated into separate files.

* Renamed dto and added ctor

* Dto rename. Moved from static methods to ctors

* Removed unused request model

* changes from main

* missed value

* Fixed some compilation errors.

* Fixed some changes.

* Removed comment

* fixed compiler warning.

* Refactored to use new ValidationResult pattern. added mapping method.

* Added throwing of Failure as the previous implementation would have.

* Cleaned up return.

* fixing test.

* Made HasSecretsManagerStandalone return if org doesn't have sm. Added overload for lighter weight model and moved common code to private method.

* Fixed tests.

* Made public method private. added some comments.

* Refactor validation parameter to improve clarity and consistency. Added XML doc

* fixed test

* Removed test only constructor from InviteOrganization

* Separated old and new code explicitly. Moved old code checks down into new code as well. Added error and mapper to Failure<T>

* Variable/Field/Property renames

* Renamed InviteUsersValidation to InviteUsersValidator

* Rename for InvitingUserOrganizationValidation to InvitingUserOrganizationValidator

* PasswordManagerInviteUserValidation to PasswordManagerInviteUserValidator

* Moved XML comment. Added check to see if additional seats are needed.

* Fixing name.

* Updated names.

* Corrected double negation.

* Added groups and collection and users checks.

* Fixed comment. Fixed multiple enumeration. Changed variable name.

* Cleaned up DTO models. Moved some validation steps around. A few quick fixes to address CR concerns. Still need to move a few things yet.

* Fixed naming in subscription update models.

* put back in the request for now.

* Quick rename

* Added provider email addresses as well.

* Removed valid wrapper to pass in to validation methods.

* fix tests

* Code Review changes.

* Removed unused classes

* Using GetPlanOrThrow instead.

* Switches to extension method

* Made Revert and Adjust Sm methods consistent. Corrected string comparer. Added comment for revert sm.

* Fixing compiler complaint.

* Adding XML docs

* Calculated seat addition for SM.

* Fixing compiler complaints.

* Renames for organization.

* Fixing comparison issue.

* Adding error and aligning message.

* fixing name of method.

* Made extension method.

* Rearranged some things. Fixed the tests.

* Added test around validating the revert.

* Added test to validate the provider email is sent if org is managed by a provider.

* Created new errors and removed references in business code to ErrorMessages property. This aligns Invite User code to use Errors instead of ErrorMessages

* Delayed the hasSecretsManagerStandalone call as long as possible.

* Corrected model name. Corrected SM seat calculation. Added test for it.

* Corrected logic and added more tests.
2025-04-07 09:14:10 -05:00
Alex Morask
282e80ca02
[PM-13837] Switch provider price IDs (#5518)
* Add ProviderPriceAdapter

This is a temporary utility that will be used to manage retrieval of provider price IDs until all providers can be migrated to the new price structure.

* Updated ProviderBillingService.ChangePlan

* Update ProviderBillingService.SetupSubscription

* Update ProviderBillingService.UpdateSeatMinimums

* Update ProviderBillingService.CurrySeatScalingUpdate

* Mark StripeProviderPortalSeatPlanId obsolete

* Run dotnet format
2025-04-03 08:51:09 -04:00
Jonas Hendrickx
b309de141d
[PM-19147] Automatic Tax Improvements (#5545)
* Pm 19147 2 (#5544)

* Pm 19147 2 (#5544)

* Unit tests for tax strategies `GetUpdateOptions`

* Only allow automatic tax flag to be updated for complete subscription updates such as plan changes, not when upgrading additional storage, seats, etc

* unit tests for factory

* Fix build

* Automatic tax for tax estimation

* Fix stub

* Fix stub

* "customer.tax_ids" isn't expanded in some flows.

* Fix SubscriberServiceTests.cs

* BusinessUseAutomaticTaxStrategy > SetUpdateOptions tests

* Fix ProviderBillingServiceTests.cs
2025-04-02 13:47:48 -04:00
Jared McCannon
786b0edceb
[PM-18527] - Fix allowing restored user to own multiple free orgs (#5444)
* Moved RestoreUserAsync and RestoreUsersAsync to Command.

* Fixing the bug.

* Added test for bulk method.

* Fixing sonar cube warning.

* SonarQube warning fix.

* Excluding org users we already have.

* Fixed misspelling. Added integration test for method.

* test had the misspelling as well 🤦

* Split out interface. Added admin and confirmed constraints.

* fixed queries and added xml comments and tests.
2025-03-31 08:33:57 -05:00
Thomas Rittson
54f4ba945e
[PM-17558] Remove ShortcutDuplicatePatchRequests feature flag (#5551)
* Delete old command and feature flag switch

* Rename vNext command

* Remove feature flag
2025-03-27 10:13:56 -04:00
Alex Morask
7daf6cfad4
[PM-18794] Allow provider payment method (#5500)
* Add PaymentSource to ProviderSubscriptionResponse

* Add UpdatePaymentMethod to ProviderBillingController

* Add GetTaxInformation to ProviderBillingController

* Add VerifyBankAccount to ProviderBillingController

* Add feature flag
2025-03-14 11:33:24 -04:00
Alex Morask
fa90991270
[PM-12601] Add discount to MSP during creation in Admin Portal (#5391)
* Add Provider DiscountId to database and Stripe customer

* Fix tests

* Add missing EF migrations

* Run dotnet format
2025-03-05 14:59:15 -05:00
renovate[bot]
4c5bf495f3
[deps] Auth: Update Duende.IdentityServer to 7.1.0 (#5293)
* [deps] Auth: Update Duende.IdentityServer to 7.1.0

* fix(identity): fixing name space for Identity 7.1.0 update

* fix: formatting

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ike Kottlowski <ikottlowski@bitwarden.com>
2025-02-27 09:54:28 -05:00
Alex Morask
a2e665cb96
[PM-16684] Integrate Pricing Service behind FF (#5276)
* Remove gRPC and convert PricingClient to HttpClient wrapper

* Add PlanType.GetProductTier extension

Many instances of StaticStore use are just to get the ProductTierType of a PlanType, but this can be derived from the PlanType itself without having to fetch the entire plan.

* Remove invocations of the StaticStore in non-Test code

* Deprecate StaticStore entry points

* Run dotnet format

* Matt's feedback

* Run dotnet format

* Rui's feedback

* Run dotnet format

* Replacements since approval

* Run dotnet format
2025-02-27 07:55:46 -05:00
renovate[bot]
0f10ca52b4
[deps] Auth: Lock file maintenance (#5301)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-24 15:45:39 -05:00
renovate[bot]
d8cf658207
[deps] Auth: Update sass to v1.85.0 (#4947)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-21 19:35:39 +00:00
Alex Morask
228ce3b2e9
Scale seats before inserting ProviderOrganization when adding existing organization (#5420) 2025-02-19 12:01:11 -05:00
Alex Morask
4f73081e41
Give provider credit for unused client organization time (#5421) 2025-02-19 10:13:03 -05:00
Thomas Rittson
54d59b3b92
[PM-16812] Shortcut duplicate group patch requests (#5354)
* Copy PatchGroupCommand to vNext and refactor

* Detect duplicate add requests and return early

* Update read repository method to use HA replica

* Add new write repository method
2025-02-14 11:09:01 +10:00
Rui Tomé
459c91a5a9
[PM-13748] Remove SCIM provider type checks from group endpoints (#5231)
* [PM-13748] Remove SCIM provider type checks from group endpoints

* Remove Okta provider type config from group command tests

---------

Co-authored-by: bnagawiecki <107435978+bnagawiecki@users.noreply.github.com>
2025-02-13 10:30:50 +00:00