Omit a consumer's identity where 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 was carrying an empty `as`. A field that is always present and
usually empty teaches a reader to ignore it, including when it is not.
This commit is contained in:
2026-09-01 03:09:18 +02:00
parent 122680b554
commit 71f77617e3
2 changed files with 4 additions and 1 deletions
+4 -1
View File
@@ -396,7 +396,10 @@ type Contribution struct {
// 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.
As string `json:"as"`
// 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