Files
goclaw/migrations/000021_paired_devices_expiry.up.sql
viettranx 0b5124a8f1 fix(security): harden pairing auth — fail-closed, rate-limit, TTL
- Change WS pairing check from fail-open to fail-closed on DB error
  (router.go: previously granted RoleOperator on any IsPaired() error)
- Add "browser" to InternalChannels so it's properly excluded from
  outbound dispatch without ad-hoc helpers
- Rate-limit browser.pairing.status endpoint to prevent sender_id
  enumeration (reuses server RateLimiter via PairingMethods injection)
- Add expires_at column to paired_devices with 30-day TTL for
  defense-in-depth; IsPaired() now checks expiry, ListPaired() prunes
- Add confidence_score column to team_tasks, team_messages,
  team_task_comments
- Bump RequiredSchemaVersion to 21
2026-03-16 19:55:08 +07:00

9 lines
485 B
SQL

-- Add expiry to paired devices for defense-in-depth.
-- NULL means no expiry (backward compat for existing rows).
ALTER TABLE paired_devices ADD COLUMN IF NOT EXISTS expires_at TIMESTAMPTZ;
-- Add confidence_score to team tables for agent self-assessment.
ALTER TABLE team_tasks ADD COLUMN IF NOT EXISTS confidence_score FLOAT;
ALTER TABLE team_messages ADD COLUMN IF NOT EXISTS confidence_score FLOAT;
ALTER TABLE team_task_comments ADD COLUMN IF NOT EXISTS confidence_score FLOAT;