mirror of
https://github.com/bitwarden/server.git
synced 2024-11-24 12:35:25 +01:00
SM-1012: Removing SM Beta (Phase 2) (#3663)
* SM-1012: Phase 2, removing SM Beta from the server (but not db) * SM-1012: Add migration for RemoveSMBetaFromOrganization * SM-1012: Dotnet format * SM-1012: Undo RemoveSMBetaFromOrganization EF migration * SM-1012: Redo RemoveSMBetaFromOrganization EF migration * SM-1012: Ran dotnet format
This commit is contained in:
parent
9bdb76d84b
commit
7cbe888b82
@ -26,7 +26,7 @@ public class CountNewServiceAccountSlotsRequiredQuery : ICountNewServiceAccountS
|
|||||||
throw new NotFoundException();
|
throw new NotFoundException();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!organization.SmServiceAccounts.HasValue || serviceAccountsToAdd == 0 || organization.SecretsManagerBeta)
|
if (!organization.SmServiceAccounts.HasValue || serviceAccountsToAdd == 0)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,6 @@ public class CountNewServiceAccountSlotsRequiredQueryTests
|
|||||||
{
|
{
|
||||||
organization.UseSecretsManager = true;
|
organization.UseSecretsManager = true;
|
||||||
organization.SmServiceAccounts = organizationSmServiceAccounts;
|
organization.SmServiceAccounts = organizationSmServiceAccounts;
|
||||||
organization.SecretsManagerBeta = false;
|
|
||||||
|
|
||||||
sutProvider.GetDependency<IOrganizationRepository>()
|
sutProvider.GetDependency<IOrganizationRepository>()
|
||||||
.GetByIdAsync(organization.Id)
|
.GetByIdAsync(organization.Id)
|
||||||
@ -62,7 +61,6 @@ public class CountNewServiceAccountSlotsRequiredQueryTests
|
|||||||
|
|
||||||
organization.UseSecretsManager = true;
|
organization.UseSecretsManager = true;
|
||||||
organization.SmServiceAccounts = null;
|
organization.SmServiceAccounts = null;
|
||||||
organization.SecretsManagerBeta = false;
|
|
||||||
|
|
||||||
sutProvider.GetDependency<IOrganizationRepository>()
|
sutProvider.GetDependency<IOrganizationRepository>()
|
||||||
.GetByIdAsync(organization.Id)
|
.GetByIdAsync(organization.Id)
|
||||||
@ -80,27 +78,6 @@ public class CountNewServiceAccountSlotsRequiredQueryTests
|
|||||||
.GetServiceAccountCountByOrganizationIdAsync(default);
|
.GetServiceAccountCountByOrganizationIdAsync(default);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory, BitAutoData]
|
|
||||||
public async Task CountNewServiceAccountSlotsRequiredAsync_WithSecretsManagerBeta_ReturnsZero(
|
|
||||||
int serviceAccountsToAdd,
|
|
||||||
Organization organization,
|
|
||||||
SutProvider<CountNewServiceAccountSlotsRequiredQuery> sutProvider)
|
|
||||||
{
|
|
||||||
organization.UseSecretsManager = true;
|
|
||||||
organization.SecretsManagerBeta = true;
|
|
||||||
|
|
||||||
sutProvider.GetDependency<IOrganizationRepository>()
|
|
||||||
.GetByIdAsync(organization.Id)
|
|
||||||
.Returns(organization);
|
|
||||||
|
|
||||||
var result = await sutProvider.Sut.CountNewServiceAccountSlotsRequiredAsync(organization.Id, serviceAccountsToAdd);
|
|
||||||
|
|
||||||
Assert.Equal(0, result);
|
|
||||||
|
|
||||||
await sutProvider.GetDependency<IServiceAccountRepository>().DidNotReceiveWithAnyArgs()
|
|
||||||
.GetServiceAccountCountByOrganizationIdAsync(default);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory, BitAutoData]
|
[Theory, BitAutoData]
|
||||||
public async Task CountNewServiceAccountSlotsRequiredAsync_WithNonExistentOrganizationId_ThrowsNotFound(
|
public async Task CountNewServiceAccountSlotsRequiredAsync_WithNonExistentOrganizationId_ThrowsNotFound(
|
||||||
Guid organizationId, int serviceAccountsToAdd,
|
Guid organizationId, int serviceAccountsToAdd,
|
||||||
|
@ -213,7 +213,6 @@ public class OrganizationsController : Controller
|
|||||||
var organization = await GetOrganization(id, model);
|
var organization = await GetOrganization(id, model);
|
||||||
|
|
||||||
if (organization.UseSecretsManager &&
|
if (organization.UseSecretsManager &&
|
||||||
!organization.SecretsManagerBeta &&
|
|
||||||
!StaticStore.GetPlan(organization.PlanType).SupportsSecretsManager)
|
!StaticStore.GetPlan(organization.PlanType).SupportsSecretsManager)
|
||||||
{
|
{
|
||||||
throw new BadRequestException("Plan does not support Secrets Manager");
|
throw new BadRequestException("Plan does not support Secrets Manager");
|
||||||
@ -363,7 +362,6 @@ public class OrganizationsController : Controller
|
|||||||
organization.UseTotp = model.UseTotp;
|
organization.UseTotp = model.UseTotp;
|
||||||
organization.UsersGetPremium = model.UsersGetPremium;
|
organization.UsersGetPremium = model.UsersGetPremium;
|
||||||
organization.UseSecretsManager = model.UseSecretsManager;
|
organization.UseSecretsManager = model.UseSecretsManager;
|
||||||
organization.SecretsManagerBeta = model.SecretsManagerBeta;
|
|
||||||
|
|
||||||
//secrets
|
//secrets
|
||||||
organization.SmSeats = model.SmSeats;
|
organization.SmSeats = model.SmSeats;
|
||||||
|
@ -70,7 +70,6 @@ public class OrganizationEditModel : OrganizationViewModel
|
|||||||
MaxAutoscaleSmSeats = org.MaxAutoscaleSmSeats;
|
MaxAutoscaleSmSeats = org.MaxAutoscaleSmSeats;
|
||||||
SmServiceAccounts = org.SmServiceAccounts;
|
SmServiceAccounts = org.SmServiceAccounts;
|
||||||
MaxAutoscaleSmServiceAccounts = org.MaxAutoscaleSmServiceAccounts;
|
MaxAutoscaleSmServiceAccounts = org.MaxAutoscaleSmServiceAccounts;
|
||||||
SecretsManagerBeta = org.SecretsManagerBeta;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public BillingInfo BillingInfo { get; set; }
|
public BillingInfo BillingInfo { get; set; }
|
||||||
@ -150,8 +149,6 @@ public class OrganizationEditModel : OrganizationViewModel
|
|||||||
public int? SmServiceAccounts { get; set; }
|
public int? SmServiceAccounts { get; set; }
|
||||||
[Display(Name = "Max Autoscale Service Accounts")]
|
[Display(Name = "Max Autoscale Service Accounts")]
|
||||||
public int? MaxAutoscaleSmServiceAccounts { get; set; }
|
public int? MaxAutoscaleSmServiceAccounts { get; set; }
|
||||||
[Display(Name = "Secrets Manager Beta")]
|
|
||||||
public bool SecretsManagerBeta { get; set; }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a Plan[] object for use in Javascript
|
* Creates a Plan[] object for use in Javascript
|
||||||
@ -210,7 +207,6 @@ public class OrganizationEditModel : OrganizationViewModel
|
|||||||
existingOrganization.MaxAutoscaleSmSeats = MaxAutoscaleSmSeats;
|
existingOrganization.MaxAutoscaleSmSeats = MaxAutoscaleSmSeats;
|
||||||
existingOrganization.SmServiceAccounts = SmServiceAccounts;
|
existingOrganization.SmServiceAccounts = SmServiceAccounts;
|
||||||
existingOrganization.MaxAutoscaleSmServiceAccounts = MaxAutoscaleSmServiceAccounts;
|
existingOrganization.MaxAutoscaleSmServiceAccounts = MaxAutoscaleSmServiceAccounts;
|
||||||
existingOrganization.SecretsManagerBeta = SecretsManagerBeta;
|
|
||||||
return existingOrganization;
|
return existingOrganization;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -174,10 +174,6 @@
|
|||||||
<input type="checkbox" class="form-check-input" asp-for="UseSecretsManager" disabled='@(canEditPlan ? null : "disabled")'>
|
<input type="checkbox" class="form-check-input" asp-for="UseSecretsManager" disabled='@(canEditPlan ? null : "disabled")'>
|
||||||
<label class="form-check-label" asp-for="UseSecretsManager"></label>
|
<label class="form-check-label" asp-for="UseSecretsManager"></label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check">
|
|
||||||
<input type="checkbox" class="form-check-input" asp-for="SecretsManagerBeta" disabled='@(canEditPlan ? null : "disabled")'>
|
|
||||||
<label class="form-check-label" asp-for="SecretsManagerBeta"></label>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@ -217,7 +213,7 @@
|
|||||||
|
|
||||||
@if (canViewPlan)
|
@if (canViewPlan)
|
||||||
{
|
{
|
||||||
<div id="organization-secrets-configuration" hidden="@(!Model.UseSecretsManager || Model.SecretsManagerBeta)">
|
<div id="organization-secrets-configuration" hidden="@(!Model.UseSecretsManager)">
|
||||||
<h2>Secrets Manager Configuration</h2>
|
<h2>Secrets Manager Configuration</h2>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
|
@ -46,24 +46,8 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SM beta requires SM access
|
|
||||||
document.getElementById('@(nameof(Model.SecretsManagerBeta))').checked = false;
|
|
||||||
clearSecretsManagerConfiguration();
|
clearSecretsManagerConfiguration();
|
||||||
});
|
});
|
||||||
|
|
||||||
document.getElementById('@(nameof(Model.SecretsManagerBeta))').addEventListener('change', (event) => {
|
|
||||||
document.getElementById('organization-secrets-configuration').hidden = event.target.checked;
|
|
||||||
|
|
||||||
if (event.target.checked) {
|
|
||||||
// SM beta requires SM access
|
|
||||||
document.getElementById('@(nameof(Model.UseSecretsManager))').checked = true;
|
|
||||||
// SM Beta orgs do not have subscription limits
|
|
||||||
clearSecretsManagerConfiguration();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
setInitialSecretsManagerConfiguration();
|
|
||||||
});
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
function togglePlanFeatures(planType) {
|
function togglePlanFeatures(planType) {
|
||||||
|
@ -110,7 +110,6 @@ public class OrganizationSubscriptionResponseModel : OrganizationResponseModel
|
|||||||
CoreHelpers.ReadableBytesSize(organization.Storage.Value) : null;
|
CoreHelpers.ReadableBytesSize(organization.Storage.Value) : null;
|
||||||
StorageGb = organization.Storage.HasValue ?
|
StorageGb = organization.Storage.HasValue ?
|
||||||
Math.Round(organization.Storage.Value / 1073741824D, 2) : 0; // 1 GB
|
Math.Round(organization.Storage.Value / 1073741824D, 2) : 0; // 1 GB
|
||||||
SecretsManagerBeta = organization.SecretsManagerBeta;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrganizationSubscriptionResponseModel(Organization organization, SubscriptionInfo subscription, bool hideSensitiveData)
|
public OrganizationSubscriptionResponseModel(Organization organization, SubscriptionInfo subscription, bool hideSensitiveData)
|
||||||
@ -127,8 +126,6 @@ public class OrganizationSubscriptionResponseModel : OrganizationResponseModel
|
|||||||
Subscription.Items = null;
|
Subscription.Items = null;
|
||||||
UpcomingInvoice.Amount = null;
|
UpcomingInvoice.Amount = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
SecretsManagerBeta = organization.SecretsManagerBeta;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrganizationSubscriptionResponseModel(Organization organization, OrganizationLicense license) :
|
public OrganizationSubscriptionResponseModel(Organization organization, OrganizationLicense license) :
|
||||||
@ -143,8 +140,6 @@ public class OrganizationSubscriptionResponseModel : OrganizationResponseModel
|
|||||||
license.Expires?.AddDays(-Constants
|
license.Expires?.AddDays(-Constants
|
||||||
.OrganizationSelfHostSubscriptionGracePeriodDays);
|
.OrganizationSelfHostSubscriptionGracePeriodDays);
|
||||||
}
|
}
|
||||||
|
|
||||||
SecretsManagerBeta = organization.SecretsManagerBeta;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string StorageName { get; set; }
|
public string StorageName { get; set; }
|
||||||
@ -162,6 +157,4 @@ public class OrganizationSubscriptionResponseModel : OrganizationResponseModel
|
|||||||
/// Date when a self-hosted organization expires (includes grace period).
|
/// Date when a self-hosted organization expires (includes grace period).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime? Expiration { get; set; }
|
public DateTime? Expiration { get; set; }
|
||||||
|
|
||||||
public bool SecretsManagerBeta { get; set; }
|
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,6 @@ public class Organization : ITableObject<Guid>, ISubscriber, IStorable, IStorabl
|
|||||||
public int? SmServiceAccounts { get; set; }
|
public int? SmServiceAccounts { get; set; }
|
||||||
public int? MaxAutoscaleSmSeats { get; set; }
|
public int? MaxAutoscaleSmSeats { get; set; }
|
||||||
public int? MaxAutoscaleSmServiceAccounts { get; set; }
|
public int? MaxAutoscaleSmServiceAccounts { get; set; }
|
||||||
public bool SecretsManagerBeta { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Refers to the ability for an organization to limit collection creation and deletion to owners and admins only
|
/// Refers to the ability for an organization to limit collection creation and deletion to owners and admins only
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -34,7 +34,7 @@ public class CountNewSmSeatsRequiredQuery : ICountNewSmSeatsRequiredQuery
|
|||||||
throw new BadRequestException("Organization does not use Secrets Manager");
|
throw new BadRequestException("Organization does not use Secrets Manager");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!organization.SmSeats.HasValue || organization.SecretsManagerBeta)
|
if (!organization.SmSeats.HasValue)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -68,12 +68,6 @@ public class AddSecretsManagerSubscriptionCommand : IAddSecretsManagerSubscripti
|
|||||||
throw new NotFoundException();
|
throw new NotFoundException();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (organization.SecretsManagerBeta)
|
|
||||||
{
|
|
||||||
throw new BadRequestException("Organization is enrolled in Secrets Manager Beta. " +
|
|
||||||
"Please contact Customer Success to add Secrets Manager to your subscription.");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (organization.UseSecretsManager)
|
if (organization.UseSecretsManager)
|
||||||
{
|
{
|
||||||
throw new BadRequestException("Organization already uses Secrets Manager.");
|
throw new BadRequestException("Organization already uses Secrets Manager.");
|
||||||
|
@ -165,12 +165,6 @@ public class UpdateSecretsManagerSubscriptionCommand : IUpdateSecretsManagerSubs
|
|||||||
throw new BadRequestException("Organization has no access to Secrets Manager.");
|
throw new BadRequestException("Organization has no access to Secrets Manager.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (organization.SecretsManagerBeta)
|
|
||||||
{
|
|
||||||
throw new BadRequestException("Organization is enrolled in Secrets Manager Beta. " +
|
|
||||||
"Please contact Customer Success to add Secrets Manager to your subscription.");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (update.Plan.Product == ProductType.Free)
|
if (update.Plan.Product == ProductType.Free)
|
||||||
{
|
{
|
||||||
// No need to check the organization is set up with Stripe
|
// No need to check the organization is set up with Stripe
|
||||||
|
@ -141,7 +141,6 @@ public class SecretsManagerOrganizationCustomization : ICustomization
|
|||||||
fixture.Customize<Organization>(composer => composer
|
fixture.Customize<Organization>(composer => composer
|
||||||
.With(o => o.Id, organizationId)
|
.With(o => o.Id, organizationId)
|
||||||
.With(o => o.UseSecretsManager, true)
|
.With(o => o.UseSecretsManager, true)
|
||||||
.With(o => o.SecretsManagerBeta, false)
|
|
||||||
.With(o => o.PlanType, planType)
|
.With(o => o.PlanType, planType)
|
||||||
.With(o => o.Plan, StaticStore.GetPlan(planType).Name)
|
.With(o => o.Plan, StaticStore.GetPlan(planType).Name)
|
||||||
.With(o => o.MaxAutoscaleSmSeats, (int?)null)
|
.With(o => o.MaxAutoscaleSmSeats, (int?)null)
|
||||||
|
@ -86,25 +86,4 @@ public class CountNewSmSeatsRequiredQueryTests
|
|||||||
await sutProvider.Sut.CountNewSmSeatsRequiredAsync(organization.Id, usersToAdd));
|
await sutProvider.Sut.CountNewSmSeatsRequiredAsync(organization.Id, usersToAdd));
|
||||||
Assert.Contains("Organization does not use Secrets Manager", exception.Message);
|
Assert.Contains("Organization does not use Secrets Manager", exception.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory, BitAutoData]
|
|
||||||
public async Task CountNewSmSeatsRequiredAsync_WithSecretsManagerBeta_ReturnsZero(
|
|
||||||
int usersToAdd,
|
|
||||||
Organization organization,
|
|
||||||
SutProvider<CountNewSmSeatsRequiredQuery> sutProvider)
|
|
||||||
{
|
|
||||||
organization.UseSecretsManager = true;
|
|
||||||
organization.SecretsManagerBeta = true;
|
|
||||||
|
|
||||||
sutProvider.GetDependency<IOrganizationRepository>()
|
|
||||||
.GetByIdAsync(organization.Id)
|
|
||||||
.Returns(organization);
|
|
||||||
|
|
||||||
var result = await sutProvider.Sut.CountNewSmSeatsRequiredAsync(organization.Id, usersToAdd);
|
|
||||||
|
|
||||||
Assert.Equal(0, result);
|
|
||||||
|
|
||||||
await sutProvider.GetDependency<IOrganizationUserRepository>().DidNotReceiveWithAnyArgs()
|
|
||||||
.GetOccupiedSmSeatCountByOrganizationIdAsync(default);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,6 @@ public static class OrganizationLicenseFileFixtures
|
|||||||
SmServiceAccounts = 8,
|
SmServiceAccounts = 8,
|
||||||
MaxAutoscaleSmSeats = 101,
|
MaxAutoscaleSmSeats = 101,
|
||||||
MaxAutoscaleSmServiceAccounts = 102,
|
MaxAutoscaleSmServiceAccounts = 102,
|
||||||
SecretsManagerBeta = true,
|
|
||||||
LimitCollectionCreationDeletion = true,
|
LimitCollectionCreationDeletion = true,
|
||||||
AllowAdminAccessToAllCollectionItems = true,
|
AllowAdminAccessToAllCollectionItems = true,
|
||||||
};
|
};
|
||||||
|
@ -107,22 +107,6 @@ public class AddSecretsManagerSubscriptionCommandTests
|
|||||||
await VerifyDependencyNotCalledAsync(sutProvider);
|
await VerifyDependencyNotCalledAsync(sutProvider);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[BitAutoData]
|
|
||||||
public async Task SignUpAsync_ThrowsException_WhenOrganizationEnrolledInSmBeta(
|
|
||||||
SutProvider<AddSecretsManagerSubscriptionCommand> sutProvider,
|
|
||||||
Organization organization)
|
|
||||||
{
|
|
||||||
organization.UseSecretsManager = true;
|
|
||||||
organization.SecretsManagerBeta = true;
|
|
||||||
|
|
||||||
var exception = await Assert.ThrowsAsync<BadRequestException>(
|
|
||||||
() => sutProvider.Sut.SignUpAsync(organization, 10, 10));
|
|
||||||
|
|
||||||
Assert.Contains("Organization is enrolled in Secrets Manager Beta", exception.Message);
|
|
||||||
await VerifyDependencyNotCalledAsync(sutProvider);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
[BitAutoData]
|
[BitAutoData]
|
||||||
public async Task SignUpAsync_ThrowsException_WhenOrganizationAlreadyHasSecretsManager(
|
public async Task SignUpAsync_ThrowsException_WhenOrganizationAlreadyHasSecretsManager(
|
||||||
@ -130,7 +114,6 @@ public class AddSecretsManagerSubscriptionCommandTests
|
|||||||
Organization organization)
|
Organization organization)
|
||||||
{
|
{
|
||||||
organization.UseSecretsManager = true;
|
organization.UseSecretsManager = true;
|
||||||
organization.SecretsManagerBeta = false;
|
|
||||||
|
|
||||||
var exception = await Assert.ThrowsAsync<BadRequestException>(
|
var exception = await Assert.ThrowsAsync<BadRequestException>(
|
||||||
() => sutProvider.Sut.SignUpAsync(organization, 10, 10));
|
() => sutProvider.Sut.SignUpAsync(organization, 10, 10));
|
||||||
@ -147,7 +130,6 @@ public class AddSecretsManagerSubscriptionCommandTests
|
|||||||
Provider provider)
|
Provider provider)
|
||||||
{
|
{
|
||||||
organization.UseSecretsManager = false;
|
organization.UseSecretsManager = false;
|
||||||
organization.SecretsManagerBeta = false;
|
|
||||||
provider.Type = ProviderType.Msp;
|
provider.Type = ProviderType.Msp;
|
||||||
sutProvider.GetDependency<IProviderRepository>().GetByOrganizationIdAsync(organization.Id).Returns(provider);
|
sutProvider.GetDependency<IProviderRepository>().GetByOrganizationIdAsync(organization.Id).Returns(provider);
|
||||||
|
|
||||||
|
@ -166,23 +166,6 @@ public class UpdateSecretsManagerSubscriptionCommandTests
|
|||||||
await VerifyDependencyNotCalledAsync(sutProvider);
|
await VerifyDependencyNotCalledAsync(sutProvider);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[BitAutoData]
|
|
||||||
public async Task UpdateSubscriptionAsync_OrganizationEnrolledInSmBeta_ThrowsException(
|
|
||||||
SutProvider<UpdateSecretsManagerSubscriptionCommand> sutProvider,
|
|
||||||
Organization organization)
|
|
||||||
{
|
|
||||||
organization.UseSecretsManager = true;
|
|
||||||
organization.SecretsManagerBeta = true;
|
|
||||||
var update = new SecretsManagerSubscriptionUpdate(organization, false);
|
|
||||||
|
|
||||||
var exception = await Assert.ThrowsAsync<BadRequestException>(
|
|
||||||
() => sutProvider.Sut.UpdateSubscriptionAsync(update));
|
|
||||||
|
|
||||||
Assert.Contains("Organization is enrolled in Secrets Manager Beta", exception.Message);
|
|
||||||
await VerifyDependencyNotCalledAsync(sutProvider);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
[BitAutoData(PlanType.EnterpriseAnnually2019)]
|
[BitAutoData(PlanType.EnterpriseAnnually2019)]
|
||||||
[BitAutoData(PlanType.EnterpriseAnnually2020)]
|
[BitAutoData(PlanType.EnterpriseAnnually2020)]
|
||||||
|
2396
util/MySqlMigrations/Migrations/20240131215347_RemoveSMBetaFromOrganization.Designer.cs
generated
Normal file
2396
util/MySqlMigrations/Migrations/20240131215347_RemoveSMBetaFromOrganization.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,28 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Bit.MySqlMigrations.Migrations;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class RemoveSMBetaFromOrganization : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "SecretsManagerBeta",
|
||||||
|
table: "Organization");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<bool>(
|
||||||
|
name: "SecretsManagerBeta",
|
||||||
|
table: "Organization",
|
||||||
|
type: "tinyint(1)",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: false);
|
||||||
|
}
|
||||||
|
}
|
@ -17,7 +17,7 @@ namespace Bit.MySqlMigrations.Migrations
|
|||||||
{
|
{
|
||||||
#pragma warning disable 612, 618
|
#pragma warning disable 612, 618
|
||||||
modelBuilder
|
modelBuilder
|
||||||
.HasAnnotation("ProductVersion", "7.0.14")
|
.HasAnnotation("ProductVersion", "7.0.15")
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||||
|
|
||||||
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Organization", b =>
|
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Organization", b =>
|
||||||
@ -136,9 +136,6 @@ namespace Bit.MySqlMigrations.Migrations
|
|||||||
b.Property<int?>("Seats")
|
b.Property<int?>("Seats")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
b.Property<bool>("SecretsManagerBeta")
|
|
||||||
.HasColumnType("tinyint(1)");
|
|
||||||
|
|
||||||
b.Property<bool>("SelfHost")
|
b.Property<bool>("SelfHost")
|
||||||
.HasColumnType("tinyint(1)");
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
@ -533,6 +530,7 @@ namespace Bit.MySqlMigrations.Migrations
|
|||||||
.HasColumnType("varchar(50)");
|
.HasColumnType("varchar(50)");
|
||||||
|
|
||||||
b.HasKey("Id")
|
b.HasKey("Id")
|
||||||
|
.HasName("PK_Grant")
|
||||||
.HasAnnotation("SqlServer:Clustered", true);
|
.HasAnnotation("SqlServer:Clustered", true);
|
||||||
|
|
||||||
b.HasIndex("ExpirationDate")
|
b.HasIndex("ExpirationDate")
|
||||||
|
2410
util/PostgresMigrations/Migrations/20240131215356_RemoveSMBetaFromOrganization.Designer.cs
generated
Normal file
2410
util/PostgresMigrations/Migrations/20240131215356_RemoveSMBetaFromOrganization.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,28 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Bit.PostgresMigrations.Migrations;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class RemoveSMBetaFromOrganization : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "SecretsManagerBeta",
|
||||||
|
table: "Organization");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<bool>(
|
||||||
|
name: "SecretsManagerBeta",
|
||||||
|
table: "Organization",
|
||||||
|
type: "boolean",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: false);
|
||||||
|
}
|
||||||
|
}
|
@ -18,7 +18,7 @@ namespace Bit.PostgresMigrations.Migrations
|
|||||||
#pragma warning disable 612, 618
|
#pragma warning disable 612, 618
|
||||||
modelBuilder
|
modelBuilder
|
||||||
.HasAnnotation("Npgsql:CollationDefinition:postgresIndetermanisticCollation", "en-u-ks-primary,en-u-ks-primary,icu,False")
|
.HasAnnotation("Npgsql:CollationDefinition:postgresIndetermanisticCollation", "en-u-ks-primary,en-u-ks-primary,icu,False")
|
||||||
.HasAnnotation("ProductVersion", "7.0.14")
|
.HasAnnotation("ProductVersion", "7.0.15")
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||||
|
|
||||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||||
@ -140,9 +140,6 @@ namespace Bit.PostgresMigrations.Migrations
|
|||||||
b.Property<int?>("Seats")
|
b.Property<int?>("Seats")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
b.Property<bool>("SecretsManagerBeta")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("SelfHost")
|
b.Property<bool>("SelfHost")
|
||||||
.HasColumnType("boolean");
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
@ -539,6 +536,7 @@ namespace Bit.PostgresMigrations.Migrations
|
|||||||
.HasColumnType("character varying(50)");
|
.HasColumnType("character varying(50)");
|
||||||
|
|
||||||
b.HasKey("Id")
|
b.HasKey("Id")
|
||||||
|
.HasName("PK_Grant")
|
||||||
.HasAnnotation("SqlServer:Clustered", true);
|
.HasAnnotation("SqlServer:Clustered", true);
|
||||||
|
|
||||||
b.HasIndex("ExpirationDate")
|
b.HasIndex("ExpirationDate")
|
||||||
|
2394
util/SqliteMigrations/Migrations/20240131215352_RemoveSMBetaFromOrganization.Designer.cs
generated
Normal file
2394
util/SqliteMigrations/Migrations/20240131215352_RemoveSMBetaFromOrganization.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,28 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Bit.SqliteMigrations.Migrations;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class RemoveSMBetaFromOrganization : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "SecretsManagerBeta",
|
||||||
|
table: "Organization");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<bool>(
|
||||||
|
name: "SecretsManagerBeta",
|
||||||
|
table: "Organization",
|
||||||
|
type: "INTEGER",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: false);
|
||||||
|
}
|
||||||
|
}
|
@ -16,7 +16,7 @@ namespace Bit.SqliteMigrations.Migrations
|
|||||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
#pragma warning disable 612, 618
|
#pragma warning disable 612, 618
|
||||||
modelBuilder.HasAnnotation("ProductVersion", "7.0.14");
|
modelBuilder.HasAnnotation("ProductVersion", "7.0.15");
|
||||||
|
|
||||||
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Organization", b =>
|
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Organization", b =>
|
||||||
{
|
{
|
||||||
@ -134,9 +134,6 @@ namespace Bit.SqliteMigrations.Migrations
|
|||||||
b.Property<int?>("Seats")
|
b.Property<int?>("Seats")
|
||||||
.HasColumnType("INTEGER");
|
.HasColumnType("INTEGER");
|
||||||
|
|
||||||
b.Property<bool>("SecretsManagerBeta")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<bool>("SelfHost")
|
b.Property<bool>("SelfHost")
|
||||||
.HasColumnType("INTEGER");
|
.HasColumnType("INTEGER");
|
||||||
|
|
||||||
@ -531,6 +528,7 @@ namespace Bit.SqliteMigrations.Migrations
|
|||||||
.HasColumnType("TEXT");
|
.HasColumnType("TEXT");
|
||||||
|
|
||||||
b.HasKey("Id")
|
b.HasKey("Id")
|
||||||
|
.HasName("PK_Grant")
|
||||||
.HasAnnotation("SqlServer:Clustered", true);
|
.HasAnnotation("SqlServer:Clustered", true);
|
||||||
|
|
||||||
b.HasIndex("ExpirationDate")
|
b.HasIndex("ExpirationDate")
|
||||||
|
Loading…
Reference in New Issue
Block a user