feat: add IAuthenticator interface and TokenAuthenticator with constant-time comparison
This commit is contained in:
14
src/NATS.Server/Auth/IAuthenticator.cs
Normal file
14
src/NATS.Server/Auth/IAuthenticator.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using NATS.Server.Protocol;
|
||||
|
||||
namespace NATS.Server.Auth;
|
||||
|
||||
public interface IAuthenticator
|
||||
{
|
||||
AuthResult? Authenticate(ClientAuthContext context);
|
||||
}
|
||||
|
||||
public sealed class ClientAuthContext
|
||||
{
|
||||
public required ClientOptions Opts { get; init; }
|
||||
public required byte[] Nonce { get; init; }
|
||||
}
|
||||
Reference in New Issue
Block a user