mesh-wireguard: the two provisions say their credential form (none), as the manifest validator requires of every offer (V1; issue 1966)

Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i
This commit is contained in:
2026-11-05 17:27:53 +01:00
parent e313ac9d3b
commit 122f640963
3 changed files with 38 additions and 3 deletions
+6 -1
View File
@@ -65,7 +65,12 @@ func Manifest() map[string]any {
"module": Name,
"version": "1",
"computed": Name,
"provides": []string{Requirement, Addressing},
// A provision says its credential's form (the manifest validator, DLV credential forms): the network and the
// addresses are used with no login of a consumer's own.
"provides": []map[string]any{
{"name": Requirement, "credential": map[string]any{"form": "none"}},
{"name": Addressing, "credential": map[string]any{"form": "none"}},
},
"claims": []map[string]any{{"name": TheNetwork, "scope": "node"}},
}
}
@@ -54,3 +54,23 @@ func TestThePrivateNetworksClaimIsASeatTheMeshDefinesAndModuleJSONSaysTheSame(t
t.Errorf("module.json beside its build is %v, Manifest() is %v", onDisk, composed)
}
}
// Each provision the module offers says its credential's form, as the manifest validator requires of every offer.
func TestEveryProvisionTheModuleOffersSaysItsCredentialForm(t *testing.T) {
raw, err := json.Marshal(Manifest())
if err != nil {
t.Fatal(err)
}
m, err := catalogue.Decode(raw)
if err != nil {
t.Fatal(err)
}
if len(m.Provides) != 2 {
t.Fatalf("the module provides %+v: the network and the addresses", m.Provides)
}
for _, o := range m.Provides {
if o.Credential == nil || o.Credential.Form != "none" {
t.Errorf("%s offers credential %+v: the form is none", o.Name, o.Credential)
}
}
}
+12 -2
View File
@@ -3,8 +3,18 @@
"version": "1",
"computed": "mesh-wireguard",
"provides": [
"private-network",
"mesh-addressing"
{
"name": "private-network",
"credential": {
"form": "none"
}
},
{
"name": "mesh-addressing",
"credential": {
"form": "none"
}
}
],
"claims": [
{