Files
MoShiro/backend/fleet/tests/Fleet.Tests/TestTables.cs
T
justme 1ff847e45a
ci/woodpecker/push/main-amd64-build Pipeline was successful
feat: declare every protocol method's direction and enforce it in the router; add the zero-trust design [CI]
Methods, roles and binary channels are declared in one table per plane (node and peer). RpcRouter checks direction, kind and role when handlers are registered, when messages arrive (fleet_protocol_violation, disconnect after repeated violations) and before sending. NodeConnection is split by responsibility.
2026-10-07 16:17:02 +08:00

14 lines
500 B
C#

using Fleet.Rpc;
namespace Fleet.Tests;
/// <summary>测试里用的方法声明:除非另有说明,方法都由拨号方发给监听方。</summary>
internal static class TestTables
{
public static MethodTable Of(params MethodSpec[] specs) => new(specs);
public static MethodSpec Req(string name, RpcSide from = RpcSide.Dialer) => MethodSpec.Request(name, from);
public static MethodSpec Note(string name, RpcSide from = RpcSide.Dialer) => MethodSpec.Notification(name, from);
}