enforce steam ticket validation

This commit is contained in:
Devin Zuczek
2026-07-10 17:40:49 -04:00
parent 2a1e9d5d0a
commit aad184181b
15 changed files with 540 additions and 43 deletions
@@ -0,0 +1,8 @@
-- Link accounts to their platform-native identity (e.g. a SteamID64 for platform 0)
-- and index it so /cachedlogin/forplatformid can look accounts up by platform id.
-- platformId lives in the JSON blob (stored as a string — a SteamID64 exceeds 2^53
-- and would lose precision as a number); this exposes it as an indexed generated
-- column. Kept in sync with SCHEMA_DDL in @repo/domain's accounts-db.ts.
ALTER TABLE accounts ADD COLUMN platform_id TEXT GENERATED ALWAYS AS (json_extract(data, '$.platformId')) VIRTUAL;
CREATE INDEX IF NOT EXISTS idx_accounts_platform_id ON accounts (platform_id);
@@ -0,0 +1,7 @@
-- Rename the `accounts` table to `account`, matching the singular naming of the
-- other tables (`room`, `interaction`, `room_instance`, `image`, `club`). SQLite
-- carries the generated columns and the idx_accounts_* indexes over to the renamed
-- table automatically, so this is the whole change. SCHEMA_DDL in @repo/domain's
-- accounts-db.ts already creates `account`.
ALTER TABLE accounts RENAME TO account;