diff --git a/modules/mesh-enrolment/cmd/mesh-enrolment/enrolment_test.go b/modules/mesh-enrolment/cmd/mesh-enrolment/enrolment_test.go index 26e2b67f2..38fa1179e 100644 --- a/modules/mesh-enrolment/cmd/mesh-enrolment/enrolment_test.go +++ b/modules/mesh-enrolment/cmd/mesh-enrolment/enrolment_test.go @@ -94,8 +94,8 @@ func (p memPictures) Keys(state string) ([]string, error) { func (p memPictures) Get(state, key string) ([]byte, bool, error) { return memRead(p).Get(state, key) } // A read in the seat form `seat:.` is a read of the state of the module the seat list names as the seat's holder -// (design 47 G A-210, A-128): the vault's signers and the node-engine's have are asked of the modules that hold their seats, whatever -// those are called, and a state named otherwise is read as it is. +// (design 47 G A-210, A-128): the vault's signers are asked of the modules that hold their seats, whatever +// those are called, and a state named otherwise (the node-engine's have among them, which keeps its module form) is read as it is. func aSeatsStateIsReadAtItsHolder(t *testing.T) { call := func(key string, _ any) (json.RawMessage, error) { if key != seatlist.HolderKey() { @@ -103,12 +103,9 @@ func aSeatsStateIsReadAtItsHolder(t *testing.T) { } return json.RawMessage(`{"seats":[{"seat":"mesh-vault","holders":[{"module":"another-vault"}]},{"seat":"node-engine","holders":[]}]}`), nil } - for state, want := range map[string]string{signersRead: "another-vault.signers", "mesh-config.resolved": "mesh-config.resolved"} { + for state, want := range map[string]string{signersRead: "another-vault.signers", haveRead: "node-engine.have", "mesh-config.resolved": "mesh-config.resolved"} { if got, err := resolveState(call, state); err != nil || got != want { t.Errorf("%s is read as %q, %v; want %q", state, got, err, want) } } - if got, err := resolveState(call, haveRead); err == nil { - t.Errorf("%s with no holder is read as %q, want an error naming the seat", haveRead, got) - } } diff --git a/modules/mesh-enrolment/cmd/mesh-enrolment/integration_test.go b/modules/mesh-enrolment/cmd/mesh-enrolment/integration_test.go index ea10f2974..de273669d 100644 --- a/modules/mesh-enrolment/cmd/mesh-enrolment/integration_test.go +++ b/modules/mesh-enrolment/cmd/mesh-enrolment/integration_test.go @@ -112,9 +112,9 @@ type busReader struct { js jetstream.JetStream } -// bedHolders is the seat list of the bed: the vault and the node-engine each held by the module of the seat's name. +// bedHolders is the seat list of the bed: the vault held by the module of its name and the node-engine by mesh-host. func bedHolders(string, any) (json.RawMessage, error) { - return json.RawMessage(`{"seats":[{"seat":"mesh-vault","holders":[{"module":"mesh-vault"}]},{"seat":"node-engine","holders":[{"module":"node-engine"}]}]}`), nil + return json.RawMessage(`{"seats":[{"seat":"mesh-vault","holders":[{"module":"mesh-vault"}]},{"seat":"node-engine","holders":[{"module":"mesh-host"}]}]}`), nil } func (r busReader) bucket(state string) (jetstream.KeyValue, error) { diff --git a/modules/mesh-enrolment/cmd/mesh-enrolment/names.go b/modules/mesh-enrolment/cmd/mesh-enrolment/names.go index b22b397cb..a8330a7f4 100644 --- a/modules/mesh-enrolment/cmd/mesh-enrolment/names.go +++ b/modules/mesh-enrolment/cmd/mesh-enrolment/names.go @@ -15,11 +15,11 @@ const ( // (design 47 G A-296), never named here. enrolmentsState = meshnodeenroller.StateEnrolments // signersRead is the seat mesh-vault's state signers as the enrolment's manifest reads it (`seat:.`, resolved at - // the seat's holder when it is read, design 47 G A-210, A-128), signersKey the key holding its signing key; haveRead is the - // seat node-engine's state have the same way. + // the seat's holder when it is read, design 47 G A-210, A-128), signersKey the key holding its signing key; haveRead the node-engine's state have, + // which keeps its module form (A-318). signersRead = "seat:" + mv.Seat + ".signers" signersKey = "key" - haveRead = "seat:node-engine.have" + haveRead = "node-engine.have" // assignmentsState is the assigner's state assignments, which the enrolment reads (reads: through its first view). assignmentsState = "assignments" ) diff --git a/modules/mesh-enrolment/module.json b/modules/mesh-enrolment/module.json index 5bb0e0971..1add523cc 100644 --- a/modules/mesh-enrolment/module.json +++ b/modules/mesh-enrolment/module.json @@ -40,7 +40,7 @@ "reads": [ "mesh-grants.user-list", "seat:mesh-vault.signers", - "seat:node-engine.have" + "node-engine.have" ], "state": [ {