docs: two designs, proposed and not built — the off-site copies of a removed app end after 30 days (D72), the installer below 200 GB (D75); hub: the account record never reaches the box's config
gates / gates (push) Successful in 2m9s

Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
admin committed 2026-11-14 18:44:26 +01:00
1 parent 73d99d06c5
commit a044eb8c16
7 files changed
+182 -3

No files matched your search

+4
View File
@@ -41,6 +41,10 @@ func Generate(templateYAML string, cfg *store.CustomerConfig, claimState *store.
}
}
// D71 (R-1375): `offsite_account` is the HUB's own record of an off-site account whose tier is switched off
// (offsite.AccountRecordKey). It is not configuration: the box is handed the tier as off and never this record.
delete(overrides, "offsite_account")
// Apply config_json overrides first (deep merge)
if len(overrides) > 0 {
base = deepMerge(base, overrides)
@@ -0,0 +1,35 @@
package configgen
import (
"strings"
"testing"
"gitea.dooplex.hu/admin/felhom-hub/internal/store"
)
// D71 (R-1375): the record of an off-site account whose tier is switched off is the hub's own (`offsite_account` in
// the household's config JSON). Every other key of that JSON is merged into the box's config — this one must not
// be: the box is handed the tier as OFF and never the record. The other keys still arrive.
// COMPANION RED-PROOF (observed, audits/night-build-2026-11-14/B/redproof-hub-offsite-record.txt).
func TestGenerate_TheAccountRecordNeverReachesTheBox(t *testing.T) {
cfg := &store.CustomerConfig{CustomerID: "c1", ConfigJSON: `{"logging":{"level":"debug"},` +
`"offsite_account":{"type":"shared","user":"u1-sub3","host":"u1-sub3.example","unticked_at":"2026-11-14T20:00:00Z"}}`}
y, err := Generate("customer:\n id: x\n", cfg, nil)
if err != nil {
t.Fatal(err)
}
for _, leak := range []string{"offsite_account", "u1-sub3", "unticked_at"} {
if strings.Contains(y, leak) {
t.Fatalf("the box's config carries the hub's account record (%q):\n%s", leak, y)
}
}
if !strings.Contains(y, "level: debug") {
t.Fatalf("the other keys of the config JSON did not reach the box:\n%s", y)
}
// a TICKED tier still reaches the box as before
cfg.ConfigJSON = `{"offsite":{"enabled":true,"type":"shared","user":"u1-sub3"}}`
y, _ = Generate("customer:\n id: x\n", cfg, nil)
if !strings.Contains(y, "offsite:") || !strings.Contains(y, "u1-sub3") {
t.Fatalf("a ticked off-site tier must still reach the box:\n%s", y)
}
}