mirror of
https://github.com/warmbly/warmbly.git
synced 2026-08-19 00:01:14 +00:00
c800081987
Mailboxes, integration tokens, and message content are organization assets. Keying their DEK by the connecting user meant offboarding that user made every ciphertext they created unreadable. Migration 000039 drops user_encrypted_keys and creates organization_encrypted_keys keyed by organization_id. The new table has no FK on purpose: platform secrets live under the zero UUID (no organizations row), and DEK rows must never cascade-delete because a lost DEK is unrecoverable. Pre-production, so there is no data migration; ciphertexts sealed under the old per-user DEKs are abandoned with the table.