package catalogue // Turning a resolution into the declaration a node is sent. // // Separate from resolving because they answer different questions. Resolving asks *what should // this machine run*; this asks *what does that look like as resources*, and the second is where // settings are applied, generators are called, contributions are collected and credentials are // placed. Both lived in one file until it was doing four jobs at once — which is the shape the // system this replaces failed in, one import at a time. import ( "encoding/json" "fmt" "sort" "strconv" "strings" "time" ) // SettingsBy is the layers that apply to each module, keyed by module name. type SettingsBy map[string][]Layer // Generator works out a module's resources for one node, where they cannot be written in advance. type Generator interface { // Resources for this node. Absent means the node is not part of whatever this generates, // which is an ordinary answer rather than a failure — a machine assigned the module before it // has an address on the network is in exactly that state. Resources(node string) ([]map[string]any, bool, error) } // OpensPorts is a generator that also says what its resources accept connections on. // // **Separate from Generator, because most generators have nothing to say here** and requiring an // empty method of each would be a cost paid everywhere for one caller. // // It exists because a static field cannot express this. A hub accepts connections from every node // at other sites; a machine that is not a hub dials out and needs nothing open — and they are the // same module. `listens` in a manifest is one answer for every machine that runs it, so the // machine that most needs filtering, the one facing the public internet, was the one whose rule // set would have closed its own overlay. type OpensPorts interface { // Listens is what this node accepts on because of what was computed for it. Nothing is the // ordinary answer: most machines running a computed module open no port at all. Listens(node string) ([]Listening, error) } // Grant is one consumer's credential, on the machine that must create it. type Grant struct { // Provision is what was required. Provision string // Consumer is the node that will use it. Consumer string // From is the module on that machine which asked. // // **Part of who this credential is for, not a label** (novox/hq 04-ISSUES/022). Together with // Consumer it names one consumer; the node alone does not, because a machine routinely runs // several modules wanting the same thing. It is also what the provider names the role or the // bucket or the client after, so withdrawing one consumer does not take another's away. From string // Values are what that module contributed — the name it wants, and anything else the // provision's own vocabulary defines. Values map[string]any // Local is the name the credential goes by inside the consumer where it keeps several for one // provision (ADR 0094); empty for the ordinary one. The provider sees it as a holder of its own. Local string // Slug is the consumer module's identity slug, if it declared one — carried on the grant so the // provider side derives the same login the consumer does, even across nodes where the consumer's // manifest is not in view (novox/hq ADR 0049). Empty means "use the module name". Slug string // At is where the consuming machine is on the private network, empty if it is not on one. // // Passed in with the grant because it is a fact about another machine, and resolution answers // questions about one. A provider that must reach back to its consumer — a reverse proxy is // the whole reason this exists — otherwise has to know how the mesh names machines. At string // Sealed is the credential, closed to the providing node. Sealed string } // Rendering is everything needed to turn a resolution into the declaration a node is sent. type Rendering struct { // Certificate is what the mesh issued for this machine's internal name, and the mesh's own // certificate. Both public — the key they belong to never left the machine. Certificate string Authority string // Needed is each module's own secrets, sealed to this node, keyed by module and then by the // name the module gave it. Needed map[string]map[string]string // Mesh is every node's address on the private network, which is what a rule saying "from the // mesh" resolves to. Passed in for the same reason grants are: who else is on the network is // a fact about the mesh, and resolution answers questions about one machine. Mesh []string // Kept is every operator-sealed secret in the mesh, for a module that `keeps` them. Nil when // nothing on this node keeps them, or the mesh has no operator key. Kept *KeptExport // Foundation is the ports the mesh itself needs reachable on every machine, which no module // declares because the foundation is not a module (novox/hq 04-ISSUES/051 and 052). The broker // is the one that matters: a machine dials it to enrol, and a firewall derived only from // modules closes it. Foundation []int // Names is every machine's internal name and its address, for containers to be given. // // **A container does not inherit the machine's names**, so every internal name the mesh wrote // is invisible to what the machine runs. Given here rather than looked up on the machine, // because which machines exist is a fact about the mesh. Names map[string]string Settings SettingsBy Generators map[string]Generator // Grants are the credentials this node must create, for the provisions it offers. Passed in // rather than resolved, because who consumes a node is a fact about the rest of the mesh and // resolution answers questions about one machine. Grants []Grant // Ports is where this machine puts what each module needs reachable, by module and by the // port the software itself uses (novox/hq ADR 0038). // // **The one place the number now lives.** A module used to write it three times — for the rule // set, for what a consumer is told, and for what the runtime publishes — and nothing checked // that the three agreed. They are all derived from this. Ports map[string]map[int]int } // machinePort is where a module's port lives on this machine, or the port itself when the mesh has // not been asked. Unassigned is not an error here: a module with no `listens` never needed one, // and a caller composing a declaration without a store still gets something coherent. func (r Rendering) machinePort(module string, wanted int) int { if at, known := r.Ports[module][wanted]; known { return at } return wanted } // Declaration is everything the resolved modules put on the node, with settings applied. // // Resource identities are prefixed with the module they came from. Two modules may reasonably // both call something "config", and without this the second would silently replace the first — // the node applying one of them and reporting success. func (r Resolution) Declaration(with Rendering) ([]map[string]any, error) { // Where each provision's credentials land, so a contribution can name the file rather than // carry a value the mesh does not have. directories := map[string]string{} for _, m := range r.Modules { for provision, where := range m.Grants { directories[provision] = where } } given, err := r.contributions(with.Settings, with.Grants, directories) if err != nil { return nil, err } // A workload on THIS machine contributes the port it declared, and the machine may have // published it somewhere else (novox/hq ADR 0066). The mirror of the redirect below: 038 fixed // what a consumer is TOLD about a provider, and this is what a workload TELLS the provider about // itself — gitea declaring 3000, published as 20000:3000, and the co-located proxy dialling 3000, // where nothing listens, for every request. // // **The contributing module's assignment, never the provider's.** The port belongs to the // workload; using the map of whatever answers the requirement would move a route to wherever the // proxy happens to be published. A contribution carried here from another machine is left exactly // as it is — its port is that machine's to assign, and this map knows nothing about it. for provision := range given { for i := range given[provision] { said := &given[provision][i] if said.Node != "" && said.Node != r.Node { continue } said.Values = atMachinePort(said.Values, said.From, with.Ports) } } // A provider answered on this same machine never passed through the walk that works out what a // provider on ANOTHER machine serves (novox/hq 04-ISSUES/038, ADR 0066). That walk does two // things — it derives the served facts with the provider node's port assignments, and it settles // them with that node's settings layers — and the same-node paths (resolve.go's servedHere, and // here() below) did neither, because both run while resolving, before either is known. // // The port was the first half to be noticed (038). The second half is worse and quieter: a served // value the OPERATOR supplied — a certificate authority's root, which is the one kind of value a // manifest cannot carry, because it differs on every mesh — arrived as the manifest's empty // default. A proxy then wrote an empty CA bundle, fell back to the system trust store, could not // verify the internal authority, and stopped issuing with nothing saying why. // // So it is re-derived here, in full, exactly as the cross-node path derives it. **After the // closure is known**, which also removes an order dependence: the resolver built these needs // mid-walk from whichever modules had been chosen by then, so what a co-located binding carried // depended on the order somebody happened to assign things in. for i := range r.Needs { if r.Needs[i].ByRecord || r.Needs[i].From != r.Node { continue } serves, answered, err := r.servedOnThisMachine(r.Needs[i].Name, with) if err != nil { return nil, err } if answered { r.Needs[i].Serves = serves } } // Once, from every module's listens -- not per module. A module receiving only its own ports // would write a rule set that closed every other module on the machine. Each module's per-node // exposure settings override its listens' source first (novox/hq ADR 0046). exposure := map[string]map[int]string{} for _, m := range r.Modules { e, err := Exposure(m, with.Settings[m.Module]) if err != nil { return nil, err } if e != nil { exposure[m.Module] = e } } rules, err := r.Filtering(with.Generators, with.Ports, exposure) if err != nil { return nil, err } filtering := AsNftables(rules, with.Mesh, r.PublicDomain != "", with.Foundation) var out []map[string]any for _, m := range r.Modules { resources := m.Resources // What the mesh computes for this module goes FIRST, before the module's own resources. // // **Order is stated, not derived — the host does not sort** (novox/hq ADR 0005), so // whatever the mesh writes down is the order a machine applies. A module's service or // container routinely depends on one of these files; nothing here ever depends on a // module's resources, because none of it is computed from them. // // Appended, this was wrong in a way that only showed on the first apply and then healed: // the service started before its certificate or its rule set existed, failed, and the next // reconcile fixed it. A fault that repairs itself on the second attempt is worse than one // that does not, because what gets remembered is that it works. var first []map[string]any if f := m.Filtering; f != nil { first = append(first, map[string]any{ "id": FilteringID(), "type": "file", "path": f.Into, "content": filtering, "mode": "0600", }) } if c := m.Certificate; c != nil { if with.Certificate == "" { // Asked for and not issued. Refused rather than skipped: a module that serves TLS // with no certificate does not start, and the reason is somewhere else entirely. return nil, fmt.Errorf( "%s wants a certificate for this machine and none was issued", m.Module) } first = append(first, map[string]any{ "id": CertificateID(), "type": "file", "path": c.Into, // Public. It travels in the open like any other file, because it is a statement // about a key rather than the key. "content": with.Certificate, "mode": "0644", }) if c.Authority != "" { first = append(first, map[string]any{ "id": AuthorityID(), "type": "file", "path": c.Authority, "content": with.Authority, "mode": "0644", }) } } for _, name := range sortedKeys(m.OwnSecrets) { sealed := with.Needed[m.Module][name] if sealed == "" { // Declared and not made. Refused rather than skipped: a module whose own // credential is silently absent starts, fails to authenticate, and the reason is // three layers away from the machine reporting it. return nil, fmt.Errorf( "%s needs a secret called %q and none was made for it", m.Module, name) } first = append(first, ownedBy(m.SecretsOwner, map[string]any{ "id": NeedID(name), "type": "file", "path": m.OwnSecrets[name], "sealed": sealed, })) } // Operator-owned paths this module is granted use of (novox/hq ADR 0051). Written before // the module's own resources, and so before the container that mounts them: the host must // find each present — refusing clearly if the operator has not provided it — before it // starts anything that depends on it. The mesh creates, chowns and reconciles none of it; // an `access` resource says only *this path must exist, and this module reaches it*. for _, a := range m.Accesses { first = append(first, map[string]any{ "id": AccessID(a.Path), "type": "access", "path": a.Path, "mode": a.At(), }) } for _, to := range m.SecretRequirements() { for _, file := range m.SecretFiles(to) { var found *Needed for i, n := range r.Needs { // **This module's need, not the provision's** (novox/hq 04-ISSUES/022). Matching // on the name alone, every consumer of a provision took whichever credential // happened to be last in the list — so on a node with two of them, one module // would be given the other's password and fail to authenticate with a valid // credential belonging to somebody else. And this file's local name, where the // module keeps several (ADR 0094). if n.Name == to && n.For == m.Module && n.Local == file.Local { found = &r.Needs[i] } } if found != nil && found.ByRecord && found.Sealed == "" && !found.Manager { // Answered by a record whose key has not been supplied since this consumer was // put on it. **Refused, not skipped.** The mesh discarded the plaintext when the // key was accepted and cannot seal another, so a machine that resolved cleanly // would receive no file at all and fail at whatever tried to read it — which is // the outcome ADR 0024 exists to avoid, arrived at politely. // // The manager holder is the one exception (novox/hq ADR 0050): an empty refresh token // is a licence whose manager has not adopted one yet, a real waiting state rather than // a lost key. It falls through to the skip below — its bound facts (carrying the // manager's public key) are still delivered, which is what adoption needs to seal the // first refresh token. return nil, fmt.Errorf( "%s on this machine uses the licence %q and no key has been sealed to it. "+ "The mesh cannot make one; supply it again with `licence key %s`", m.Module, found.From, found.From) } if found == nil || found.Sealed == "" { // Answered on this machine, or answered by a node the mesh could not seal to. // Nothing to write either way, and writing an empty credential file would be // worse than none: something would read it and fail authenticating. continue } first = append(first, ownedBy(m.SecretsOwner, map[string]any{ "id": SecretID(SecretLocal(to, file.Local)), "type": "file", "path": file.Path, "sealed": found.Sealed, })) } } for _, to := range sortedKeys(m.Grants) { for _, g := range with.Grants { if g.Provision != to { continue } if g.From == "" { // Nothing on that machine asks for this any more. Skipped here rather than // where grants are gathered, so the rule holds whoever gathers them. // // **This is how a credential is withdrawn.** The provisioner removes what // nobody asks for, and it can only do that if the mesh stops asking — a // consumer that was unassigned would otherwise keep a working login for ever, // and nothing would say so. continue } first = append(first, map[string]any{ // One file per holder — the consumer's module with its local name after it // where it keeps several (ADR 0094); the lab found two files with one id. "id": GrantID(to, g.Consumer+"."+holderAs(g.From, g.Local)), "type": "file", "path": grantPath(m.Grants[to], g.Consumer, holderAs(g.From, g.Local)), "sealed": g.Sealed, }) } } for _, to := range sortedKeys(m.Binds) { var found *Needed for i, n := range r.Needs { if n.Name == to && n.For == m.Module { found = &r.Needs[i] } } if found == nil { // Answered on this same machine rather than from elsewhere in the mesh. // // **Still written.** It used to be skipped, reasoning that "it is on this node" // is a fact nobody needs — and that is true of the *location* and false of // everything beside it. A binding also carries what the provider said a consumer // must know, which is the port; a consumer cannot invent that, and got an absent // file with no explanation. A build machine sharing a node with the registry it // pushes to sat in a loop saying it could not read its own binding. here, err := here(r, to, with) if err != nil { return nil, err } if here == nil { // Nothing in this node's set offers it either, so there is genuinely nothing // to say. Resolution has already refused anything unanswerable, so this is a // requirement met by the module itself. continue } found = here } file, err := boundFile(*found, m.Binds[to], ConsumerIdentity(r.Node, IdentitySource(m.Slug, m.Module))) if err != nil { return nil, err } first = append(first, file) } for _, to := range sortedKeys(m.Receives) { file, err := receivedFile(to, m.Receives[to], given[to]) if err != nil { return nil, err } first = append(first, file) } if m.Keeps != "" && with.Kept != nil { file, err := keptFile(m.Keeps, with.Kept) if err != nil { return nil, err } first = append(first, file) } if m.Computed != "" { generator, known := with.Generators[m.Computed] if !known { return nil, fmt.Errorf( "%s says its resources are computed by %q, and this control plane has no %q", m.Module, m.Computed, m.Computed) } generated, part, err := generator.Resources(r.Node) if err != nil { return nil, err } if !part { // Assigned, and not yet part of what this generates. Nothing to put on the // machine, which is different from an error: a node given the network module // before it has an address is in exactly that state, briefly. continue } resources = generated } // Now, and not before: a module whose resources are computed replaces them wholesale, and // merging earlier would throw away the files it still needs. resources = append(append([]map[string]any{}, first...), resources...) // Every container is given the mesh's names. Not a choice a module makes: a module that // listed them would go stale the day a machine joins, and one that did not would be a // module whose containers cannot reach anything by name. // // A container that was given names of its own keeps them and gets the mesh's beside them: // the mesh does not know what else a workload needs to reach, and taking something away // to add something is not what "also" means. if len(with.Names) > 0 { resources = withMeshNames(resources, with.Names) } // What this module may name from inside one of its own files. Gathered once per module // rather than per file, because it is a fact about the module. sealed, err := sealedFor(m, r.Needs, with) if err != nil { return nil, err } // And what its bindings say, for the half of a connection that is not secret. known := knownFor(m, r.Needs, r.Node) // And the machine underneath, which no binding of its own can tell it. thisMachine := machineFacts(r) // Which of this module's files carry a secret, for the rule that a container may not read // one of them as its environment without saying so (ADR 0086, issue 041). secretFiles := secretFilesOf(resources) for _, unsettled := range resources { resource, err := ApplySettings(unsettled, with.Settings[m.Module]) if err != nil { return nil, err } copied := map[string]any{} for k, v := range resource { copied[k] = v } if err := refuseSecretsInEnvironment(copied, secretFiles, m.Module); err != nil { return nil, err } // Said in the catalogue, not on the machine: the host parses strictly and knows no // such field, and the reason is for a reader of the manifest. delete(copied, SecretsInEnvironment) // **After settings, and that is the whole reason it is here.** A module's file // content is where a setting lands, so a placeholder may only exist once the setting // has been put in — filling secrets first would look at content that is not yet what // the machine receives. if err := intoFile(copied, sealed, m.Module); err != nil { return nil, err } // **Substituted here, not on the machine.** A bound value is not secret — the mesh // holds it in the clear — so there is nothing for the host to be the only witness of, // and sending it already filled in means the host learns no new field. if err := boundInto(copied, known, m.Module); err != nil { return nil, err } // And what the module could not have written: the machine it turned out to be // assigned to. Beside the bound values because it is the same kind of fact — the // mesh's own, held in the clear — and because a module that must name itself to // something else has no binding to learn it from (novox/hq ADR 0066). // Which port this machine gave it, for a module that binds directly rather than // through a runtime that can remap (ADR 0038). Applied before the machine's facts so // a refusal names the port rather than whatever came after it. if err := portInto(copied, m.Module, m.Listens, with); err != nil { return nil, err } if err := machineInto(copied, thisMachine, m.Module); err != nil { return nil, err } if err := pinned(copied, m.Module); err != nil { return nil, err } // And the other half of the same question: an image nobody has published yet is named // by an artifact rather than by a placeholder digest, and is just as unrunnable. if err := built(copied, m.Module); err != nil { return nil, err } publishedOn(copied, m.Module, with) copied["id"] = m.Module + "." + fmt.Sprint(resource["id"]) // A service saying what it reflects names resources within its own module, so those // are prefixed too or they would point at nothing. // // **Unless it already names one.** A module may reflect a file another module put on // the machine — the case this exists for is a resolver restarting when the mesh // rewrites the names, which are computed by the mesh and belong to its module, not to // the daemon's. Written `.`, and a dot is what marks it as already // answered: prefixing it again would point at nothing, silently, and the daemon would // serve the old names for ever while everything reported success. if renamed := reflectsRenamed(m.Module, resource["restart-on"]); renamed != nil { copied["restart-on"] = renamed } out = append(out, copied) } // **What only the mesh knows, where this module asked for it.** The graph is the control // plane's; making a name resolve is the module's software. Emitted as ordinary files under // this module's name, so they are applied, reported and removed exactly as anything else // it declares. given, err := FactsInto(m, r, with.Names) if err != nil { return nil, err } for _, fact := range given { fact["id"] = m.Module + "." + fmt.Sprint(fact["id"]) out = append(out, fact) } } return out, nil } // Contribution is one module telling the answer to a requirement what it needs from it. type Contribution struct { // From is the module that said it, so the provider and a person reading the file can tell // which route belongs to what. From string `json:"from"` // Node is the machine it said it from, empty when that is this one. // // A provision answered from anywhere in the mesh has consumers on other machines, and the // provider has to know who they are — a database told to create a password and not who for // cannot do anything with it. Contributions were node-local until this, which meant the one // case that most needed them was the one they did not reach. Node string `json:"node,omitempty"` // At is where that machine is on the private network, empty when it is not on one or when it // is this machine. // // The mesh knows it and a provider should not have to derive it. A reverse proxy is told // *send traffic to this consumer* and has to open a connection — so without this every // provider that reaches back to a consumer would have to know how the mesh names machines, // which is a convention leaking into every module that implements a provision. At string `json:"at,omitempty"` // As is who this consumer is: what the provider should call the login it creates. // // **Said by the mesh rather than invented by the provisioner** (novox/hq 04-ISSUES/023). It // used to be neither — the provisioner made a name, and the consumer, which has to present it // to authenticate, had no way to learn it. One derivation reaches both ends, so they agree by // construction. // Omitted when there is none. A contribution that is not a credential grant — a module // offering something to another on its own machine — has nobody to be identified to, and a // field that is always present and usually empty teaches a reader to ignore it. As string `json:"as,omitempty"` // Secret is the file on this machine holding that consumer's credential, sealed to it. // // Named rather than carried, for the same reason the private network's key is: the mesh // discarded the value and could not put it here if it wanted to. What is here is where to // find it. Secret string `json:"secret,omitempty"` // Values are the module's own, with settings applied. What the keys mean is agreed by the // requirement's name — everything providing `reverse-proxy` understands the same shape, which // is what makes swapping one for another cost nothing. Values map[string]any `json:"values"` } // grantPath is where one consumer's sealed credential lands on the providing machine. // // Suffixed, so the directory can also hold whatever the module writing it keeps there and so a // node named like something else in that directory cannot collide with it. // One file per consumer, and a consumer is a module on a machine (novox/hq 04-ISSUES/022). // // Named after both. Named after the machine alone, two modules on one node wrote to one path: the // second overwrote the first, and the provisioner — reading a directory — saw one consumer where // there were two. // reflectsRenamed is a resource's restart-on list under the module's prefix, or nil when it has // none. It reads both the shape JSON parsing produces ([]any) and the shape code composing // resources natively produces ([]string): a reference that was skipped because its list arrived // in the other shape would point at nothing — silently, with the service never restarting and // every check passing, which is how a runtime kept serving without the registry trust its // daemon file already carried. func reflectsRenamed(module string, reflects any) []any { var names []string switch v := reflects.(type) { case []any: for _, id := range v { names = append(names, fmt.Sprint(id)) } case []string: names = v } if names == nil { return nil } var renamed []any for _, named := range names { if strings.Contains(named, ".") { renamed = append(renamed, named) continue } renamed = append(renamed, module+"."+named) } return renamed } func grantPath(directory, consumer, module string) string { return strings.TrimRight(directory, "/") + "/" + consumer + "." + module + ".secret" } // holderAs is a consumer's name at the provider with a local name after it, where it keeps several // credentials for one provision (ADR 0094); the name alone otherwise. func holderAs(as, local string) string { if local == "" { return as } return as + "_" + local } // contributions collects what every module in this set contributes, by requirement. // // Ordered by contributing module, because the result becomes a file on a machine and a file whose // lines move about is a file that looks changed when nothing changed. func (r Resolution) contributions(settings SettingsBy, grants []Grant, directories map[string]string) (map[string][]Contribution, error) { out := map[string][]Contribution{} modules := append([]Manifest{}, r.Modules...) sort.Slice(modules, func(i, j int) bool { return modules[i].Module < modules[j].Module }) // What consumers on other machines asked for. Merged in with this machine's own, because from // the provider's side they are the same thing — somebody wanting something — and a provider // that had to read two lists would be a provider that reads one of them. sorted := append([]Grant{}, grants...) sort.Slice(sorted, func(i, j int) bool { if sorted[i].Provision != sorted[j].Provision { return sorted[i].Provision < sorted[j].Provision } if sorted[i].Consumer != sorted[j].Consumer { return sorted[i].Consumer < sorted[j].Consumer } return sorted[i].From < sorted[j].From }) // A consumer already carried by the grants loop, keyed (provision, module). When provider and // consumer are co-located, `grantsFor` enumerates the same-node consumer too, so without this the // module would be emitted a second time by the m.Contributes loop below — once full (with the // grant's secret/as) and once partial — which is the duplicate seen in a co-located mesh.json. granted := map[string]map[string]bool{} for _, g := range sorted { if g.From == "" { // As above: nothing on that machine asks for this any more, so the provider is not // told about it and withdraws the login on its next pass. continue } out[g.Provision] = append(out[g.Provision], Contribution{ From: g.From, Node: g.Consumer, At: g.At, Values: g.Values, // One holder per local name: the identity the consumer is known by, and the local name // after it where the module keeps several (ADR 0094). Not a login any backend checks — // a secret is not a login — so the identity limit does not apply to the suffix. As: holderAs(ConsumerIdentity(g.Consumer, IdentitySource(g.Slug, g.From)), g.Local), Secret: grantPath(directories[g.Provision], g.Consumer, holderAs(g.From, g.Local)), }) if granted[g.Provision] == nil { granted[g.Provision] = map[string]bool{} } granted[g.Provision][g.From] = true } for _, m := range modules { for _, to := range sortedKeys(m.Contributes) { // The grants loop already emitted this module's contribution to this provision, with its // minted secret — emitting the partial copy again would duplicate it. A contribution with // no grant (a reverse-proxy route names a host, not a credential) is not in `granted`, so // it still reaches the provider from here. if granted[to][m.Module] { continue } // Settings reach a contribution the same way they reach a file. A route's hostname is // exactly the kind of thing that differs between one mesh and the next, and a module // that could not have it set would have to be edited to be reused. values, err := settle(m.Contributes[to], settings[m.Module], nil, m.Module+" contributing to "+to) if err != nil { return nil, fmt.Errorf("%s contributing to %s: %w", m.Module, to, err) } composeName(values, r.PublicDomain) out[to] = append(out[to], Contribution{From: m.Module, Values: values}) } } return out, nil } // composeName joins a contribution's label with a node's public domain, in place (novox/hq ADR // 0056). // // **The whole of what the mesh does with a route's name: join two given strings.** A contribution // carries a `label` — the subdomain its operator chose — and the node carries its public domain; // the granted name is `