feat: add auth model types (User, NKeyUser, Permissions) and auth config to NatsOptions
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
using NATS.Server.Auth;
|
||||
|
||||
namespace NATS.Server;
|
||||
|
||||
public sealed class NatsOptions
|
||||
@@ -10,4 +12,19 @@ public sealed class NatsOptions
|
||||
public int MaxConnections { get; set; } = 65536;
|
||||
public TimeSpan PingInterval { get; set; } = TimeSpan.FromMinutes(2);
|
||||
public int MaxPingsOut { get; set; } = 2;
|
||||
|
||||
// Simple auth (single user)
|
||||
public string? Username { get; set; }
|
||||
public string? Password { get; set; }
|
||||
public string? Authorization { get; set; }
|
||||
|
||||
// Multiple users/nkeys
|
||||
public IReadOnlyList<User>? Users { get; set; }
|
||||
public IReadOnlyList<NKeyUser>? NKeys { get; set; }
|
||||
|
||||
// Default/fallback
|
||||
public string? NoAuthUser { get; set; }
|
||||
|
||||
// Auth timing
|
||||
public TimeSpan AuthTimeout { get; set; } = TimeSpan.FromSeconds(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user