7d64038f02
gates / gates (push) Successful in 6m45s
Hub: the R-120 golden guard judges only a CHANGED golden selection; offsite_snapshots_vanished / _unexplained (operator-only, hub-origin) on the 07:10 listing; internal/accesslog writes path-only lines to /data/access-log, 90 days. Installer: --rotate-recovery-only runs step 4b alone (rides the next installer tag). 03: the orphan check runs after a failed backup (agent 6545ccc). 02: the allow-list is empty, appdata_folders (controller v0.329.0). All red-proofed.
23 lines
850 B
Go
23 lines
850 B
Go
package api
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"gitea.dooplex.hu/admin/felhom-hub/internal/notify"
|
|
"gitea.dooplex.hu/admin/felhom-hub/internal/offsitekeys"
|
|
)
|
|
|
|
// R-895 slice 2: the hub's own snapshot-listing events are operator-only AND hub-origin only — not in
|
|
// allowedEventTypes, so no box can POST one to /api/v1/event (a box faking "your history vanished", or drowning a
|
|
// real one). Both registers pinned in one test (REUSE.md: fixing one and not the other is the realistic mistake).
|
|
func TestR895_SnapshotEventsAreOperatorOnlyAndHubOrigin(t *testing.T) {
|
|
for _, et := range []string{offsitekeys.EventSnapshotsVanished, offsitekeys.EventSnapshotsUnexplained} {
|
|
if !notify.IsOperatorOnly(et) {
|
|
t.Errorf("%s is not operator-only", et)
|
|
}
|
|
if allowedEventTypes[et] {
|
|
t.Errorf("%s is in allowedEventTypes — a box could POST it", et)
|
|
}
|
|
}
|
|
}
|