Peergos account linking + billing-sourced quotas (quota-admin hook) + customer flags #5

Merged
marchon merged 1 commit from feat/peergos-link-quota into overdue-negative-balance-only 2026-10-06 16:26:37 -04:00

2026-10-06

Grok Bot
Peergos account linking (ownership-proven), billing-sourced quotas (quota-admin hook), customer flags
- POST /portal/api/peergos/challenge|signup|link, GET /links, /link-status/:username
  ownership proof: single-use challenge signed with the Peergos identity key,
  verified against the key embedded in the owner CID; refuses usernames linked
  to another customer and names not registered on our Peergos server
- staff: GET /peergos/links[/:username], DELETE /peergos/links/:username (unlink)
- /quota-admin/* (Peergos HttpQuotaAdmin, CBOR): quotas from the linked tier
  (Free 1 / Pro 50 / Business 500 GiB), internal grokbot* 5 GiB, unlinked 1 GiB
  with grace, floored at imported legacy quota and staff overrides
- staff quota routes: list/import/override
- customer_flags (test/noInvoice); invoice generation skips noInvoice
- /usage users carry quotaBytes
- additive tables: peergos_links, peergos_identity_keys, peergos_quota_users,
  peergos_signup_tokens, peergos_quota_overrides, customer_flags
- 23 new tests (313 total)
2026-10-06 16:26:24 -04:00