A bus account kind ledger, named ledger.<node>.<module> and held in the tool runner's ledgers (issue 1966 S6)

ADR 0597 §9 and the lead's Q1 path: one ledger credential per module
assignment, minted by the vault like every kind; the grants part's copy
of buscompose gains the same kind alike (D5b).
This commit is contained in:
2026-11-03 13:24:42 +01:00
parent 2122ba52c0
commit 6ec6cad968
3 changed files with 27 additions and 3 deletions
+8
View File
@@ -18,4 +18,12 @@ func TestTheBusNamesAgree(t *testing.T) {
if LogStreamName("mesh-delivery-builder", "build-log") == "" || LogSubject("mesh-delivery-builder", "build-log") == "" {
t.Fatal("a log has no stream or subject")
}
// 1966/AC23: a wanted account of kind ledger for m on a names the user ledger.a.m and the own secret ledgers.
ledger := WantedAccount{User: "ledger.a.m", Kind: KindLedger, Node: "a", Module: "m", URL: "nats://10.0.0.1:4222"}
if got := (Principal{Kind: KindLedger, Node: "a", Module: "m"}).Username(); got != "ledger.a.m" {
t.Fatalf("a ledger account is named %q", got)
}
if err := ledger.Valid(); err != nil || ledger.OwnSecret() != "ledgers" {
t.Fatalf("a wanted ledger account: %v, held in %q", err, ledger.OwnSecret())
}
}