Ask the packet filter's holder allowed at every compose of the filter
The node-engine stays the one renderer of the filter file: at each compose of a converged node's filter it asks the holder of node-packet-filter its verb allowed within the setting compose-ask-bound (10 s) and renders the answer. When allowed does not answer, or answers what is not its answer, no filter file is composed: the one loaded is kept as it runs, the holder's module is not held (an old holder must stay replaceable), and the part withheld is said once in the journal until an answer comes between. The node hears allowances-changed on its own node's subject and composes again. The manifest invokes seat:node-packet-filter.allowed and consumes node-packet-filter.allowances-changed. Builds: design 08 control-verbs §1, §3, §4, §5, §7, §8; ADR 0683; H-A-305, H-A-307 (1), (2), H-A-314 (3), (5), (7), H-A-315 (2), (6), H-A-321
This commit is contained in:
@@ -364,6 +364,33 @@ func RunsAnyOf(runs *engcomp.Composed, module string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// FilterRunning is the content of the packet filter's file as it runs (the resource `<module>.filtering` of the module that
|
||||
// loads the filter), nil where none runs: kept as it runs when the holder's allowed does not answer (design 08
|
||||
// control-verbs §4).
|
||||
func FilterRunning(running []engcomp.Composed) *string {
|
||||
for _, c := range running {
|
||||
for _, raw := range c.Resources {
|
||||
var r struct {
|
||||
ID string `json:"id"`
|
||||
Module string `json:"module"`
|
||||
Type string `json:"type"`
|
||||
Content *string `json:"content"`
|
||||
}
|
||||
if json.Unmarshal(raw, &r) != nil || r.Type != "file" || r.Content == nil {
|
||||
continue
|
||||
}
|
||||
owner := r.Module
|
||||
if owner == "" {
|
||||
owner, _ = declaration.ModuleGuess(r.ID)
|
||||
}
|
||||
if owner != "" && r.ID == owner+"."+catalogue.FilteringID() {
|
||||
return r.Content
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ToolsRunning is, by module, the tools bundles that run on the node (Node.RunsTools): each bundle archive a module's
|
||||
// resource unpacks at its BundlePath, with what the runtime's own process loads of it and the words it hands it
|
||||
// (catalogue.RuntimeToolModules, catalogue.RuntimeToolEnv, the mesh's own words left out). A bundle the runtime loads
|
||||
|
||||
Reference in New Issue
Block a user