Commit 9bcec22
committed
fix(v3): resolve column domains when the client is built, not per row
Every encrypted row re-derived its column's eql_v3 domain name and
re-scanned the eql-bindings domain inventory. Resolve every configured
column once, when the client is built, and hand the encrypt seams the
resolved target.
Resolving up front also makes an unrepresentable column a configuration
error rather than a per-row one: it now fails newClient, naming the
offending table.column, instead of on the first encrypt to it — which
left a configured-but-never-written column silently broken. This is
deliberately fatal to the whole client, so it is a BREAKING change for a
v3 config containing such a column that the app only decrypts or never
touches: that client built before and does not now. CHANGELOG carries
the note and the remedy (read-only services can build with eqlVersion 2
— decrypt is version-agnostic and reads v3 payloads regardless).
ResolvedEncryptConfig owns the whole fail-fast sequence (validate
eqlVersion, parse the config, resolve each column) so the Neon and wasm
clients cannot drift: both now hold one Arc and share the sequence
rather than hand-assembling the same three fields behind identical
resolver() methods. Each column's config and target live in one entry,
so resolve() serves both from a single lookup and no second map's keys
can disagree with the first.
Config parsing now runs after the auth strategy is built, before any
network I/O — the strategy is built first on both targets, so a broken
strategy reports the same way on each. Config errors now precede
auth/network errors for all clients, both wire versions.
- errors name table.column: a whole-config sweep has no encrypt(table,
column) call site to disambiguate the bare name, and two tables may
configure the same column
- encrypt_bulk carries the Copy OutputTarget out of its first loop on
both targets, as encrypt_query_bulk already did, dropping a per-row
re-lookup and an unreachable error arm after rows were encrypted
- the conversion tests resolve through ResolvedEncryptConfig itself
rather than a hand-rolled match their doc claimed was the real seam
- new tests: the resolved target's variant and domain (nothing asserted
either), unknown-column, table disambiguation, and the wasm build's
rejection wiring, which no test reached1 parent d21a87a commit 9bcec22
6 files changed
Lines changed: 561 additions & 214 deletions
File tree
- crates/protect-ffi/src
- integration-tests/tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
18 | 52 | | |
19 | 53 | | |
20 | 54 | | |
| |||
0 commit comments