Skip to content

Commit de14775

Browse files
committed
feat(eql)!: build eql-bindings' stack-encrypt feature on vitaminc ADR 0001 so the EQL jobs and the EQL guest stay green
eql-bindings' `stack-encrypt` feature and tests/encryption compile stack-encrypt by path, so they move with it. - The EQL workspace carries the same temporary vitaminc pin as the root, the fuzz crate and both guests: every workspace that compiles stack-encrypt now resolves one vitaminc. - `encryption::targets` and the generated `v3::targets` take `FfiValue` and `ValueKind` from `stack_encrypt::dynamic` (the feature turns on stack-encrypt's `dynamic`); the generator emits the new import. `vitaminc-aead-value` is gone from both manifests. - The `Ciphertext` target takes `Plaintext` in place of `Encrypt` and `Decrypt + Send + 'static` in place of `Decrypt<'static>`. - The encrypt guest's lockfile drops `vitaminc-aead-value`, which only its `eql` build still pulled in. No other EQL code names a vitaminc API.
1 parent 6e468a8 commit de14775

13 files changed

Lines changed: 71 additions & 75 deletions

File tree

‎languages/golang/encrypt/guest/Cargo.lock‎

Lines changed: 0 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎packages/eql/Cargo.lock‎

Lines changed: 21 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎packages/eql/Cargo.toml‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,17 @@ default-members = ["tests/sqlx"]
3535
[workspace.lints.rust]
3636
dead_code = "deny"
3737
unused_imports = "deny"
38+
39+
# Temporary, as in the repository root's Cargo.toml: eql-bindings'
40+
# `stack-encrypt` feature and tests/encryption compile stack-encrypt by path,
41+
# so the vitaminc crates it builds on come from the branch that implements
42+
# vitaminc ADR 0001 (cipherstash/vitaminc PRs #439 to #445) until vitaminc
43+
# releases it.
44+
[patch.crates-io]
45+
vitaminc = { git = "https://github.com/cipherstash/vitaminc", branch = "feat/aead-remove-legacy-traits" }
46+
vitaminc-aead = { git = "https://github.com/cipherstash/vitaminc", branch = "feat/aead-remove-legacy-traits" }
47+
vitaminc-aead-frame = { git = "https://github.com/cipherstash/vitaminc", branch = "feat/aead-remove-legacy-traits" }
48+
vitaminc-encrypt = { git = "https://github.com/cipherstash/vitaminc", branch = "feat/aead-remove-legacy-traits" }
49+
vitaminc-hmac = { git = "https://github.com/cipherstash/vitaminc", branch = "feat/aead-remove-legacy-traits" }
50+
vitaminc-prf = { git = "https://github.com/cipherstash/vitaminc", branch = "feat/aead-remove-legacy-traits" }
51+
vitaminc-protected = { git = "https://github.com/cipherstash/vitaminc", branch = "feat/aead-remove-legacy-traits" }

‎packages/eql/crates/eql-bindings/CHANGELOG.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3535

3636
### Changed
3737

38+
- **The `stack-encrypt` feature builds on vitaminc ADR 0001.**
39+
`encryption::targets` takes `FfiValue` and `ValueKind` from
40+
`stack_encrypt::dynamic` (the feature turns on stack-encrypt's `dynamic`
41+
feature) in place of `vitaminc-aead-value`, which is gone, and the
42+
`Ciphertext` target takes any `Plaintext` plaintext and opens into any
43+
`Decrypt + Send` type, as stack-encrypt's own targets do.
44+
3845
- **Query-operand domain names switched to the `query_<name>` prefix, homed
3946
in the `eql_v3` schema.** The SQL domain names carried by the
4047
query twins — in `DomainType::sql_domain`, the names `QueryPayload::parse`

‎packages/eql/crates/eql-bindings/Cargo.toml‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,15 @@ schemars = "1"
4343
# from the PACKAGED crate against the registry stack-encrypt instead:
4444
# `cargo publish --dry-run --all-features` in test-eql.yml at PR time, and
4545
# `publish_all_features` in ../../release-plz.toml at release time.
46-
stack-encrypt = { path = "../../../stack-encrypt", version = "0.2.0", optional = true, default-features = false }
46+
# `dynamic`: `FfiValue` / `ValueKind`, the runtime plaintext a plan field
47+
# target takes and the kind names a plan's `"type"` key spells
48+
# (`encryption::targets`).
49+
stack-encrypt = { path = "../../../stack-encrypt", version = "0.2.0", optional = true, default-features = false, features = ["dynamic"] }
4750
# The vitaminc line stack-encrypt is built on. `PrfValue` is named from this
4851
# crate directly (stack-encrypt re-exports only `IntoPrfContext` and
4952
# `PrfContext`), and two vitaminc lines in one graph do not interoperate, so
5053
# the requirement is stack-encrypt's.
5154
vitaminc-prf = { version = "0.5.0", optional = true }
52-
# `FfiValue` / `ValueKind`: the runtime plaintext a plan field target takes
53-
# and the kind names a plan's `"type"` key spells (`encryption::targets`).
54-
# Named from vitaminc directly, like `PrfValue` above, so the feature needs
55-
# nothing from stack-encrypt's own `dynamic` feature; the same line
56-
# stack-encrypt and the Go guest build against.
57-
vitaminc-aead-value = { version = "0.5.1", optional = true }
5855
# The plaintext a target reads out of its `Protected` runtime value is held
5956
# in `Zeroizing` until it is sealed, so the copy is wiped like the original.
6057
zeroize = { version = "1", optional = true }
@@ -67,7 +64,6 @@ default = []
6764
stack-encrypt = [
6865
"dep:stack-encrypt",
6966
"dep:vitaminc-prf",
70-
"dep:vitaminc-aead-value",
7167
"dep:zeroize",
7268
"dep:thiserror",
7369
"dep:base64",

‎packages/eql/crates/eql-bindings/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ unknown one with "no such EQL type".
192192
```rust,ignore
193193
use eql_bindings::encryption::targets;
194194
use stack_encrypt::Label;
195-
use vitaminc_aead_value::FfiValue;
195+
use stack_encrypt::dynamic::FfiValue;
196196
197197
let column = Label::new(["users", "email"])?; // the field's context: table/column
198198
let stored: Vec<u8> = targets::encrypt("TextEq", &keyset, &column, FfiValue::String("alice@example.com".into()))?.await?;

‎packages/eql/crates/eql-bindings/src/encryption.rs‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
//! An encrypted EQL record is not a plaintext value:
6363
//! ```compile_fail
6464
//! use eql_bindings::v3::text::TextEq;
65-
//! fn require<T: stack_encrypt::Encrypt>() {}
65+
//! fn require<T: stack_encrypt::Plaintext>() {}
6666
//! require::<TextEq>();
6767
//! ```
6868
//! The text domain accepts text, and requires a concrete column identifier:
@@ -85,8 +85,8 @@ use stack_encrypt::target::transcode::{Reader, Transcode, Visitor};
8585
use stack_encrypt::target::{self, AeadContext, CallerContext};
8686
use stack_encrypt::{
8787
CipherText, ContextPiece, Decrypt, DecryptField, DecryptInto, Decryptable, Decryption,
88-
Describe, Description, Encrypt, EncryptFrom, Encryption, Error, IntoContext, MaybeEmpty,
89-
NonEmpty, SealedValue, StackCipherText,
88+
Describe, Description, EncryptFrom, Encryption, Error, IntoContext, MaybeEmpty, NonEmpty,
89+
Plaintext, SealedValue, StackCipherText,
9090
};
9191
use vitaminc_prf::PrfValue;
9292

@@ -174,7 +174,7 @@ impl Reader for Ciphertext {
174174
}
175175
}
176176

177-
impl<S: Encrypt + Clone> EncryptFrom<S> for Ciphertext {
177+
impl<S: Plaintext + Clone> EncryptFrom<S> for Ciphertext {
178178
type Context = AeadContext;
179179
fn encryption<'s, K: 'static>() -> Encryption<'s, S, Self, K, Self::Context>
180180
where
@@ -195,7 +195,7 @@ impl Visitor for NativeCiphertextVisitor {
195195
Ok(CipherText::Single(leaf))
196196
}
197197
}
198-
impl<P: Decrypt<'static> + 'static> DecryptInto<P> for Ciphertext {
198+
impl<P: Decrypt + Send + 'static> DecryptInto<P> for Ciphertext {
199199
type Context = AeadContext;
200200
fn decryption<K: 'static>(self, context: Self::Context) -> Decryption<P, K> {
201201
match self.read(NativeCiphertextVisitor) {

‎packages/eql/crates/eql-bindings/src/encryption/targets.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@
7979
use std::fmt;
8080

8181
use serde::{de::DeserializeOwned, Serialize};
82+
use stack_encrypt::dynamic::{FfiValue, ValueKind};
8283
use stack_encrypt::kms::MaybeSend;
8384
use stack_encrypt::target::ExpectedContext;
8485
use stack_encrypt::{
8586
DecryptInto, EncryptFrom, Error, KeysetCipher, Label, NonEmpty, Pending, StackCipher,
8687
};
87-
use vitaminc_aead_value::{FfiValue, ValueKind};
8888

8989
use crate::v3::targets::{decrypt_named, encrypt_named, query_named, TARGETS};
9090
use crate::Identifier;

‎packages/eql/crates/eql-bindings/src/v3/targets.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use crate::encryption::targets::{
44
open_target, refuse, refuse_query, run_target, Opener, Target, TargetError,
55
};
66
use crate::Identifier;
7+
use stack_encrypt::dynamic::FfiValue;
78
use stack_encrypt::{KeysetCipher, NonEmpty, Pending};
8-
use vitaminc_aead_value::FfiValue;
99
/// Every EQL type a plan may name as a target, in
1010
/// `eql-domains::CATALOG` order: one per stored domain (every flat
1111
/// scalar domain plus the SteVec document). Query twins are not

‎packages/eql/crates/eql-codegen/src/targets.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ fn render_targets_from(rows: &[Row]) -> String {
270270
let file = quote! {
271271
#![doc = #mod_doc]
272272

273-
use vitaminc_aead_value::FfiValue;
273+
use stack_encrypt::dynamic::FfiValue;
274274

275275
use crate::encryption::targets::{#helpers refuse, refuse_query, Opener, Target, TargetError};
276276
use crate::Identifier;

0 commit comments

Comments
 (0)