feat: add client kind command matrix parity
This commit is contained in:
17
src/NATS.Server/Protocol/ClientCommandMatrix.cs
Normal file
17
src/NATS.Server/Protocol/ClientCommandMatrix.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
namespace NATS.Server.Protocol;
|
||||
|
||||
public sealed class ClientCommandMatrix
|
||||
{
|
||||
public bool IsAllowed(ClientKind kind, string? op)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(op))
|
||||
return true;
|
||||
|
||||
return (kind, op.ToUpperInvariant()) switch
|
||||
{
|
||||
(ClientKind.Router, "RS+") => true,
|
||||
(_, "RS+") => false,
|
||||
_ => true,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user