Repository navigation
Conversation
|
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
@coderabbitai review |
Action performed
|
cipherstash-agent
left a comment
There was a problem hiding this comment.
Review attestation
Reviewed 436f322 · posted from Claude Code · claude-opus-5-5 · effort medium
Sources: code-review · claude-opus-5-5; mattpocock-skills:code-review (Standards and Spec agents) · claude-opus-5-5; review-cross-check verifier · claude-opus-5-5
Skills: code-review, company-skills:rust-security (no Rust in the diff, so it had nothing to apply to), mattpocock-skills:code-review, company-skills:review-cross-check
Findings (3): 3 minor. 2 inline, 1 below.
languages/golang/cmd/stashgen/README.md:447(outside diff) minor This line still says "query it through a cipher with the same scope", withcipher.Scope(tenant).Bind(rowID)as the example in the same sentence. A reader who queries through the bound cipher getsErrEncodingfromCipher.queryPlan(encrypt/records.go:187-188). #1862 names this README as one of the user docs, and the CHANGELOG entry reads as if the problem is fixed. Use the newencryptREADME wording here too.
The new README text matches the code. operandPlan exempts only Selector, Subtree and Children, and TestABindingIsInTheStoredContextOnly covers the refusal. CodeRabbit's review was still in progress when this was checked.
Generated by Claude Code
|
The review's finding on |
The encrypt README said to query a bound value through a cipher with the same scope, and did not say what happens through a cipher with a binding. Readers took that as accepted. Cipher.queryPlan refuses it with ErrEncoding, because a binding is in the stored context only and no query context holds it. The README now says so, and says to query through the scope alone, then open the row through the cipher with the binding. Refs #1862 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CtEQzxj55RUn35dkbhdwQk
The stashgen README gave cipher.Scope(tenant).Bind(rowID) as its example and then said to query through a cipher with the same scope, with no word about the refusal. Cipher.queryPlan refuses a query through a cipher with a binding with ErrEncoding. The README now says to query through the scope alone, and that the bound query is refused. The CHANGELOG entry now follows the file's form, cites the issue, and no longer says the old README called the query accepted. Refs #1862 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CtEQzxj55RUn35dkbhdwQk
…to tie a value to its row The Take care note in the encrypt README said the context binds a value to its table, its column and the cipher's extension, and offered only a context_field to tie a value to its row. The context also binds any bindings, and cipher.Scope(tenant).Bind(rowID) ties a value to its row ID. The note now names both ways, and the trade-off: a cipher with a binding cannot query, and a context_field can query within one context. It also says that a context_field ties a value to its row's context, so a value copied to another row with the same context decrypts there. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CtEQzxj55RUn35dkbhdwQk
da14c41 to
d15d240
Compare
|
@coderabbitai review |
Action performed
|
Summary
The Go SDK's
encryptREADME now says that a query through a cipher with a binding is refused withErrEncoding. A binding (cipher.Bind(rowID)) ties a stored value to its row. The README told readers to query "through a cipher with the same scope". It did not say what happens through a cipher with a binding, so readers took the query as accepted.Changes
languages/golang/encrypt/README.md: the scope and binding list now says to query through a cipher with the same scope and no binding. It says that a query through a cipher with a binding is refused withErrEncoding, for every query method. It also says to open the row the query finds throughcipher.Scope(tenant).Bind(rowID).languages/golang/cmd/stashgen/README.md: the paragraph onencrypt_intowith a scope or a binding says the same, in shorter form. It had the same wording as theencryptREADME.languages/golang/CHANGELOG.md: an entry under[Unreleased], in "Fixed".Why the query is refused
Cipher.queryPlaninlanguages/golang/encrypt/records.goreturnsErrEncodingwhen the plan has a binding. The error says that a binding is in the stored context only, so a query by the scopes alone finds the row. Every generated query method callsCipher.QueryTerm. That method goes throughoperandPlanand thenqueryPlan.The reads of part of a
JsonSearchdocument (Selector,Subtree, andChildren) are the exception, becauseoperandPlandrops the binding for them. The README's text about those reads was already right, so it is unchanged. The doc comments onCipher.BindandCipher.QueryTermalready say the same.Verification
TestABindingIsInTheStoredContextOnlyinencrypt/bindings_test.goover the deterministic test guest: it passed. That test checks that a boundQueryTermreturnsErrEncoding, and that the same query by the scope alone derives the stored term.Eqmethod on an EQLTextEqfield throughScope("tenant-42").Bind(uint64(9)), over the deterministic EQL guest. It returnedcipherstash: malformed input: field "email": a query takes no binding; .... That error matchesErrEncoding. The same call through the scope alone succeeded. I deleted the test afterwards.go vet, orgolangci-lint.Related
Closes #1862
🤖 Generated with Claude Code
https://claude.ai/code/session_01CtEQzxj55RUn35dkbhdwQk
Summary by CodeRabbit