Commit graph

24 commits

Author SHA1 Message Date
유창욱
9aa7f44ea4 feat(cloud): PDO repositories + schema + Cafe24 deploy doc
Implements Task 16 (final, P1-B): App\Db\Database::connect(Config): PDO
factory and the 9 App\Repository\Pdo\Pdo*Repository classes backing the
repository interfaces consumed by controllers since T1-T15, all-prepared
statements, plus cloud/schema.sql (MySQL 8 DDL) and cloud/docs/cloud-deploy.md.

Security hardening incorporated per accumulated task reviews:
- PdoNonceRepository: nonces.nonce is PK; duplicate remember() throws instead
  of racing seen() (closes T7 TOCTOU).
- PdoRateLimiterRepository::hit(): atomic INSERT ... ON DUPLICATE KEY UPDATE
  upsert on (rate_key, window_start), no read-modify-write race.
- PdoSnapshotRepository::pathByUuid(): validates 32-hex uuid before building
  any filesystem path (closes T12 path-traversal risk).
- PdoZoneRepository::save(): update path is ownership-scoped by
  (zone_id, device_id, camera_id); throws on mismatch instead of silently
  overwriting an unrelated zone (closes T13 cross-tenant overwrite risk).
- Database::connect(): ERRMODE_EXCEPTION, EMULATE_PREPARES=false, FETCH_ASSOC.

cloud/tests/PdoIntegrationTest.php round-trips Nonce/Event/Zone against a
real sqlite :memory: DB, gated via markTestSkipped when pdo_sqlite is
unavailable (this host has pdo_mysql only, no pdo_sqlite) -- suite stays
green with 4 tests skipped.

Full suite: 59 tests, 114 assertions, 4 skipped, 0 failures, 0
warnings/deprecations. php -l passes on all new files and on
cloud/public/index.php (T15), which references all new FQCNs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ne4rU4FToTLHcBUMUvUnT1
2026-07-12 01:58:05 +09:00
유창욱
81eae5d045 fix(cloud): login form submits via fetch (redirect on success, show error) 2026-07-12 01:39:06 +09:00
유창욱
81e8e81b72 feat(cloud): front controller wiring + views + zone-draw UI 2026-07-12 01:24:42 +09:00
유창욱
5135c08e18 feat(cloud): device config + heartbeat sync API (HMAC) 2026-07-12 01:13:02 +09:00
유창욱
92c630bf58 feat(cloud): polygon validation + zone config controller (RBAC) 2026-07-12 01:02:37 +09:00
유창욱
90d3016b17 feat(cloud): dashboard list/detail/ack + auth-gated snapshot proxy 2026-07-12 00:56:43 +09:00
유창욱
430758c3b7 feat(cloud): path-param router + dispatch 2026-07-12 00:49:52 +09:00
유창욱
f7a0a3740e test(cloud): cover unknown-username 401 parity + logout session clear 2026-07-12 00:46:39 +09:00
유창욱
902bbe93c8 fix(cloud): reset lockout on window expiry + constant-time unknown-user path (anti-enumeration) 2026-07-12 00:39:19 +09:00
유창욱
450c88978f fix(cloud): session-id regeneration on login (fixation) + pristine test output 2026-07-12 00:35:41 +09:00
유창욱
b345a89788 feat(cloud): session store + auth controller with lockout 2026-07-12 00:28:18 +09:00
유창욱
9983bc8fe3 feat(cloud): RBAC permission matrix 2026-07-12 00:19:47 +09:00
유창욱
76ea1b4ecf feat(cloud): argon2id password + CSRF token helpers 2026-07-12 00:11:20 +09:00
유창욱
185629a4c4 fix(cloud): unify ingest auth errors (anti-enumeration) + guard snapshot write 2026-07-12 00:07:42 +09:00
유창욱
57cfc64548 feat(cloud): ingest controller (HMAC+nonce+ratelimit+reencode+persist) 2026-07-12 00:01:05 +09:00
유창욱
a0db1e06ca feat(cloud): Http Request/Response primitives 2026-07-11 23:54:58 +09:00
유창욱
7246e12c4a feat(cloud): gd image re-encode (strip payload, uuid, hash) 2026-07-11 23:50:08 +09:00
유창욱
2f88355071 fix(cloud): type-guard EventValidator fields against malformed input 2026-07-11 23:46:38 +09:00
유창욱
b5388b2a68 feat(cloud): event payload validator with enum whitelist 2026-07-11 23:40:53 +09:00
유창욱
4bbd28f95f fix(cloud): centralize test-double autoloading via composer files
Move InMemoryRepositories.php from require_once workaround to composer
files-autoload. Enables PSR-4 autoloading of test-double classes and
scales for 5+ future test files. All 8 tests pass with require_once removed.
2026-07-11 23:38:01 +09:00
유창욱
67b9999a31 feat(cloud): repository interfaces + in-memory test doubles 2026-07-11 23:32:16 +09:00
유창욱
6fbe4015dc test(cloud): golden HMAC vectors proving P1-A Python interop 2026-07-11 23:25:15 +09:00
유창욱
8e62304471 feat(cloud): HMAC sign/verify matching P1-A edge contract 2026-07-11 23:21:00 +09:00
유창욱
50cb2cfe82 feat(cloud): P1-B scaffold — composer autoload + Config 2026-07-11 23:16:13 +09:00