mirror of
https://github.com/bitwarden/server
synced 2026-01-02 08:33:48 +00:00
test(auth-validator): [PM-22975] Client Version Validator - WIP changes.
This commit is contained in:
@@ -50,4 +50,17 @@ public class ClientVersionValidatorTests
|
||||
var ok = await sut.ValidateAsync(new User(), new Bit.Identity.IdentityServer.CustomValidatorRequestContext());
|
||||
Assert.True(ok);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Allows_When_ClientVersionHeaderMissing()
|
||||
{
|
||||
// Do not set ClientVersion on the context (remains null) and ensure we fail open
|
||||
var ctx = Substitute.For<ICurrentContext>();
|
||||
var minQuery = MakeMinQuery(new Version("2025.11.0"));
|
||||
var sut = new ClientVersionValidator(ctx, minQuery);
|
||||
|
||||
var ok = await sut.ValidateAsync(new User(), new Bit.Identity.IdentityServer.CustomValidatorRequestContext());
|
||||
|
||||
Assert.True(ok);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user