Repository navigation
test(2.2): refuse a fallback write to a table with no known columns (CIP-5204) - #495
Merged
freshtonic merged 1 commit intoOct 26, 2026
Conversation
…CIP-5204) A write that fails type checking is refused when Proxy knows the target table but not its columns, as with CREATE TABLE ... AS. No test covered this: removing the table.columns.is_empty() condition left every type_check_fallback test passing.
tobyhede
approved these changes
Oct 26, 2026
freshtonic
deleted the
james/cip-5204-22-test-that-a-fallback-write-to-a-table-with-no-known
branch
October 26, 2026 23:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A follow-up to #493 (CIP-5168), for CIP-5204. It adds the test that I named as S1 in my review of #493: #493 (review)
The base is #493's branch. When #493 merges, GitHub changes the base of this PR to
release/2.2.Gap
Frontend::writes_encryptedrefuses a write that fails the type check when Proxy knows the target table but does not know its columns (table.columns.is_empty()). An example is a table created withCREATE TABLE ... ASon the same connection. No test covered this condition. When I removed it, all 11type_check_fallbacktests still passed, and Proxy forwarded a plaintext write to such a table unchanged.Changes
a_write_to_a_table_with_no_known_columns_that_fails_type_checking_is_refusedtopostgresql::tests::type_check_fallback. It sendsCREATE TABLE staging AS SELECT * FROM users, then an INSERT or an UPDATE onstagingthat fails the type check (id = ANY(ARRAY[...])). It checks that Proxy refuses each one and forwards no plaintext.Tests
cargo test -p cipherstash-proxy --lib type_check_fallback: 12 of 12 pass.table.columns.is_empty()condition removed, the new test fails. I ran each case alone, and each case fails.cargo fmt --checkandcargo clippy -p cipherstash-proxy --all-targets -- -D warningspass.Acknowledgment
By submitting this pull request, I confirm that CipherStash can use, modify, copy, and redistribute this contribution, under the terms of CipherStash's choice.
🤖 Generated with Claude Code