Skip to content

Commit 74a21af

Browse files
committed
chore: fixup cipherstash-client usages
1 parent 95d9f8d commit 74a21af

6 files changed

Lines changed: 32 additions & 48 deletions

File tree

Cargo.lock

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

packages/cipherstash-proxy-integration/Cargo.toml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,8 @@ tracing-subscriber = { workspace = true }
2424
webpki-roots = "0.26.7"
2525

2626
[dev-dependencies]
27-
# cipherstash-client = { version = "0.18.0-pre.1", features = ["tokio"] }
28-
cipherstash-client = { path = "../../../cipherstash-suite/packages/cipherstash-client", features = [
29-
"tokio",
30-
] }
31-
# cipherstash-config = "0.2.3"
32-
cipherstash-config = { path = "../../../cipherstash-suite/packages/cipherstash-config" }
27+
cipherstash-client = { version = "0.20.0", features = ["tokio"] }
28+
cipherstash-config = "0.2.3"
3329
clap = "4.5.32"
3430
fake = { version = "4", features = ["chrono", "derive"] }
3531
hex = "0.4.3"

packages/cipherstash-proxy-integration/src/generate.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ mod tests {
189189
let mut result = pipeline.encrypt(None).await.unwrap();
190190
if let Some(Encrypted::SteVec(ste_vec)) = result.remove(idx) {
191191
for entry in ste_vec {
192-
let selector = hex::encode(entry.0 .0);
192+
let selector = hex::encode(entry.0.as_bytes());
193193
let term = entry.1;
194194
let record = entry.2;
195195

@@ -200,10 +200,10 @@ mod tests {
200200
e.blake3_index = Some(hex::encode(&items));
201201
}
202202
EncryptedSteVecTerm::OreFixed(o) => {
203-
e.ore_cclw_fixed_index = Some(hex::encode(o.bytes));
203+
e.ore_cclw_fixed_index = Some(hex::encode(&o));
204204
}
205205
EncryptedSteVecTerm::OreVariable(o) => {
206-
e.ore_cclw_var_index = Some(hex::encode(o.bytes));
206+
e.ore_cclw_var_index = Some(hex::encode(&o));
207207
}
208208
}
209209

packages/cipherstash-proxy-integration/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
mod common;
22
mod empty_result;
33
mod extended_protocol_error_messages;
4-
mod generate;
54
mod map_concat;
65
mod map_literals;
76
mod map_match_index;

packages/cipherstash-proxy/Cargo.toml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,8 @@ bigdecimal = { version = "0.4.6", features = ["serde-json"] }
88
arc-swap = "1.7.1"
99
bytes = { version = "1.9", default-features = false }
1010
chrono = { version = "0.4.39", features = ["clock"] }
11-
# cipherstash-client = { version = "0.18.0-pre.1", features = ["tokio"] }
12-
cipherstash-client = { path = "../../../cipherstash-suite/packages/cipherstash-client", features = [
13-
"tokio",
14-
] }
15-
# cipherstash-config = "0.2.3"
16-
cipherstash-config = { path = "../../../cipherstash-suite/packages/cipherstash-config" }
11+
cipherstash-client = { version = "0.20.0", features = ["tokio"] }
12+
cipherstash-config = "0.2.3"
1713
clap = { version = "4.5.31", features = ["derive", "env"] }
1814
config = { version = "0.15", features = [
1915
"async",

packages/cipherstash-proxy/src/encrypt/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -260,15 +260,15 @@ fn to_eql_encrypted(
260260
}
261261
IndexTerm::BinaryVec(_) => todo!(),
262262
IndexTerm::SteVecSelector(s) => {
263-
selector = Some(hex::encode(s.0));
263+
selector = Some(hex::encode(s.as_bytes()));
264264
}
265265
IndexTerm::SteVecTerm(ste_vec_term) => match ste_vec_term {
266266
EncryptedSteVecTerm::Mac(bytes) => blake3_index = Some(hex::encode(bytes)),
267267
EncryptedSteVecTerm::OreFixed(ore) => {
268-
ore_cclw_fixed_index = Some(hex::encode(ore.bytes))
268+
ore_cclw_fixed_index = Some(hex::encode(&ore))
269269
}
270270
EncryptedSteVecTerm::OreVariable(ore) => {
271-
ore_cclw_var_index = Some(hex::encode(ore.bytes))
271+
ore_cclw_var_index = Some(hex::encode(&ore))
272272
}
273273
},
274274
IndexTerm::SteQueryVec(_query) => {} // TODO: what do we do here?
@@ -302,18 +302,18 @@ fn to_eql_encrypted(
302302
.map(|EncryptedEntry(selector, term, ciphertext)| {
303303
let indexes = match term {
304304
EncryptedSteVecTerm::Mac(bytes) => EqlEncryptedIndexes {
305-
selector: Some(hex::encode(selector.0)),
305+
selector: Some(hex::encode(selector.as_bytes())),
306306
blake3_index: Some(hex::encode(bytes)),
307307
..Default::default()
308308
},
309309
EncryptedSteVecTerm::OreFixed(ore) => EqlEncryptedIndexes {
310-
selector: Some(hex::encode(selector.0)),
311-
ore_cclw_fixed_index: Some(hex::encode(ore.bytes)),
310+
selector: Some(hex::encode(selector.as_bytes())),
311+
ore_cclw_fixed_index: Some(hex::encode(&ore)),
312312
..Default::default()
313313
},
314314
EncryptedSteVecTerm::OreVariable(ore) => EqlEncryptedIndexes {
315-
selector: Some(hex::encode(selector.0)),
316-
ore_cclw_var_index: Some(hex::encode(ore.bytes)),
315+
selector: Some(hex::encode(selector.as_bytes())),
316+
ore_cclw_var_index: Some(hex::encode(&ore)),
317317
..Default::default()
318318
},
319319
};

0 commit comments

Comments
 (0)