Serve a seat's verbs from the membership once one is issued (novox/hq issue 218)
The runtime added every seat its start-up credential claims even after the mesh issued a membership without it. A seat held once for the mesh is claimed on every machine running the module, so ace's postgres announced the store seat the bus then refused it on.
This commit is contained in:
@@ -342,13 +342,16 @@ async function serveClaimedSeats(
|
||||
for (const module of served) {
|
||||
const m = typeof broker.membership === "function" ? broker.membership(module) : undefined;
|
||||
for (const s of m?.seats ?? []) add({ seat: s.seat, verb: s.verb, subject: s.subject, holder: module });
|
||||
// The credential's claims, for the module's own runtime: where the mesh issued the verb when
|
||||
// it has; the derived shape until then.
|
||||
if (module !== self) continue;
|
||||
// The credential's claims, for the module's own runtime, ONLY until the mesh issues a
|
||||
// membership (novox/hq issue 218). The credential names what the module claims; the membership
|
||||
// names what it holds on this machine. A seat held once for the mesh is claimed by every
|
||||
// machine running the module and held by one, so once a membership exists it decides: a claim
|
||||
// it leaves out is not held here, and serving it anyway announced the seat from a machine the
|
||||
// bus then refused it on.
|
||||
if (module !== self || m) continue;
|
||||
for (const claim of credential?.claims ?? []) {
|
||||
for (const verb of claim.serves ?? []) {
|
||||
const subject = m?.seats?.find((s) => s.seat === claim.seat && s.verb === verb)?.subject
|
||||
?? seatToolSubject(claim.seat, verb, claim.scope, credential?.node);
|
||||
const subject = seatToolSubject(claim.seat, verb, claim.scope, credential?.node);
|
||||
add({ seat: claim.seat, verb, subject, holder: module });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user