feat(migrate): EQL v3 support#649
Conversation
First slice of EQL v3 support (#648): detectColumnEqlVersion() inspects an encrypted column's Postgres domain type — public.eql_v2_encrypted -> v2, a concrete eql_v3_* domain -> v3, anything else (plaintext / not found) -> null. This is the keystone the version-aware lifecycle branches on. Unit-tested with a mocked pg client; no behaviour change to existing v2 paths. Refs #648 Claude-Session: https://claude.ai/code/session_01MxTTPaPP16m6br7Hoab94w
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Makes
@cipherstash/migrate(and thestash encrypt *CLI it backs) work with EQL v3 columns. Closes #648.Draft — landing in phased commits. This first commit adds the keystone.
Design decisions (from #648)
<col>_encrypted, app points at it, plaintext dropped later viaencrypt drop. No v3 rename step.Phase 1 (this commit) — version detection
detectColumnEqlVersion(client, table, column):public.eql_v2_encrypted → v2, concreteeql_v3_* → v3, plaintext/not-found →null. Resolves schema-qualified tables viato_regclass. Unit-tested with a mockedpgclient; zero change to existing v2 behaviour.Remaining phases
ready_for_encryption/migrate_config/activate_config/reload_config/count_encrypted_with_active_config) and the rename cut-over; it's backfill + state-tracking only.$1::jsonbwrite must satisfy the concreteeql_v3_*domain CHECK, andisEncryptedPayloadmust accept v3 storage payloads. Live-DB integration coverage (CI-only) on the existing v3 harness.stash encrypt backfill/dropbecome version-aware;encrypt cutoverreports "not applicable" on a v3 column.stash-encryption/stash-cli. Add a@cipherstash/migratechangeset before marking ready.Refs #648
https://claude.ai/code/session_01MxTTPaPP16m6br7Hoab94w