package api import ( "testing" "gitea.dooplex.hu/admin/felhom-hub/internal/monitor" "gitea.dooplex.hu/admin/felhom-hub/internal/notify" ) // R-1150 (v0.159.0): the refused whole-guest backup pair is operator-only AND hub-origin only — not in // allowedEventTypes, so no box can POST one to /api/v1/event. The alarm says the guest's controller may be // compromised; that controller holds the /event credential, and a type it could post it could fake, or post // first to spend the operator cooldown and drown the real one (the R-895 reasoning). Both registers in one test. func TestR1150_RefusedBackupEventsAreOperatorOnlyAndHubOrigin(t *testing.T) { for _, et := range []string{monitor.EventWholeGuestBackupRefused, monitor.EventWholeGuestBackupRefusalCleared} { 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) } } }