1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-05 05:00:19 -05:00
Patrick-Pimentel-Bitwarden 5cbf4c5974
feat(innovation-archive): [PM-19151] Controller Work (#5496)
* feat(innovation-archive): Controller Work - Added bulk endpoints for archive and feature flagged them.

* feat(innovation-archive): Controller Work - Added in archive unarchive stored procedure.

* test(innovation-archive): Controller Work - Got test logic working.

---------

Co-authored-by: gbubemismith <gsmithwalter@gmail.com>
2025-03-24 10:14:05 -04:00

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();
}