From 0509270388412bdb23a282f0f679c726ece96b9c Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 01:13:51 +0100 Subject: [PATCH] mesh-grants: test that node-uplink's machine event reaches no other node's membership or grant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Code review round 2: §4a says the grant and the membership cover the holder's own node's subjects only. Add the negative row beside C-1's: a tool runner on node a, carrying networkmanager, is neither listed for nor granted sign-in-asked.b. Passes already (onMachine substitutes the tool runner's own node and nothing else), proving the fix does not overreach. Builds: design 08 sign-in-page §4a --- modules/mesh-grants/internal/buscompose/buscompose_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/mesh-grants/internal/buscompose/buscompose_test.go b/modules/mesh-grants/internal/buscompose/buscompose_test.go index db68f1fd9..c78a43f1a 100644 --- a/modules/mesh-grants/internal/buscompose/buscompose_test.go +++ b/modules/mesh-grants/internal/buscompose/buscompose_test.go @@ -919,6 +919,10 @@ func healthChecks(t *testing.T) { Declared{Module: "networkmanager", Holds: []Seat{{Name: "node-uplink", Scope: "node", Emits: []string{"sign-in-asked"}, EventSubjects: map[string]string{"sign-in-asked": "sign-in-asked."}}}}, "mesh.seat.node-uplink.event.sign-in-asked.a", true}, + {"a carried module's own seat's machine event is composed for no other node (design 08 sign-in-page §4a)", + Declared{Module: "networkmanager", Holds: []Seat{{Name: "node-uplink", Scope: "node", Emits: []string{"sign-in-asked"}, + EventSubjects: map[string]string{"sign-in-asked": "sign-in-asked."}}}}, + "mesh.seat.node-uplink.event.sign-in-asked.b", false}, } { m := MembershipFor("a", c.d, Assignments{}) listed := m.SeatTraffic != nil && slices.ContainsFunc(m.SeatTraffic.Publish, func(p string) bool { return p == c.subject })