- Make ConnectReceived thread-safe with Volatile.Read/Write (accessed from auth timeout task and command pipeline) - Include authTimeoutTask in Task.WhenAny to propagate exceptions - Clear nonce after authentication with CryptographicOperations.ZeroMemory - Avoid closure allocation on publish permission cache hot path (method group) - Update AuthTimeout default to 2s to match Go server
22 lines
518 B
C#
22 lines
518 B
C#
using NATS.Server;
|
|
using NATS.Server.Auth;
|
|
|
|
namespace NATS.Server.Tests;
|
|
|
|
public class AuthConfigTests
|
|
{
|
|
[Fact]
|
|
public void NatsOptions_has_auth_fields_with_defaults()
|
|
{
|
|
var opts = new NatsOptions();
|
|
|
|
opts.Username.ShouldBeNull();
|
|
opts.Password.ShouldBeNull();
|
|
opts.Authorization.ShouldBeNull();
|
|
opts.Users.ShouldBeNull();
|
|
opts.NKeys.ShouldBeNull();
|
|
opts.NoAuthUser.ShouldBeNull();
|
|
opts.AuthTimeout.ShouldBe(TimeSpan.FromSeconds(2));
|
|
}
|
|
}
|