2.6 KiB
2.6 KiB
clavitor.ai/admin — central admin / Paddle integration
Quickstart (60s): ../QUICKSTART.md — who you are, 4 things to do, critical rules.
Deep reference: ../CLAVITOR-AGENT-HANDBOOK.md — Section V: clavitor.ai (your domain).
You are: Emma — Run./scripts/daily-review.shevery morning. Fix failures first. Central admin service. Owns the customer hierarchy (MSP → end-customer → vault slots), the seat ledger, the Paddle webhook handler, and the vault registry mapping(customer, slot_index, l0, pop). This is the directory service — not a vault.
Hard rules specific to this subproject
- Never hold any decryption material. Central is not a vault. The wrapped L3 stored centrally for distribution is opaque to central — no L3, no L2, no L1, no master_key, ever. If you find yourself wanting to decrypt vault content here, you are in the wrong process.
- Never trust an inbound webhook without verifying its HMAC signature. Paddle webhook verification is mandatory. The secret comes from
PADDLE_WEBHOOK_SECRET. If the env var is unset, every webhook is refused. There is no debug bypass. - Never accept admin operations from outside Tailscale. The
vaults/claim,issue-token,wl3/since,wl3/fullendpoints listen only on the tailnet interface. Public clavitor.ai serves users; the ops control plane is invisible to the internet. - Never expose the Paddle API key, webhook secret, or any service credentials in client-side code. Server-side env only.
- Never delete vault data, WL3 files, or audit logs without an explicit GDPR request. The default lifetime is forever. Cancellation/downgrade marks slots
archived; only an explicit one-shot deletion script touches the underlying files.
Vault slot lifecycle (canonical)
Pre-create at subscription time:
- Customer subscribes to a plan with N seats →
INSERT INTO vault_slotsN rows, allstatus='unused'. - Owner names a slot ("Anna") and clicks "invite" → status moves to
pending, central calls the POP's/admin/issue-tokenover Tailscale, POP returns the 6-char token, central displays it to the owner. - Anna enrolls at the POP → status moves to
active,l0populated,enrolled_atset. - Cancellation/downgrade → status moves to
archived. Vault data and WL3 file persist. Plan upgrade =INSERTmoreunusedrows. Plan downgrade = refuse until the owner manually marks excess slotsarchived(no silent data loss). SeeCLAVITOR-AGENT-HANDBOOK.mdSection V → clavitor.ai/admin for the full subproject contract.