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
Owner

Approved by George (1:1): build the account linking and Free quota, and deploy it.

  • Linking: /portal/api/peergos/{challenge,signup,link,links,link-status}; ownership is proven by a single-use challenge signed with the Peergos identity key, verified against the key embedded in the owner CID. Staff unlink: DELETE /admin/api/peergos/links/:username.
  • Quotas: /quota-admin/* implements Peergos HttpQuotaAdmin (paid mode). Free 1 / Pro 50 / Business 500 GiB from the linked tier; internal grokbot* 5 GiB; unlinked 1 GiB (30-day grace reported); floored at imported legacy quotas and staff overrides.
  • customer_flags (test/noInvoice); invoice generation skips noInvoice.
  • Additive tables only. 313/313 tests pass.

Docs: docs/PEERGOS-BILLING.md (Account linking, Quotas), USAGE-BILLING-API.md, ENV-MATRIX.md.

Approved by George (1:1): build the account linking and Free quota, and deploy it. * Linking: `/portal/api/peergos/{challenge,signup,link,links,link-status}`; ownership is proven by a single-use challenge signed with the Peergos identity key, verified against the key embedded in the owner CID. Staff unlink: `DELETE /admin/api/peergos/links/:username`. * Quotas: `/quota-admin/*` implements Peergos HttpQuotaAdmin (paid mode). Free 1 / Pro 50 / Business 500 GiB from the linked tier; internal grokbot* 5 GiB; unlinked 1 GiB (30-day grace reported); floored at imported legacy quotas and staff overrides. * customer_flags (test/noInvoice); invoice generation skips noInvoice. * Additive tables only. 313/313 tests pass. Docs: docs/PEERGOS-BILLING.md (Account linking, Quotas), USAGE-BILLING-API.md, ENV-MATRIX.md.
- 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)
marchon merged commit bb937f3fd0 into overdue-negative-balance-only 2026-10-06 16:26:37 -04:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
marchon/verae-edge-billing!5
No description provided.