1
0
mirror of https://github.com/bitwarden/server.git synced 2024-12-11 15:17:44 +01:00
bitwarden-server/test/Identity.Test/AutoFixture/RequestValidationFixtures.cs
Ike fa5d6712c5
[PM-6664] Base Request Validator Unit Tests and Resource Owner integration Tests (#4582)
* intial commit

* Some UnitTests for the VerifyAsync flows

* WIP org two factor

* removed useless tests

* added ResourceOwnerValidation integration tests

* fixing formatting

* addressing comments

* removed comment
2024-09-05 11:17:15 -07:00

32 lines
874 B
C#

using System.Reflection;
using AutoFixture;
using AutoFixture.Xunit2;
using Duende.IdentityServer.Validation;
namespace Bit.Identity.Test.AutoFixture;
internal class ValidatedTokenRequestCustomization : ICustomization
{
public ValidatedTokenRequestCustomization()
{ }
public void Customize(IFixture fixture)
{
fixture.Customize<ValidatedTokenRequest>(composer => composer
.With(o => o.RefreshToken, () => null)
.With(o => o.ClientClaims, [])
.With(o => o.Options, new Duende.IdentityServer.Configuration.IdentityServerOptions()));
}
}
public class ValidatedTokenRequestAttribute : CustomizeAttribute
{
public ValidatedTokenRequestAttribute()
{ }
public override ICustomization GetCustomization(ParameterInfo parameter)
{
return new ValidatedTokenRequestCustomization();
}
}