hub (unreleased): two end dates warn the operator 14 days before — an operator token and a box's web certificate (R-1379, D77); the other sixteen as a design table

Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
admin committed 2026-11-14 18:14:23 +01:00
1 parent 68292e40f6
commit 86bb912a4b
11 files changed
+527 -5

No files matched your search

+22
View File
@@ -946,6 +946,27 @@ func main() {
return ""
},
dataStore.OSAlarmRaised, dataStore.SetOSAlarmRaised, hubEvent, logger)
// R-1379 (D77, decision 298): 14 days before an operator token or a box's web certificate ends. Hourly, on the sweep.
endDateChecker := monitor.NewEndDateChecker(
func() ([]monitor.EndingToken, error) {
toks, err := dataStore.ListAPITokens()
var out []monitor.EndingToken
for _, t := range toks {
if t.RevokedAt == nil {
out = append(out, monitor.EndingToken{ID: t.ID, Name: t.Name, ExpiresAt: t.ExpiresAt})
}
}
return out, err
},
func() ([]monitor.BoxCertReport, error) {
cs, err := dataStore.GetCustomers()
out := make([]monitor.BoxCertReport, 0, len(cs))
for _, c := range cs {
out = append(out, monitor.BoxCertReport{CustomerID: c.CustomerID, ReportJSON: c.ReportJSON})
}
return out, err
},
dataStore.OSAlarmRaised, dataStore.SetOSAlarmRaised, hubEvent, logger)
// D53 (`08` §10): a held app reaches the OPERATOR — one reminder after the grace per reason, then weekly.
var heldGrace time.Duration
if v := cfg.Alerting.HeldAppGraceOverride; v != "" {
@@ -989,6 +1010,7 @@ func main() {
offsiteDeliveryChecker.Check()
controllerSupervisorChecker.Check()
signedJobWaitChecker.Check() // R-1383: a signed job a box did not take in two hours
endDateChecker.Check() // R-1379: once an hour inside
heldAppsChecker.Check() // D53: throttled to one pass per 15 min
if goldenVouchChecker != nil {
goldenVouchChecker.Check() // R-242: throttled to one Gitea listing per 15 min
+3 -1
View File
@@ -60,12 +60,14 @@ func TestR1383_MainWiresTheSilentFailureChecks(t *testing.T) {
seen["lost-mail scan"]++
case recv == "signedJobWaitChecker" && name == "Check":
seen["signed-job sweep"]++
case recv == "endDateChecker" && name == "Check":
seen["end-date sweep"]++ // R-1379
}
}
return true
})
}
for _, k := range []string{"ledger built", `watched "deadline-check"`, `watched "offsite-key-audit"`, "lost-mail scan", "signed-job sweep"} {
for _, k := range []string{"ledger built", `watched "deadline-check"`, `watched "offsite-key-audit"`, "lost-mail scan", "signed-job sweep", "end-date sweep"} {
if seen[k] != 1 {
t.Errorf("main.go: %s — found %d time(s), want 1", k, seen[k])
}