Repository navigation
Conversation
Cipher.encrypt returns one dict per model. A sealed field is a str of EQL JSON, which psycopg inserts with a plain %s and no cast. A passthrough field is the value itself, echoed by the engine. Every value is checked by exact type and range while the models are written into the engine's input frame. A bad value raises the new InvalidValueError with the field's name. No request is made, and the engine client is not built. A property that raises propagates unchanged. One engine client is shared per process, with one multi-thread tokio runtime. It is built on the first encrypt of any Cipher, and the GIL is released around each engine call. Its ZeroKMS connection counts requests, so the tests check the 500-keys-per-request rule. The http feature is on, and every new crate matches the root lock's version. A live CI job in tests-python.yml encrypts against ZeroKMS and inserts a row into Postgres with the EQL v4 bundle from the tree. It skips on a fork's pull request. The EQL cache test now accepts a second workspace's cache step in the same job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Decimal passthrough now comes back as a Decimal. Its digits go to Decimal as a tuple, not as bytes. A zero Decimal with a huge exponent no longer hangs the process with the GIL held. A zero with a positive exponent returns at once. An exponent above 38 is refused as value_not_representable. The shared client now reads CS_ZEROKMS_HOST, then CS_VITUR_HOST, as the other SDKs do. A bad value is refused as stack_kms_invalid_endpoint, before the credentials are read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true |
This comment has been minimized.
This comment has been minimized.
encrypt failed on every model with a Passthrough field. The extension wrote the value as a passthrough node. The plan's "passthrough" output already carries the field's frame as it is, so the engine returned the value nested in a second passthrough, and reading it failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Summary
Cipher.encryptnow turns a list of declared models into rows for PostgreSQL with EQL v4. EQL is CipherStash's set of PostgreSQL types for encrypted values. A sealed field becomes astrof EQL JSON. psycopg inserts it with a plain%sand no cast. A passthrough field is the value itself.Changes
Cipher.encrypt(models)returns one dict per model. The newInvalidValueErroris aStashErrorand aValueError. A README stub shows theCREATE TABLE, the encrypt call, and the insert.InvalidValueErrorwith the field's name. The error never contains the value. The codes arevalue_none,value_wrong_type,value_out_of_range,value_not_representable, andvalue_naive_datetime.encryptof anyCipher. The Python global interpreter lock (GIL) is released during each engine call. The client readsCS_ZEROKMS_HOST. The client's ZeroKMS connection counts requests for the tests.httpfeature is on.stack-kms,tokio, andzerokms-protocolare new. Every new crate in the PythonCargo.lockhas the root lock's version.livejob intests-python.ymlrunsmise run test:live. The job encrypts against ZeroKMS and inserts rows into apostgres:17service with the EQL v4 bundle from this tree. The job skips on a pull request from a fork.Verification
gate-probetests.cargo test --locked, clippy, andcargo fmt --check: no failures or warnings.pnpm run test:scripts: 83 of 83 files pass.livejob on this PR.Related
Closes #1389. Refs #1341.
Review notes
"type"key in the output. python:queryan equality term #1391 can add it.KmsErroris not built yet. A ZeroKMS failure is aStashError.eql-suite-ci.test.mjsnow accepts a Rust cache step for a second workspace in the same job. Thelivejob needs one forlanguages/pythonand one forpackages/eql.🤖 Generated with Claude Code