Repository navigation
feat(eql-bindings): produce Smallint and SmallintEq from i16 #1267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@cipherstash/eql': minor | ||
| --- | ||
|
|
||
| **Stack Encrypt produces the EQL v4 types `Smallint` and `SmallintEq`** (`eql-bindings`, `stack-encrypt` feature), from `i16`. `SmallintEq`'s equality term is the integer one, so a smallint and an integer of the same value under one column share it. The `date`, `timestamp` and `numeric` types now say they wait for a choice of Rust plaintext type, not for an engine kind. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -248,17 +248,21 @@ jobs: | |
| echo "RLIMIT_MEMLOCK: $(ulimit -l) KiB" | ||
| mise run go:test | ||
|
|
||
| # The Rust suite opens the committed v4_rows.json, whose ciphertexts the | ||
| # Go SDK sealed when the file was last regenerated. This also hands it | ||
| # the rows the Go SDK seals in this run, so a Go guest and a native | ||
| # Rust build that stop agreeing on today's ciphertexts fail here rather | ||
| # than when someone next regenerates the file. The toolchain is the | ||
| # The Rust suite opens the committed v4_rows.json and | ||
| # v4_smallint_rows.json, whose ciphertexts the Go SDK sealed when each | ||
| # file was last regenerated. This also hands it the rows the Go SDK | ||
| # seals in this run, so a Go guest and a native Rust build that stop | ||
| # agreeing on today's ciphertexts fail here rather than when someone | ||
| # next regenerates a file. Both filters are exact, so each test named | ||
| # here is one that reads the rows handed to it. The toolchain is the | ||
| # root's pin, as for the guests. | ||
| - name: Rows the Go SDK seals today open in Rust | ||
| run: | | ||
| rows="$RUNNER_TEMP/v4_rows.json" | ||
| (cd languages/golang && CGO_ENABLED=0 EQL_V4_ROWS_OUT="$rows" go test -count=1 -run TestV4RowsMatchTheCommittedFixture ./encrypt) | ||
| EQL_V4_ROWS="$rows" cargo test --locked --manifest-path packages/eql/Cargo.toml -p eql-encryption-tests --test v4_types rows_the_go_sdk_sealed_open_in_rust | ||
| smallint_rows="$RUNNER_TEMP/v4_smallint_rows.json" | ||
| (cd languages/golang && CGO_ENABLED=0 EQL_V4_ROWS_OUT="$rows" EQL_V4_SMALLINT_ROWS_OUT="$smallint_rows" go test -count=1 -run '^(TestV4RowsMatchTheCommittedFixture|TestV4SmallintRowsMatchTheCommittedFixture)$' ./encrypt) | ||
| test -s "$rows" && test -s "$smallint_rows" | ||
| EQL_V4_ROWS="$rows" EQL_V4_SMALLINT_ROWS="$smallint_rows" cargo test --locked --manifest-path packages/eql/Cargo.toml -p eql-encryption-tests --test v4_types -- --exact rows_the_go_sdk_sealed_open_in_rust smallint_rows_the_go_sdk_sealed_open_in_rust | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Low: One way to make it fail loudly is to count before running: filters=(--exact rows_the_go_sdk_sealed_open_in_rust smallint_rows_the_go_sdk_sealed_open_in_rust)
test "$(cargo test --locked --manifest-path packages/eql/Cargo.toml -p eql-encryption-tests --test v4_types -- "${filters[@]}" --list --format terse | grep -c ': test$')" -eq 2
EQL_V4_ROWS="$rows" EQL_V4_SMALLINT_ROWS="$smallint_rows" cargo test ... -- "${filters[@]}"A small test under |
||
|
|
||
| # What is encrypted is fixed before the program ships: every generated | ||
| # file is committed, and this fails when `go generate` would change | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: this line only enforces its second half.
shell: bashruns asbash -eo pipefail, and errexit ignores a failing command that isn't the last one in an&&list. So if$rowsis missing or empty,&&stops before the secondtest, the list fails, and the step keeps going to cargo.The realistic way to get there is the deterministic EQL guest not being built.
deterministicEQLClientthen callst.Skipin both Go tests,go testprintsok, and neither file gets written. That case still fails loudly, but in the wrong place. cargo panics in both tests withfixtures/v4_rows.json is written by the Go SDK's TestV4RowsMatchTheCommittedFixture: ... NotFound(I reproduced the smallint version by pointing the variable at a path that doesn't exist). The message names the committed fixture, which is present, not the$RUNNER_TEMPfile that is missing. That sends whoever reads the log to the wrong file.Splitting it into two lines makes both checks stop the step: