mirror of
https://github.com/bitwarden/server.git
synced 2025-04-05 21:18:13 -05:00
Dto rename. Moved from static methods to ctors
This commit is contained in:
parent
cb2bc574e3
commit
4317276f5d
@ -36,7 +36,7 @@ public class InviteUsersValidation(
|
|||||||
return new Invalid<InviteUserOrganizationValidationRequest>(organizationValidation.ErrorMessageString);
|
return new Invalid<InviteUserOrganizationValidationRequest>(organizationValidation.ErrorMessageString);
|
||||||
}
|
}
|
||||||
|
|
||||||
var subscriptionUpdate = PasswordManagerSubscriptionUpdate.Create(request);
|
var subscriptionUpdate = new PasswordManagerSubscriptionUpdate(request);
|
||||||
var passwordManagerValidationResult = PasswordManagerInviteUserValidation.Validate(subscriptionUpdate);
|
var passwordManagerValidationResult = PasswordManagerInviteUserValidation.Validate(subscriptionUpdate);
|
||||||
|
|
||||||
if (passwordManagerValidationResult is Invalid<PasswordManagerSubscriptionUpdate> invalidSubscriptionUpdate)
|
if (passwordManagerValidationResult is Invalid<PasswordManagerSubscriptionUpdate> invalidSubscriptionUpdate)
|
||||||
@ -44,7 +44,7 @@ public class InviteUsersValidation(
|
|||||||
return new Invalid<InviteUserOrganizationValidationRequest>(invalidSubscriptionUpdate.ErrorMessageString);
|
return new Invalid<InviteUserOrganizationValidationRequest>(invalidSubscriptionUpdate.ErrorMessageString);
|
||||||
}
|
}
|
||||||
|
|
||||||
var smSubscriptionUpdate = SecretsManagerSubscriptionUpdate.Create(request, subscriptionUpdate);
|
var smSubscriptionUpdate = new SecretsManagerSubscriptionUpdate(request, subscriptionUpdate);
|
||||||
var secretsManagerValidationResult = SecretsManagerInviteUserValidation.Validate(smSubscriptionUpdate);
|
var secretsManagerValidationResult = SecretsManagerInviteUserValidation.Validate(smSubscriptionUpdate);
|
||||||
|
|
||||||
if (secretsManagerValidationResult is Invalid<SecretsManagerSubscriptionUpdate> invalidSmSubscriptionUpdate)
|
if (secretsManagerValidationResult is Invalid<SecretsManagerSubscriptionUpdate> invalidSmSubscriptionUpdate)
|
||||||
|
@ -6,18 +6,18 @@ namespace Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.InviteUse
|
|||||||
|
|
||||||
public static class InviteUserPaymentValidation
|
public static class InviteUserPaymentValidation
|
||||||
{
|
{
|
||||||
public static ValidationResult<PaymentSubscriptionDto> Validate(PaymentSubscriptionDto subscription)
|
public static ValidationResult<PaymentsSubscription> Validate(PaymentsSubscription subscription)
|
||||||
{
|
{
|
||||||
if (subscription.ProductTierType is ProductTierType.Free)
|
if (subscription.ProductTierType is ProductTierType.Free)
|
||||||
{
|
{
|
||||||
return new Valid<PaymentSubscriptionDto>(subscription);
|
return new Valid<PaymentsSubscription>(subscription);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subscription.SubscriptionStatus == StripeConstants.SubscriptionStatus.Canceled)
|
if (subscription.SubscriptionStatus == StripeConstants.SubscriptionStatus.Canceled)
|
||||||
{
|
{
|
||||||
return new Invalid<PaymentSubscriptionDto>(InviteUserValidationErrorMessages.CancelledSubscriptionError);
|
return new Invalid<PaymentsSubscription>(InviteUserValidationErrorMessages.CancelledSubscriptionError);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Valid<PaymentSubscriptionDto>(subscription);
|
return new Valid<PaymentsSubscription>(subscription);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,23 +40,21 @@ public class PasswordManagerSubscriptionUpdate
|
|||||||
PasswordManagerPlan = plan;
|
PasswordManagerPlan = plan;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static PasswordManagerSubscriptionUpdate Create(InviteOrganization inviteOrganization, int occupiedSeats, int seatsToAdd)
|
public PasswordManagerSubscriptionUpdate(InviteOrganization inviteOrganization, int occupiedSeats, int seatsToAdd) :
|
||||||
{
|
this(
|
||||||
return new PasswordManagerSubscriptionUpdate(
|
organizationSeats: inviteOrganization.Seats,
|
||||||
inviteOrganization.Seats,
|
organizationAutoScaleSeatLimit: inviteOrganization.MaxAutoScaleSeats,
|
||||||
inviteOrganization.MaxAutoScaleSeats,
|
currentSeats: occupiedSeats,
|
||||||
occupiedSeats,
|
seatsToAdd: seatsToAdd,
|
||||||
seatsToAdd,
|
plan: inviteOrganization.Plan.PasswordManager)
|
||||||
inviteOrganization.Plan.PasswordManager);
|
{ }
|
||||||
}
|
|
||||||
|
|
||||||
public static PasswordManagerSubscriptionUpdate Create(InviteUserOrganizationValidationRequest validationRequest)
|
public PasswordManagerSubscriptionUpdate(InviteUserOrganizationValidationRequest validationRequest) :
|
||||||
{
|
this(
|
||||||
return new PasswordManagerSubscriptionUpdate(
|
organizationSeats: validationRequest.InviteOrganization.Seats,
|
||||||
validationRequest.InviteOrganization.Seats,
|
organizationAutoScaleSeatLimit: validationRequest.InviteOrganization.MaxAutoScaleSeats,
|
||||||
validationRequest.InviteOrganization.MaxAutoScaleSeats,
|
currentSeats: validationRequest.OccupiedPmSeats,
|
||||||
validationRequest.OccupiedPmSeats,
|
seatsToAdd: validationRequest.Invites.Length,
|
||||||
validationRequest.Invites.Length,
|
plan: validationRequest.InviteOrganization.Plan.PasswordManager)
|
||||||
validationRequest.InviteOrganization.Plan.PasswordManager);
|
{ }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -34,25 +34,26 @@ public class SecretsManagerSubscriptionUpdate
|
|||||||
SecretsManagerPlan = plan;
|
SecretsManagerPlan = plan;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SecretsManagerSubscriptionUpdate Create(InviteOrganization inviteOrganization, int occupiedSeats, int seatsToAdd, int passwordManagerSeatTotal)
|
public SecretsManagerSubscriptionUpdate(InviteOrganization inviteOrganization, int occupiedSeats, int seatsToAdd, int passwordManagerSeatTotal) :
|
||||||
{
|
this(
|
||||||
return new SecretsManagerSubscriptionUpdate(inviteOrganization.UseSecretsManager,
|
useSecretsManger: inviteOrganization.UseSecretsManager,
|
||||||
inviteOrganization.SmSeats,
|
organizationSeats: inviteOrganization.SmSeats,
|
||||||
inviteOrganization.SmMaxAutoScaleSeats,
|
organizationAutoScaleSeatLimit: inviteOrganization.SmMaxAutoScaleSeats,
|
||||||
occupiedSeats,
|
currentSeats: occupiedSeats,
|
||||||
seatsToAdd,
|
seatsToAdd: seatsToAdd,
|
||||||
passwordManagerSeatTotal,
|
passwordManagerUpdatedSeatTotal: passwordManagerSeatTotal,
|
||||||
inviteOrganization.Plan.SecretsManager);
|
plan: inviteOrganization.Plan.SecretsManager)
|
||||||
}
|
{ }
|
||||||
|
|
||||||
public static SecretsManagerSubscriptionUpdate Create(InviteUserOrganizationValidationRequest refined, PasswordManagerSubscriptionUpdate passwordManagerSubscriptionUpdate)
|
public SecretsManagerSubscriptionUpdate(InviteUserOrganizationValidationRequest request,
|
||||||
{
|
PasswordManagerSubscriptionUpdate passwordManagerSubscriptionUpdate) :
|
||||||
return new SecretsManagerSubscriptionUpdate(refined.InviteOrganization.UseSecretsManager,
|
this(
|
||||||
refined.InviteOrganization.SmSeats,
|
useSecretsManger: request.InviteOrganization.UseSecretsManager,
|
||||||
refined.InviteOrganization.SmMaxAutoScaleSeats,
|
organizationSeats: request.InviteOrganization.SmSeats,
|
||||||
refined.OccupiedSmSeats,
|
organizationAutoScaleSeatLimit: request.InviteOrganization.SmMaxAutoScaleSeats,
|
||||||
refined.Invites.Count(x => x.AccessSecretsManager),
|
currentSeats: request.OccupiedSmSeats,
|
||||||
passwordManagerSubscriptionUpdate.UpdatedSeatTotal,
|
seatsToAdd: request.Invites.Count(x => x.AccessSecretsManager),
|
||||||
refined.InviteOrganization.Plan.SecretsManager);
|
passwordManagerUpdatedSeatTotal: passwordManagerSubscriptionUpdate.UpdatedSeatTotal,
|
||||||
}
|
plan: request.InviteOrganization.Plan.SecretsManager)
|
||||||
|
{ }
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ using Bit.Core.AdminConsole.Models.Business;
|
|||||||
using Bit.Core.AdminConsole.Models.Data.Organizations.Policies;
|
using Bit.Core.AdminConsole.Models.Data.Organizations.Policies;
|
||||||
using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.Interfaces;
|
using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.Interfaces;
|
||||||
using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.InviteUsers;
|
using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.InviteUsers;
|
||||||
|
using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.InviteUsers.Models;
|
||||||
using Bit.Core.AdminConsole.Repositories;
|
using Bit.Core.AdminConsole.Repositories;
|
||||||
using Bit.Core.AdminConsole.Services;
|
using Bit.Core.AdminConsole.Services;
|
||||||
using Bit.Core.Auth.Enums;
|
using Bit.Core.Auth.Enums;
|
||||||
@ -35,6 +36,7 @@ using Bit.Core.Tools.Services;
|
|||||||
using Bit.Core.Utilities;
|
using Bit.Core.Utilities;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Stripe;
|
using Stripe;
|
||||||
|
using OrganizationUserInvite = Bit.Core.Models.Business.OrganizationUserInvite;
|
||||||
|
|
||||||
namespace Bit.Core.Services;
|
namespace Bit.Core.Services;
|
||||||
|
|
||||||
|
@ -20,8 +20,8 @@ public static class InviteUserOrganizationValidationRequestHelpers
|
|||||||
PerformedAt = request.PerformedAt,
|
PerformedAt = request.PerformedAt,
|
||||||
OccupiedPmSeats = 0,
|
OccupiedPmSeats = 0,
|
||||||
OccupiedSmSeats = 0,
|
OccupiedSmSeats = 0,
|
||||||
PasswordManagerSubscriptionUpdate = PasswordManagerSubscriptionUpdate.Create(inviteOrganization, 0, 0),
|
PasswordManagerSubscriptionUpdate = new PasswordManagerSubscriptionUpdate(inviteOrganization, 0, 0),
|
||||||
SecretsManagerSubscriptionUpdate = SecretsManagerSubscriptionUpdate.Create(inviteOrganization, 0, 0, 0)
|
SecretsManagerSubscriptionUpdate = new SecretsManagerSubscriptionUpdate(inviteOrganization, 0, 0, 0)
|
||||||
};
|
};
|
||||||
|
|
||||||
public static InviteUserOrganizationValidationRequest WithPasswordManagerUpdate(this InviteUserOrganizationValidationRequest request, PasswordManagerSubscriptionUpdate passwordManagerSubscriptionUpdate) =>
|
public static InviteUserOrganizationValidationRequest WithPasswordManagerUpdate(this InviteUserOrganizationValidationRequest request, PasswordManagerSubscriptionUpdate passwordManagerSubscriptionUpdate) =>
|
||||||
|
@ -218,7 +218,7 @@ public class InviteOrganizationUserCommandTests
|
|||||||
sutProvider.GetDependency<IInviteUsersValidation>()
|
sutProvider.GetDependency<IInviteUsersValidation>()
|
||||||
.ValidateAsync(Arg.Any<InviteUserOrganizationValidationRequest>())
|
.ValidateAsync(Arg.Any<InviteUserOrganizationValidationRequest>())
|
||||||
.Returns(new Valid<InviteUserOrganizationValidationRequest>(GetInviteValidationRequestMock(request, organizationDto)
|
.Returns(new Valid<InviteUserOrganizationValidationRequest>(GetInviteValidationRequestMock(request, organizationDto)
|
||||||
.WithPasswordManagerUpdate(PasswordManagerSubscriptionUpdate.Create(organizationDto, organization.Seats.Value, 1))));
|
.WithPasswordManagerUpdate(new PasswordManagerSubscriptionUpdate(organizationDto, organization.Seats.Value, 1))));
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
var result = await sutProvider.Sut.InviteScimOrganizationUserAsync(request);
|
var result = await sutProvider.Sut.InviteScimOrganizationUserAsync(request);
|
||||||
@ -260,7 +260,7 @@ public class InviteOrganizationUserCommandTests
|
|||||||
timeProvider.GetUtcNow(),
|
timeProvider.GetUtcNow(),
|
||||||
externalId);
|
externalId);
|
||||||
|
|
||||||
var passwordManagerUpdate = PasswordManagerSubscriptionUpdate.Create(organizationDto, organization.Seats.Value, 1);
|
var passwordManagerUpdate = new PasswordManagerSubscriptionUpdate(organizationDto, organization.Seats.Value, 1);
|
||||||
|
|
||||||
var orgUserRepository = sutProvider.GetDependency<IOrganizationUserRepository>();
|
var orgUserRepository = sutProvider.GetDependency<IOrganizationUserRepository>();
|
||||||
|
|
||||||
@ -323,7 +323,7 @@ public class InviteOrganizationUserCommandTests
|
|||||||
timeProvider.GetUtcNow(),
|
timeProvider.GetUtcNow(),
|
||||||
externalId);
|
externalId);
|
||||||
|
|
||||||
var secretsManagerSubscriptionUpdate = SecretsManagerSubscriptionUpdate.Create(
|
var secretsManagerSubscriptionUpdate = new SecretsManagerSubscriptionUpdate(
|
||||||
organizationDto,
|
organizationDto,
|
||||||
organization.SmSeats.Value,
|
organization.SmSeats.Value,
|
||||||
1,
|
1,
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using Bit.Core.AdminConsole.Entities;
|
using Bit.Core.AdminConsole.Entities;
|
||||||
using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.InviteUsers;
|
using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.InviteUsers;
|
||||||
|
using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.InviteUsers.Models;
|
||||||
using Bit.Core.AdminConsole.Repositories;
|
using Bit.Core.AdminConsole.Repositories;
|
||||||
using Bit.Core.Auth.Entities;
|
using Bit.Core.Auth.Entities;
|
||||||
using Bit.Core.Auth.Models.Business.Tokenables;
|
using Bit.Core.Auth.Models.Business.Tokenables;
|
||||||
|
@ -17,37 +17,37 @@ public class InviteUserPaymentValidationTests
|
|||||||
{
|
{
|
||||||
organization.PlanType = PlanType.Free;
|
organization.PlanType = PlanType.Free;
|
||||||
|
|
||||||
var result = InviteUserPaymentValidation.Validate(new PaymentSubscriptionDto
|
var result = InviteUserPaymentValidation.Validate(new PaymentsSubscription
|
||||||
{
|
{
|
||||||
SubscriptionStatus = StripeConstants.SubscriptionStatus.Active,
|
SubscriptionStatus = StripeConstants.SubscriptionStatus.Active,
|
||||||
ProductTierType = new InviteOrganization(organization).Plan.ProductTier
|
ProductTierType = new InviteOrganization(organization).Plan.ProductTier
|
||||||
});
|
});
|
||||||
|
|
||||||
Assert.IsType<Valid<PaymentSubscriptionDto>>(result);
|
Assert.IsType<Valid<PaymentsSubscription>>(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void Validate_WhenSubscriptionIsCanceled_ReturnsInvalidResponse()
|
public void Validate_WhenSubscriptionIsCanceled_ReturnsInvalidResponse()
|
||||||
{
|
{
|
||||||
var result = InviteUserPaymentValidation.Validate(new PaymentSubscriptionDto
|
var result = InviteUserPaymentValidation.Validate(new PaymentsSubscription
|
||||||
{
|
{
|
||||||
SubscriptionStatus = StripeConstants.SubscriptionStatus.Canceled,
|
SubscriptionStatus = StripeConstants.SubscriptionStatus.Canceled,
|
||||||
ProductTierType = ProductTierType.Enterprise
|
ProductTierType = ProductTierType.Enterprise
|
||||||
});
|
});
|
||||||
|
|
||||||
Assert.IsType<Invalid<PaymentSubscriptionDto>>(result);
|
Assert.IsType<Invalid<PaymentsSubscription>>(result);
|
||||||
Assert.Equal(InviteUserValidationErrorMessages.CancelledSubscriptionError, result.ErrorMessageString);
|
Assert.Equal(InviteUserValidationErrorMessages.CancelledSubscriptionError, result.ErrorMessageString);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void Validate_WhenSubscriptionIsActive_ReturnsValidResponse()
|
public void Validate_WhenSubscriptionIsActive_ReturnsValidResponse()
|
||||||
{
|
{
|
||||||
var result = InviteUserPaymentValidation.Validate(new PaymentSubscriptionDto
|
var result = InviteUserPaymentValidation.Validate(new PaymentsSubscription
|
||||||
{
|
{
|
||||||
SubscriptionStatus = StripeConstants.SubscriptionStatus.Active,
|
SubscriptionStatus = StripeConstants.SubscriptionStatus.Active,
|
||||||
ProductTierType = ProductTierType.Enterprise
|
ProductTierType = ProductTierType.Enterprise
|
||||||
});
|
});
|
||||||
|
|
||||||
Assert.IsType<Valid<PaymentSubscriptionDto>>(result);
|
Assert.IsType<Valid<PaymentsSubscription>>(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ public class PasswordManagerInviteUserValidationTests
|
|||||||
|
|
||||||
var organizationDto = new InviteOrganization(organization);
|
var organizationDto = new InviteOrganization(organization);
|
||||||
|
|
||||||
var subscriptionUpdate = PasswordManagerSubscriptionUpdate.Create(organizationDto, 0, 0);
|
var subscriptionUpdate = new PasswordManagerSubscriptionUpdate(organizationDto, 0, 0);
|
||||||
|
|
||||||
var result = PasswordManagerInviteUserValidation.Validate(subscriptionUpdate);
|
var result = PasswordManagerInviteUserValidation.Validate(subscriptionUpdate);
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ public class PasswordManagerInviteUserValidationTests
|
|||||||
|
|
||||||
var organizationDto = new InviteOrganization(organization);
|
var organizationDto = new InviteOrganization(organization);
|
||||||
|
|
||||||
var subscriptionUpdate = PasswordManagerSubscriptionUpdate.Create(organizationDto, seatsOccupiedByUsers, additionalSeats);
|
var subscriptionUpdate = new PasswordManagerSubscriptionUpdate(organizationDto, seatsOccupiedByUsers, additionalSeats);
|
||||||
|
|
||||||
var result = PasswordManagerInviteUserValidation.Validate(subscriptionUpdate);
|
var result = PasswordManagerInviteUserValidation.Validate(subscriptionUpdate);
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ public class PasswordManagerInviteUserValidationTests
|
|||||||
|
|
||||||
var organizationDto = new InviteOrganization(organization);
|
var organizationDto = new InviteOrganization(organization);
|
||||||
|
|
||||||
var subscriptionUpdate = PasswordManagerSubscriptionUpdate.Create(organizationDto, seatsOccupiedByUsers, additionalSeats);
|
var subscriptionUpdate = new PasswordManagerSubscriptionUpdate(organizationDto, seatsOccupiedByUsers, additionalSeats);
|
||||||
|
|
||||||
var result = PasswordManagerInviteUserValidation.Validate(subscriptionUpdate);
|
var result = PasswordManagerInviteUserValidation.Validate(subscriptionUpdate);
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ public class PasswordManagerInviteUserValidationTests
|
|||||||
|
|
||||||
var organizationDto = new InviteOrganization(organization);
|
var organizationDto = new InviteOrganization(organization);
|
||||||
|
|
||||||
var subscriptionUpdate = PasswordManagerSubscriptionUpdate.Create(organizationDto, seatsOccupiedByUsers, additionalSeats);
|
var subscriptionUpdate = new PasswordManagerSubscriptionUpdate(organizationDto, seatsOccupiedByUsers, additionalSeats);
|
||||||
|
|
||||||
var result = PasswordManagerInviteUserValidation.Validate(subscriptionUpdate);
|
var result = PasswordManagerInviteUserValidation.Validate(subscriptionUpdate);
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ public class SecretsManagerInviteUserValidationTests
|
|||||||
organization.UseSecretsManager = false;
|
organization.UseSecretsManager = false;
|
||||||
|
|
||||||
var organizationDto = new InviteOrganization(organization);
|
var organizationDto = new InviteOrganization(organization);
|
||||||
var subscriptionUpdate = PasswordManagerSubscriptionUpdate.Create(organizationDto, 0, 0);
|
var subscriptionUpdate = new PasswordManagerSubscriptionUpdate(organizationDto, 0, 0);
|
||||||
|
|
||||||
var request = new InviteUserOrganizationValidationRequest
|
var request = new InviteUserOrganizationValidationRequest
|
||||||
{
|
{
|
||||||
@ -34,7 +34,7 @@ public class SecretsManagerInviteUserValidationTests
|
|||||||
OccupiedSmSeats = 0
|
OccupiedSmSeats = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
var update = SecretsManagerSubscriptionUpdate.Create(request, subscriptionUpdate);
|
var update = new SecretsManagerSubscriptionUpdate(request, subscriptionUpdate);
|
||||||
|
|
||||||
var result = SecretsManagerInviteUserValidation.Validate(update);
|
var result = SecretsManagerInviteUserValidation.Validate(update);
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ public class SecretsManagerInviteUserValidationTests
|
|||||||
organization.UseSecretsManager = false;
|
organization.UseSecretsManager = false;
|
||||||
|
|
||||||
var organizationDto = new InviteOrganization(organization);
|
var organizationDto = new InviteOrganization(organization);
|
||||||
var subscriptionUpdate = PasswordManagerSubscriptionUpdate.Create(organizationDto, 0, 0);
|
var subscriptionUpdate = new PasswordManagerSubscriptionUpdate(organizationDto, 0, 0);
|
||||||
|
|
||||||
var invite = OrganizationUserInvite.Create(["email@test.com"], [], OrganizationUserType.User, new Permissions(), string.Empty, true);
|
var invite = OrganizationUserInvite.Create(["email@test.com"], [], OrganizationUserType.User, new Permissions(), string.Empty, true);
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ public class SecretsManagerInviteUserValidationTests
|
|||||||
OccupiedSmSeats = 0
|
OccupiedSmSeats = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
var update = SecretsManagerSubscriptionUpdate.Create(request, subscriptionUpdate);
|
var update = new SecretsManagerSubscriptionUpdate(request, subscriptionUpdate);
|
||||||
|
|
||||||
var result = SecretsManagerInviteUserValidation.Validate(update);
|
var result = SecretsManagerInviteUserValidation.Validate(update);
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ public class SecretsManagerInviteUserValidationTests
|
|||||||
organization.UseSecretsManager = true;
|
organization.UseSecretsManager = true;
|
||||||
|
|
||||||
var organizationDto = new InviteOrganization(organization);
|
var organizationDto = new InviteOrganization(organization);
|
||||||
var subscriptionUpdate = PasswordManagerSubscriptionUpdate.Create(organizationDto, 0, 0);
|
var subscriptionUpdate = new PasswordManagerSubscriptionUpdate(organizationDto, 0, 0);
|
||||||
|
|
||||||
var request = new InviteUserOrganizationValidationRequest
|
var request = new InviteUserOrganizationValidationRequest
|
||||||
{
|
{
|
||||||
@ -92,7 +92,7 @@ public class SecretsManagerInviteUserValidationTests
|
|||||||
OccupiedSmSeats = 0
|
OccupiedSmSeats = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
var update = SecretsManagerSubscriptionUpdate.Create(request, subscriptionUpdate);
|
var update = new SecretsManagerSubscriptionUpdate(request, subscriptionUpdate);
|
||||||
|
|
||||||
var result = SecretsManagerInviteUserValidation.Validate(update);
|
var result = SecretsManagerInviteUserValidation.Validate(update);
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ public class SecretsManagerInviteUserValidationTests
|
|||||||
organization.PlanType = PlanType.EnterpriseAnnually;
|
organization.PlanType = PlanType.EnterpriseAnnually;
|
||||||
|
|
||||||
var organizationDto = new InviteOrganization(organization);
|
var organizationDto = new InviteOrganization(organization);
|
||||||
var subscriptionUpdate = PasswordManagerSubscriptionUpdate.Create(organizationDto, 0, 0);
|
var subscriptionUpdate = new PasswordManagerSubscriptionUpdate(organizationDto, 0, 0);
|
||||||
|
|
||||||
var request = new InviteUserOrganizationValidationRequest
|
var request = new InviteUserOrganizationValidationRequest
|
||||||
{
|
{
|
||||||
@ -122,7 +122,7 @@ public class SecretsManagerInviteUserValidationTests
|
|||||||
OccupiedSmSeats = 4
|
OccupiedSmSeats = 4
|
||||||
};
|
};
|
||||||
|
|
||||||
var update = SecretsManagerSubscriptionUpdate.Create(request, subscriptionUpdate);
|
var update = new SecretsManagerSubscriptionUpdate(request, subscriptionUpdate);
|
||||||
|
|
||||||
var result = SecretsManagerInviteUserValidation.Validate(update);
|
var result = SecretsManagerInviteUserValidation.Validate(update);
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ public class SecretsManagerInviteUserValidationTests
|
|||||||
organization.PlanType = PlanType.EnterpriseAnnually;
|
organization.PlanType = PlanType.EnterpriseAnnually;
|
||||||
|
|
||||||
var organizationDto = new InviteOrganization(organization);
|
var organizationDto = new InviteOrganization(organization);
|
||||||
var subscriptionUpdate = PasswordManagerSubscriptionUpdate.Create(organizationDto, 0, 0);
|
var subscriptionUpdate = new PasswordManagerSubscriptionUpdate(organizationDto, 0, 0);
|
||||||
|
|
||||||
var request = new InviteUserOrganizationValidationRequest
|
var request = new InviteUserOrganizationValidationRequest
|
||||||
{
|
{
|
||||||
@ -153,7 +153,7 @@ public class SecretsManagerInviteUserValidationTests
|
|||||||
OccupiedSmSeats = 4
|
OccupiedSmSeats = 4
|
||||||
};
|
};
|
||||||
|
|
||||||
var update = SecretsManagerSubscriptionUpdate.Create(request, subscriptionUpdate);
|
var update = new SecretsManagerSubscriptionUpdate(request, subscriptionUpdate);
|
||||||
|
|
||||||
var result = SecretsManagerInviteUserValidation.Validate(update);
|
var result = SecretsManagerInviteUserValidation.Validate(update);
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ using Bit.Core.AdminConsole.Enums;
|
|||||||
using Bit.Core.AdminConsole.Enums.Provider;
|
using Bit.Core.AdminConsole.Enums.Provider;
|
||||||
using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.Interfaces;
|
using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.Interfaces;
|
||||||
using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.InviteUsers;
|
using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.InviteUsers;
|
||||||
|
using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.InviteUsers.Models;
|
||||||
using Bit.Core.AdminConsole.Repositories;
|
using Bit.Core.AdminConsole.Repositories;
|
||||||
using Bit.Core.AdminConsole.Services;
|
using Bit.Core.AdminConsole.Services;
|
||||||
using Bit.Core.Auth.Models.Business.Tokenables;
|
using Bit.Core.Auth.Models.Business.Tokenables;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user