The node-engine seat's converged answers the node's links

The holder of node-packet-filter must tell an outward link from the tunnel
without reading the loaded table's shape, so converged answers the links as
the engine classifies them for its filter render: tunnel, the private
network's interface, and outward, the outward links. Packages generated
again by seatgen (seatgen -check clean).

Builds: design 33 control-verbs §10; design 08 control-verbs §2; design 47 H H-A-325
This commit is contained in:
2026-11-21 21:15:35 +01:00
parent efcef83cf4
commit 7afd93ddc2
5 changed files with 36 additions and 6 deletions
+4
View File
@@ -1587,10 +1587,14 @@ type ConvergedInput struct {
type ConvergedAnswer struct {
// the kind of the firewall found, for an adopted node
Found string `json:"found,omitempty"`
// the links of this node that face outside, as the engine classifies them for its filter render (ADR 0140); an allowance with no interface never opens one
Outward []string `json:"outward"`
// when the node became so, RFC 3339; absent where the engine recorded no time for it
Since string `json:"since,omitempty"`
// the node's mode: adopted (the found firewall's terms) or converged (the mesh's own filter)
State string `json:"state"`
// the private network's tunnel interface on this node, as the engine's filter render names it
Tunnel string `json:"tunnel"`
}
// The values of ConvergedAnswer's state.
+2 -2
View File
@@ -129,9 +129,9 @@ func TestFixtures(t *testing.T) {
decode: func(b []byte) (any, error) { var v CompositionAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "apply-order answers the changed wants in the order they are applied, with why and what each waits on", subject: "", given: "{\"order\":[{\"module\":\"mesh-broker\",\"position\":1,\"waits\":[],\"why\":\"the bus module is applied first\"},{\"module\":\"mesh-delivery-view\",\"pipeline\":\"main.2\",\"position\":2,\"rank\":2,\"waits\":[\"mesh-delivery-indexer\"],\"why\":\"rank 2 of main.2, after rank 1\"}]}", wire: "{\"order\":[{\"module\":\"mesh-broker\",\"position\":1,\"waits\":[],\"why\":\"the bus module is applied first\"},{\"module\":\"mesh-delivery-view\",\"pipeline\":\"main.2\",\"position\":2,\"rank\":2,\"waits\":[\"mesh-delivery-indexer\"],\"why\":\"rank 2 of main.2, after rank 1\"}]}",
decode: func(b []byte) (any, error) { var v ApplyOrderAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "converged answers an adopted node with its found firewall", subject: "", given: "{\"found\":\"ufw\",\"since\":\"2026-10-02T09:00:00Z\",\"state\":\"adopted\"}", wire: "{\"found\":\"ufw\",\"since\":\"2026-10-02T09:00:00Z\",\"state\":\"adopted\"}",
{name: "converged answers an adopted node with its found firewall", subject: "", given: "{\"found\":\"ufw\",\"outward\":[\"eth0\",\"wlan0\"],\"since\":\"2026-10-02T09:00:00Z\",\"state\":\"adopted\",\"tunnel\":\"mesh0\"}", wire: "{\"found\":\"ufw\",\"outward\":[\"eth0\",\"wlan0\"],\"since\":\"2026-10-02T09:00:00Z\",\"state\":\"adopted\",\"tunnel\":\"mesh0\"}",
decode: func(b []byte) (any, error) { var v ConvergedAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "converged answers a converged node since it converged", subject: "", given: "{\"since\":\"2026-11-21T19:00:00Z\",\"state\":\"converged\"}", wire: "{\"since\":\"2026-11-21T19:00:00Z\",\"state\":\"converged\"}",
{name: "converged answers a converged node since it converged", subject: "", given: "{\"outward\":[\"eth0\"],\"since\":\"2026-11-21T19:00:00Z\",\"state\":\"converged\",\"tunnel\":\"mesh0\"}", wire: "{\"outward\":[\"eth0\"],\"since\":\"2026-11-21T19:00:00Z\",\"state\":\"converged\",\"tunnel\":\"mesh0\"}",
decode: func(b []byte) (any, error) { var v ConvergedAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "composition names the filter part kept because allowed did not answer", subject: "", given: "{\"composition\":{\"key\":\"\"},\"judged\":{\"judgement\":\"\",\"waits_for_yes\":false,\"words\":\"\"},\"module\":\"nftables\",\"node\":\"desk\",\"started\":true,\"withheld-parts\":[{\"part\":\"node-packet-filter.allowed\",\"why\":\"asked of the seat node-packet-filter's verb allowed on desk, which did not answer within 10s\"}]}", wire: "{\"composition\":{\"key\":\"\"},\"judged\":{\"judgement\":\"\",\"waits_for_yes\":false,\"words\":\"\"},\"module\":\"nftables\",\"node\":\"desk\",\"started\":true,\"withheld-parts\":[{\"part\":\"node-packet-filter.allowed\",\"why\":\"asked of the seat node-packet-filter's verb allowed on desk, which did not answer within 10s\"}]}",
decode: func(b []byte) (any, error) { var v CompositionAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},