Report what an adopted node holds, its firewall and what is reachable, and speak unasked when that changes (hq ADR 0100)

This commit is contained in:
2026-09-22 17:22:31 +02:00
parent 3c90d155b3
commit 770f589401
11 changed files with 528 additions and 8 deletions
+13
View File
@@ -220,6 +220,19 @@ func TestTheWireFormatIsExactlyTheseFieldNames(t *testing.T) {
if len(fields) != 5 {
t.Errorf("the token has %d fields, expected 5: %v", len(fields), fields)
}
// novox/hq ADR 0100: an adopted node's token says so, and a converged one's is unchanged.
raw, err = json.Marshal(Token{Version: 1, Secret: "s", Adopted: true})
if err != nil {
t.Fatal(err)
}
fields = map[string]any{}
if err := json.Unmarshal(raw, &fields); err != nil {
t.Fatal(err)
}
if fields["adopted"] != true {
t.Errorf("an adopted token does not say \"adopted\": %v", fields)
}
}
func TestACompleteTokenParses(t *testing.T) {