Let a node agent hear the creation of the seat's placement and candidates, so it binds them with no timer (ADR 0567 §9, issue 1126)
mesh/delivery merged: source.main moved to novox/mesh-sdk@d7c790d2422c
mesh/delivery-group group feat/1126-grants-first merged: every member is merged
mesh/check pass 38dbe1d3a388 on 98f2f2406921 | unit 1909 run, 715 kept, 3 skipped | integration 1931 run, 813 kept, 3 skipped | over bound: unit (slow…
mesh/delivery merged: source.main moved to novox/mesh-sdk@d7c790d2422c
mesh/delivery-group group feat/1126-grants-first merged: every member is merged
mesh/check pass 38dbe1d3a388 on 98f2f2406921 | unit 1909 run, 715 kept, 3 skipped | integration 1931 run, 813 kept, 3 skipped | over bound: unit (slow…
This commit is contained in:
@@ -35,7 +35,7 @@ func beyondTheControllers(user string) map[string]bool {
|
|||||||
if !ok {
|
if !ok {
|
||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
for _, s := range append(readGrants("node-engine_have", "*.node"), NodeComposeReads(node)...) {
|
for _, s := range append(append(readGrants("node-engine_have", "*.node"), NodeComposeReads(node)...), NodeComposeAdvisories()...) {
|
||||||
out[s] = true
|
out[s] = true
|
||||||
}
|
}
|
||||||
return out
|
return out
|
||||||
@@ -129,6 +129,11 @@ func TestTheCopiedComposerComposesAsTheControllers(t *testing.T) {
|
|||||||
t.Errorf("a node is granted %s: %v, want %v", bucket, !granted, granted)
|
t.Errorf("a node is granted %s: %v, want %v", bucket, !granted, granted)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// It hears the creation of those two buckets, and of no other.
|
||||||
|
if got := NodeComposeAdvisories(); len(got) != 2 || got[0] != "$JS.EVENT.ADVISORY.STREAM.CREATED.KV_mesh-delivery-assigner_placement" ||
|
||||||
|
got[1] != "$JS.EVENT.ADVISORY.STREAM.CREATED.KV_mesh-delivery-assigner_candidates" {
|
||||||
|
t.Errorf("a node hears the creation of %v", got)
|
||||||
|
}
|
||||||
raw, err := os.ReadFile(filepath.Join("testdata", "controller-user-lists.json"))
|
raw, err := os.ReadFile(filepath.Join("testdata", "controller-user-lists.json"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
|
|||||||
@@ -931,6 +931,9 @@ func PermissionsFor(p Principal) (Permissions, error) {
|
|||||||
// And the backup holder's word that it backed the module up (ADR 0539 clause 16), whichever module holds
|
// And the backup holder's word that it backed the module up (ADR 0539 clause 16), whichever module holds
|
||||||
// node-backup: one event, by its name.
|
// node-backup: one event, by its name.
|
||||||
sub = append(sub, NodeAgentHears...)
|
sub = append(sub, NodeAgentHears...)
|
||||||
|
// And the creation of the seat mesh-placement's two states it composes from (ADR 0567 §9), so a node agent started
|
||||||
|
// before they exist binds each when the bus says it was made, with no timer; no other bucket's.
|
||||||
|
sub = append(sub, NodeComposeAdvisories()...)
|
||||||
// And, while the vault serves it, the vault's move-in in its own name and nobody else's (issue 676): the
|
// And, while the vault serves it, the vault's move-in in its own name and nobody else's (issue 676): the
|
||||||
// values sealed to this machine, which only it opens, handed in sealed to the vault's key for the call.
|
// values sealed to this machine, which only it opens, handed in sealed to the vault's key for the call.
|
||||||
if p.MovesIntoTheVault {
|
if p.MovesIntoTheVault {
|
||||||
|
|||||||
@@ -326,6 +326,12 @@ func NodeComposeReads(node string) []string {
|
|||||||
return append(out, readGrants(ResolvedBucket, node+".>")...)
|
return append(out, readGrants(ResolvedBucket, node+".>")...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NodeComposeAdvisories are the stream-created advisories of the seat mesh-placement's placement and candidates
|
||||||
|
// (ADR 0567 §9): what a node agent hears to bind each once it is made. Those two and no wider.
|
||||||
|
func NodeComposeAdvisories() []string {
|
||||||
|
return []string{StreamCreatedAdvisory(delivery.PlacementBucket), StreamCreatedAdvisory(delivery.PlacementCandidatesBucket)}
|
||||||
|
}
|
||||||
|
|
||||||
// ServedReadGrants is the read of each key of mesh-config's resolved values named, `<node>.<module>.<key>`
|
// ServedReadGrants is the read of each key of mesh-config's resolved values named, `<node>.<module>.<key>`
|
||||||
// (Principal.ServedReads, issue 1126): a get and a watch of that key alone. Each part is checked as every subject token
|
// (Principal.ServedReads, issue 1126): a get and a watch of that key alone. Each part is checked as every subject token
|
||||||
// is, so a key cannot widen the grant.
|
// is, so a key cannot widen the grant.
|
||||||
|
|||||||
Reference in New Issue
Block a user