You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sims-hq/apps/hq/src
Thomas Joise 79717133b8 feat(d32): remove the key concept entirely + keyless legacy cleanup
Owner has no HQ_SECRET_KEY, so the D31 unlock-with-key path was impossible. crypto is
now fully keyless: encrypt/decrypt ignore keyHex (params kept so a key can be wired back
later); decrypt returns '' for any leftover legacy AES value (unreadable → treated as
unset, never fed back as ciphertext). Key-based /admin/migrate-plaintext replaced by
keyless /admin/clear-legacy-credentials (clearLegacyCiphertext) which NULLs unreadable
pre-D31 values. .env.example marks HQ_SECRET_KEY removed.

Ran the cleanup on live data: 76 SMS + 110 client DB passwords were unrecoverable and
cleared (usernames intact) — must be re-populated in plaintext (APEX re-import / re-entry).

Also fixes the one real defect the D31 adversarial review confirmed: maybeRefreshSmsDaily
still had a 'keyHex==="" -> no-op' guard that would silently kill the DAILY auto-refresh
once the key was gone (manual refresh masked it). Removed; the daily pull now runs keyless
like the manual path. Full suite 416 green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3 days ago
..
api.ts feat(d32): remove the key concept entirely + keyless legacy cleanup 3 days ago
audit.ts feat(d27): #8 audit-log viewer (owner-only) 3 days ago
auth.ts feat(d25): login by username; email demoted to a plain user field 4 days ago
aws-costs.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 5 days ago
bounces.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 5 days ago
crypto.ts feat(d32): remove the key concept entirely + keyless legacy cleanup 3 days ago
db-pg.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 5 days ago
db.ts feat(d28): SMS gateway live balance sync (BalAlert API) + daily auto + low alert 3 days ago
gmail.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 5 days ago
import-apex-full.ts feat(d21): P4 — importer seeds module field_spec + writes field_values 5 days ago
import-apex.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 5 days ago
migrate-plaintext.ts feat(d32): remove the key concept entirely + keyless legacy cleanup 3 days ago
migrations-pg.ts feat(d28): SMS gateway live balance sync (BalAlert API) + daily auto + low alert 3 days ago
pdf.ts fix(sec/d24): PDF render hardening — strict CSP + request interception 4 days ago
rate-limit.ts fix(sec/d24): auth hardening — login lockout, rate limits, constant-time, trust proxy 4 days ago
reminder-templates.ts feat(documents): invoice due dates — terms default + override, honest overdue chase (Phase 1, D18) 5 days ago
repos-amc.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 5 days ago
repos-aws.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 5 days ago
repos-branches.ts feat(d20): P1 — ticket desk, client branches, per-service data (schema + repos) 5 days ago
repos-clients.ts feat(d31): store credentials in the clear (owner decision) + one-time migration 3 days ago
repos-dashboard.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 5 days ago
repos-documents.ts feat(d26): functional gaps — GST summary, doc search, bulk ops (backend) 4 days ago
repos-email.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 5 days ago
repos-employees.ts feat(d25): login by username; email demoted to a plain user field 4 days ago
repos-interactions.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 5 days ago
repos-milestones.ts feat(d26): functional gaps — GST summary, doc search, bulk ops (backend) 4 days ago
repos-mis.ts feat(d28): #6 SMS credit review + low-balance upsell 3 days ago
repos-modules.ts feat(d31): store credentials in the clear (owner decision) + one-time migration 3 days ago
repos-payments.ts fix(d24): pg allocation row-lock + index ordering; docs (D24 record, 389 tests) 4 days ago
repos-pipeline.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 5 days ago
repos-rate-card.ts feat(d23): SMS volume-band billing (dated rate card, money locked) 5 days ago
repos-recurring.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 5 days ago
repos-reminders.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 5 days ago
repos-renewals.ts feat(d27): #1 renewals command center + one-click module renewal quote (backend) 4 days ago
repos-reports.ts feat(d26): functional gaps — GST summary, doc search, bulk ops (backend) 4 days ago
repos-search.ts feat(d28): Portals quick-list + global search (clients/docs/tickets) 3 days ago
repos-shares.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 5 days ago
repos-sms.ts feat(d32): remove the key concept entirely + keyless legacy cleanup 3 days ago
repos-tickets.ts feat(d28): #3 ticket desk — SLA aging + overdue filter + bill-from-ticket 3 days ago
scheduler.ts feat(d28): SMS gateway live balance sync (BalAlert API) + daily auto + low alert 3 days ago
seed.ts feat(deploy): hardcode DB connection + owner email (no .env), update docs 4 days ago
send-reminder.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 5 days ago
series.ts fix(sec/d24): money-integrity guards — CN cap, atomic doc-no, qty, TDS, markStatus 4 days ago
server.ts feat(deploy): hardcode DB connection + owner email (no .env), update docs 4 days ago
sms-gateway.ts harden(d28): SSRF guard + no credential-URL leak on SMS gateway fetch 3 days ago
templates.ts fix(sec/d24): PDF render hardening — strict CSP + request interception 4 days ago