feat: add client kind command matrix parity

This commit is contained in:
Joseph Doherty
2026-02-23 05:41:42 -05:00
parent 1ebf283a8c
commit d9f157d9e4
5 changed files with 72 additions and 6 deletions

View 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,
};
}
}