fix: session B — Go-faithful auth error states, NKey padding, permissions, signal disposal
This commit is contained in:
@@ -27,23 +27,30 @@ public class AuthHandlerExtendedTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void GetAuthErrClosedState_ExpiredMessage_ReturnsExpiredState()
|
||||
public void GetAuthErrClosedState_ProxyNotTrusted_ReturnsProxyNotTrusted()
|
||||
{
|
||||
var err = new InvalidOperationException("token is expired");
|
||||
AuthHandler.GetAuthErrClosedState(err).ShouldBe(ClosedState.AuthenticationExpired);
|
||||
var err = new AuthProxyNotTrustedException();
|
||||
AuthHandler.GetAuthErrClosedState(err).ShouldBe(ClosedState.ProxyNotTrusted);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void GetAuthErrClosedState_NullError_ReturnsTimeout()
|
||||
public void GetAuthErrClosedState_ProxyRequired_ReturnsProxyRequired()
|
||||
{
|
||||
AuthHandler.GetAuthErrClosedState(null).ShouldBe(ClosedState.AuthenticationTimeout);
|
||||
var err = new AuthProxyRequiredException();
|
||||
AuthHandler.GetAuthErrClosedState(err).ShouldBe(ClosedState.ProxyRequired);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void GetAuthErrClosedState_RevokedMessage_ReturnsRevoked()
|
||||
public void GetAuthErrClosedState_OtherError_ReturnsAuthenticationViolation()
|
||||
{
|
||||
var err = new InvalidOperationException("credential was revoked");
|
||||
AuthHandler.GetAuthErrClosedState(err).ShouldBe(ClosedState.AuthRevoked);
|
||||
var err = new InvalidOperationException("bad credentials");
|
||||
AuthHandler.GetAuthErrClosedState(err).ShouldBe(ClosedState.AuthenticationViolation);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void GetAuthErrClosedState_NullError_ReturnsAuthenticationViolation()
|
||||
{
|
||||
AuthHandler.GetAuthErrClosedState(null).ShouldBe(ClosedState.AuthenticationViolation);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -40,7 +40,7 @@ public class JwtProcessorTests
|
||||
public void WipeSlice_FillsWithX()
|
||||
{
|
||||
var buf = new byte[] { 0x01, 0x02, 0x03 };
|
||||
JwtProcessor.WipeSlice(buf);
|
||||
AuthHandler.WipeSlice(buf);
|
||||
buf.ShouldAllBe(b => b == (byte)'x');
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class JwtProcessorTests
|
||||
public void WipeSlice_EmptyBuffer_NoOp()
|
||||
{
|
||||
var buf = Array.Empty<byte>();
|
||||
JwtProcessor.WipeSlice(buf);
|
||||
AuthHandler.WipeSlice(buf);
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
|
||||
Reference in New Issue
Block a user