mirror of
https://github.com/bitwarden/server
synced 2025-12-06 00:03:34 +00:00
* Added the ArchivedDate to cipher entity and response model * Created migration scripts for sqlserver and ef core migration to add the ArchivedDate column --------- Co-authored-by: gbubemismith <gsmithwalter@gmail.com> Co-authored-by: SmithThe4th <gsmith@bitwarden.com> Co-authored-by: Shane <smelton@bitwarden.com> Co-authored-by: cd-bitwarden <106776772+cd-bitwarden@users.noreply.github.com> Co-authored-by: jng <jng@bitwarden.com>
49 lines
1.6 KiB
C#
49 lines
1.6 KiB
C#
using AutoFixture;
|
|
using Bit.Core.Vault.Entities;
|
|
using Bit.Core.Vault.Models.Data;
|
|
using Bit.Test.Common.AutoFixture.Attributes;
|
|
|
|
namespace Bit.Core.Test.AutoFixture.CipherFixtures;
|
|
|
|
internal class OrganizationCipher : ICustomization
|
|
{
|
|
public Guid? OrganizationId { get; set; }
|
|
public void Customize(IFixture fixture)
|
|
{
|
|
fixture.Customize<Cipher>(composer => composer
|
|
.With(c => c.OrganizationId, OrganizationId ?? Guid.NewGuid())
|
|
.Without(c => c.ArchivedDate)
|
|
.Without(c => c.UserId));
|
|
fixture.Customize<CipherDetails>(composer => composer
|
|
.With(c => c.OrganizationId, Guid.NewGuid())
|
|
.Without(c => c.ArchivedDate)
|
|
.Without(c => c.UserId));
|
|
}
|
|
}
|
|
|
|
internal class UserCipher : ICustomization
|
|
{
|
|
public Guid? UserId { get; set; }
|
|
public void Customize(IFixture fixture)
|
|
{
|
|
fixture.Customize<Cipher>(composer => composer
|
|
.With(c => c.UserId, UserId ?? Guid.NewGuid())
|
|
.Without(c => c.ArchivedDate)
|
|
.Without(c => c.OrganizationId));
|
|
fixture.Customize<CipherDetails>(composer => composer
|
|
.With(c => c.UserId, Guid.NewGuid())
|
|
.Without(c => c.ArchivedDate)
|
|
.Without(c => c.OrganizationId));
|
|
}
|
|
}
|
|
|
|
internal class UserCipherCustomizeAttribute : BitCustomizeAttribute
|
|
{
|
|
public override ICustomization GetCustomization() => new UserCipher();
|
|
}
|
|
|
|
internal class OrganizationCipherCustomizeAttribute : BitCustomizeAttribute
|
|
{
|
|
public override ICustomization GetCustomization() => new OrganizationCipher();
|
|
}
|