Declare ssh-client's keys state and its forge-account requirement (issue 955 S2)

This commit is contained in:
fix-955-ssh
2026-10-16 22:43:29 +02:00
parent b2009f1bb5
commit a4cdd05cb2
2 changed files with 32 additions and 0 deletions
@@ -62,3 +62,29 @@ func TestEveryFileTakesItsTextFromATemplate(t *testing.T) {
t.Errorf("the build packs files/ into %d archives, not one", packs)
}
}
// Issue 955, area S2: the module keeps the keys state and requires the forge's account provision. It declares
// no provision `ssh-key`: the state serves the public half (novox/hq ADR 0400 §1).
func TestManifestKeepsKeysAndRequiresForgeAccount(t *testing.T) {
raw, err := os.ReadFile(filepath.Join(moduleDir, "module.json"))
if err != nil {
t.Fatal(err)
}
var m struct {
State []string `json:"state"`
Requires []any `json:"requires"`
Provides []any `json:"provides"`
}
if err := json.Unmarshal(raw, &m); err != nil {
t.Fatal(err)
}
if len(m.State) != 1 || m.State[0] != "keys" {
t.Errorf("state = %v, want [keys]", m.State)
}
if len(m.Requires) != 1 || m.Requires[0] != "forge-account" {
t.Errorf("requires = %v, want [forge-account]", m.Requires)
}
if len(m.Provides) != 0 {
t.Errorf("provides = %v, want none (no ssh-key provision yet)", m.Provides)
}
}
+6
View File
@@ -11,6 +11,12 @@
"ssh_client_known_host",
"ssh_client_test"
],
"requires": [
"forge-account"
],
"state": [
"keys"
],
"data": {
"own": [
{