move_detect/cloud/tests
유창욱 930490d1b4 feat(cloud,edge): event dedup (event_uuid) + site-scoped access control (P1-9, P3-2b)
Two approved data-model changes.

P1-9 — ingest idempotency. A POST can succeed server-side but time out
client-side; the edge then re-queues and re-sends the same event, so the
cloud stored duplicate alerts. The edge Event now carries a stable
event_uuid (uuid4 hex) generated once at creation and preserved through
the offline queue and every retry. Cloud: events.event_uuid CHAR(32) NULL
UNIQUE; EventValidator accepts/validates it; IngestController returns the
already-stored event (200, dedup:true) on a repeat uuid, race-safe against
the UNIQUE key (catches the insert-race PDOException and returns the
winner).

P3-2b — site-scoped access control. site_scope was stored in the session
but never enforced, so any authenticated user could read every site's
worker snapshots (PIPA). Added devices.site; ingest denormalizes it onto
events.site (server-derived from the authenticated device_id, never
client-supplied). App\Security\SiteScope centralizes the rule (NULL scope
= global operator). The event list filters in SQL (page(...,$site)); event
detail + acknowledge and the snapshot proxy guard per-row and return 404
(not 403) cross-site so existence never leaks.

Schema migration ALTERs and per-device/user provisioning UPDATEs are
documented at the bottom of schema.sql.

Tests: edge queue round-trip keeps the uuid; repeat-uuid dedups to one
row; list scoped to caller site; detail cross-site 404; snapshot
cross-site 404 / same-site 200; event_uuid validation. phpunit 97 passing
(4 skipped: PDO), pytest 158 passing (2 skipped).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Xmn8KZWqiQUguEMRtn6rW
2026-07-17 12:58:27 +09:00
..
Support feat(cloud,edge): event dedup (event_uuid) + site-scoped access control (P1-9, P3-2b) 2026-07-17 12:58:27 +09:00
ApiSyncTest.php feat(delivery-audit): PIPA retention + cloud hardening (P3-2, P4-1..4) 2026-07-17 09:28:16 +09:00
AuthControllerTest.php fix(cloud): verify login CSRF + zone ownership 400 not 500 (P4-8, P4-6) 2026-07-17 10:00:04 +09:00
BasePathTest.php fix(cloud): logout order, url normalization, length caps, package hygiene (P4-9/10/11, P5-6) 2026-07-17 09:48:35 +09:00
ConfigTest.php feat(cloud): P1-B scaffold — composer autoload + Config 2026-07-11 23:16:13 +09:00
DashboardTest.php feat(cloud,edge): event dedup (event_uuid) + site-scoped access control (P1-9, P3-2b) 2026-07-17 12:58:27 +09:00
EventValidatorTest.php feat(cloud,edge): event dedup (event_uuid) + site-scoped access control (P1-9, P3-2b) 2026-07-17 12:58:27 +09:00
HmacTest.php test(cloud): golden HMAC vectors proving P1-A Python interop 2026-07-11 23:25:15 +09:00
HttpTest.php feat(cloud): Http Request/Response primitives 2026-07-11 23:54:58 +09:00
ImageProcessorTest.php fix(cloud): session-id regeneration on login (fixation) + pristine test output 2026-07-12 00:35:41 +09:00
IngestControllerTest.php feat(cloud,edge): event dedup (event_uuid) + site-scoped access control (P1-9, P3-2b) 2026-07-17 12:58:27 +09:00
PasswordCsrfTest.php feat(cloud): argon2id password + CSRF token helpers 2026-07-12 00:11:20 +09:00
PdoIntegrationTest.php feat(cloud,edge): event dedup (event_uuid) + site-scoped access control (P1-9, P3-2b) 2026-07-17 12:58:27 +09:00
RbacTest.php feat(cloud): RBAC permission matrix 2026-07-12 00:19:47 +09:00
RepositoryContractTest.php fix(cloud): centralize test-double autoloading via composer files 2026-07-11 23:38:01 +09:00
RouterTest.php feat(cloud): path-param router + dispatch 2026-07-12 00:49:52 +09:00
WiringSmokeTest.php feat(cloud): incident detail view renders snapshot images 2026-07-12 11:48:55 +09:00
ZoneConfigTest.php fix(cloud): verify login CSRF + zone ownership 400 not 500 (P4-8, P4-6) 2026-07-17 10:00:04 +09:00