Skip to content

Add bootstrap-audit-key for legacy tenants#99

Merged
mkreyman merged 1 commit intomasterfrom
fix/legacy-tenant-audit-key
Apr 13, 2026
Merged

Add bootstrap-audit-key for legacy tenants#99
mkreyman merged 1 commit intomasterfrom
fix/legacy-tenant-audit-key

Conversation

@mkreyman
Copy link
Copy Markdown
Owner

Summary

  • Legacy tenants (pre-CoC v2) have no ed25519 audit keypair, leaving trust layers L1/L2/L5/L6 inert
  • Adds Tenants.bootstrap_audit_key/1 to generate the initial keypair
  • Adds POST /api/v1/admin/tenants/:id/bootstrap-audit-key (superadmin only)
  • Refuses to overwrite existing keys (409 — use rotate instead)
  • Writes audit chain entry documenting the bootstrap event

Test plan

  • 2263 tests pass
  • Call endpoint for tenant 0abd22c2-... after deploy
  • Verify public key endpoint returns PEM
  • Verify STH is no longer null hash

🤖 Generated with Claude Code

Legacy tenants created before Chain of Custody v2 have no ed25519
audit keypair, leaving trust layers L1/L2/L5/L6 inert. This adds:

- Tenants.bootstrap_audit_key/1 — generates initial keypair, stores
  private key in Fly secrets, sets public key on tenant record
- POST /api/v1/admin/tenants/:id/bootstrap-audit-key (superadmin)
- Refuses to overwrite existing keys (use rotate instead)
- Writes audit chain entry documenting the bootstrap

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mkreyman mkreyman merged commit 136c1f5 into master Apr 13, 2026
6 checks passed
@mkreyman mkreyman deleted the fix/legacy-tenant-audit-key branch April 13, 2026 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant