1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 15:42:48 -05:00

[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 7fe022e26f.

* Use PricingClient in MaxProjectsQuery and limit to cloud-only (free 2-person)
This commit is contained in:
Alex Morask
2025-05-13 08:51:36 -04:00
committed by GitHub
parent a1b22e66e5
commit 082bfa3c6a
10 changed files with 38 additions and 229 deletions

View File

@ -1,7 +1,6 @@
using Bit.Core.AdminConsole.Entities;
using Bit.Core.AdminConsole.Entities.Provider;
using Bit.Core.AdminConsole.Repositories;
using Bit.Core.Billing.Pricing;
using Bit.Core.Enums;
using Bit.Core.Exceptions;
using Bit.Core.Models.Business;
@ -9,7 +8,6 @@ using Bit.Core.OrganizationFeatures.OrganizationLicenses;
using Bit.Core.Platform.Installations;
using Bit.Core.Services;
using Bit.Core.Test.AutoFixture;
using Bit.Core.Utilities;
using Bit.Test.Common.AutoFixture;
using Bit.Test.Common.AutoFixture.Attributes;
using NSubstitute;
@ -78,10 +76,8 @@ public class CloudGetOrganizationLicenseQueryTests
sutProvider.GetDependency<IInstallationRepository>().GetByIdAsync(installationId).Returns(installation);
sutProvider.GetDependency<IPaymentService>().GetSubscriptionAsync(organization).Returns(subInfo);
sutProvider.GetDependency<ILicensingService>().SignLicense(Arg.Any<ILicense>()).Returns(licenseSignature);
var plan = StaticStore.GetPlan(organization.PlanType);
sutProvider.GetDependency<IPricingClient>().GetPlan(organization.PlanType).Returns(plan);
sutProvider.GetDependency<ILicensingService>()
.CreateOrganizationTokenAsync(organization, installationId, subInfo, plan.SecretsManager.MaxProjects)
.CreateOrganizationTokenAsync(organization, installationId, subInfo)
.Returns(token);
var result = await sutProvider.Sut.GetLicenseAsync(organization, installationId);