5 Commits

Author SHA1 Message Date
tiennm99 e191a138e9 fix(keys): match reconcile to current key name via shared prefix constant
Reconcile filtered app keys by the old "llmapikey:" prefix while mint now names
them "llmapikey/gh-<id>", so orphan/cost-leak detection silently missed every
new key. Centralize the prefix in lib/keys/key-name.js (KEY_NAME_PREFIX +
keyName) and use it in both mint and reconcile so they can't drift.
2026-06-14 14:18:13 +07:00
tiennm99 b710537f63 refactor(keys): rename openrouter_key_hash to openrouter_delete_hash
The column holds OpenRouter's delete handle (data.hash) used to revoke a key,
not a hash of the key. Migration 0003 renames the column; update repository,
admin revoke action, and the reconcile script.
2026-06-14 14:14:20 +07:00
tiennm99 bd25fb1efa chore: add sql migration runner script
Node runner using the project's postgres dependency, for applying SQL
migrations where psql is unavailable. Reads POSTGRES_URL via --env-file;
runs the file in a single transaction.
2026-06-14 14:10:46 +07:00
tiennm99 e03c606ea9 docs: clarify intent of stale-pending windows, ceiling-check, and error JSDoc
- note generate-key 2-min reclaim vs reconcile 10-min report split
- comment intentional >=/> asymmetry in the kill-switch re-check
- document getCurrentGithubIdentity throw path and ProvisioningError status
2026-06-13 19:20:41 +07:00
tiennm99 02fa52ccf9 feat: scaffold OpenRouter key giveaway site (gated, code-only)
- Next.js 15 App Router (JS+JSDoc): landing, auth-gated dashboard, docs
- GitHub OAuth via Supabase; identity anchored on numeric provider_id
- key provisioning: reserve-then-mint-persist-compensate, one key per account
- api_keys in unexposed llmapikey schema via direct Postgres; RLS deny-all
- live minting gated behind PROVISIONING_ENABLED; Vercel auto-deploy disabled
- unit tests (mask, request-body), RLS deny-all test, reconcile script
2026-06-13 14:18:52 +07:00