Skip to content

Commit faafeb0

Browse files
committed
chore(eql): remove eql module
The `eql` module is now owned by `cipherstash-client`.
1 parent 83fe635 commit faafeb0

File tree

12 files changed

+433
-416
lines changed

12 files changed

+433
-416
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ debug = true
4343

4444
[workspace.dependencies]
4545
sqltk = { version = "0.10.0" }
46-
cipherstash-client = "0.27.0"
47-
cts-common = { version = "0.3.0" }
46+
cipherstash-client = "0.30.0"
47+
cts-common = { version = "0.4.0" }
48+
4849
thiserror = "2.0.9"
4950
tokio = { version = "1.44.2", features = ["full"] }
5051
tracing = "0.1"

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

Lines changed: 0 additions & 254 deletions
This file was deleted.

packages/cipherstash-proxy/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
pub mod cli;
44
pub mod config;
55
pub mod connect;
6-
pub mod eql;
76
pub mod error;
87
pub mod log;
98
pub mod postgresql;
@@ -14,9 +13,9 @@ pub mod tls;
1413
pub use crate::cli::Args;
1514
pub use crate::cli::Migrate;
1615
pub use crate::config::{DatabaseConfig, ServerConfig, TandemConfig, TlsConfig};
17-
pub use crate::eql::{EqlEncrypted, ForQuery, Identifier, Plaintext};
1816
pub use crate::log::init;
1917
pub use crate::proxy::Proxy;
18+
pub use cipherstash_client::eql::{EqlEncrypted, ForQuery, Identifier, Plaintext};
2019

2120
use std::mem;
2221

packages/cipherstash-proxy/src/postgresql/backend.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use super::messages::row_description::RowDescription;
77
use super::messages::BackendCode;
88
use super::Column;
99
use crate::connect::Sender;
10-
use crate::eql::EqlEncrypted;
1110
use crate::error::{EncryptError, Error};
1211
use crate::log::{CONTEXT, DEVELOPMENT, MAPPER, PROTOCOL};
1312
use crate::postgresql::context::Portal;
@@ -21,6 +20,7 @@ use crate::prometheus::{
2120
};
2221
use crate::proxy::EncryptionService;
2322
use bytes::BytesMut;
23+
use cipherstash_client::eql::EqlEncrypted;
2424
use metrics::{counter, histogram};
2525
use std::time::Instant;
2626
use tokio::io::AsyncRead;

packages/cipherstash-proxy/src/postgresql/column_mapper.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use crate::{
2-
eql::Identifier,
32
error::{EncryptError, Error},
43
log::MAPPER,
54
postgresql::Column,
65
proxy::EncryptConfig,
76
};
7+
use cipherstash_client::eql::Identifier;
88
use eql_mapper::{EqlTerm, TableColumn, TypeCheckedStatement};
99
use postgres_types::Type;
1010
use std::sync::Arc;
@@ -40,7 +40,8 @@ impl ColumnMapper {
4040
let configured_column = match &**ty {
4141
eql_mapper::Type::Value(eql_mapper::Value::Eql(eql_term)) => {
4242
let TableColumn { table, column } = eql_term.table_column();
43-
let identifier: Identifier = Identifier::from((table, column));
43+
let identifier: Identifier =
44+
Identifier::new(table.to_string(), column.to_string());
4445

4546
debug!(
4647
target: MAPPER,
@@ -74,7 +75,7 @@ impl ColumnMapper {
7475
let configured_column = match param {
7576
(_, eql_mapper::Value::Eql(eql_term)) => {
7677
let TableColumn { table, column } = eql_term.table_column();
77-
let identifier = Identifier::from((table, column));
78+
let identifier = Identifier::new(table.to_string(), column.to_string());
7879

7980
debug!(
8081
target: MAPPER,
@@ -102,7 +103,7 @@ impl ColumnMapper {
102103

103104
for (eql_term, _) in typed_statement.literals.iter() {
104105
let TableColumn { table, column } = eql_term.table_column();
105-
let identifier = Identifier::from((table, column));
106+
let identifier = Identifier::new(table.to_string(), column.to_string());
106107

107108
debug!(
108109
target: MAPPER,

packages/cipherstash-proxy/src/postgresql/messages/bind.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use super::{maybe_json, maybe_jsonb, Name, NULL};
2-
use crate::eql;
32
use crate::error::{Error, MappingError, ProtocolError};
43
use crate::log::MAPPER;
54
use crate::postgresql::context::column::Column;
@@ -9,6 +8,7 @@ use crate::postgresql::protocol::BytesMutReadString;
98
use crate::{SIZE_I16, SIZE_I32};
109
use bytes::{Buf, BufMut, BytesMut};
1110
use cipherstash_client::encryption::Plaintext;
11+
use cipherstash_client::eql::{self, EqlEncrypted};
1212
use postgres_types::Type;
1313
use std::fmt::{self, Display, Formatter};
1414
use std::io::Cursor;
@@ -81,7 +81,7 @@ impl Bind {
8181
Ok(plaintexts)
8282
}
8383

84-
pub fn rewrite(&mut self, encrypted: Vec<Option<eql::EqlEncrypted>>) -> Result<(), Error> {
84+
pub fn rewrite(&mut self, encrypted: Vec<Option<EqlEncrypted>>) -> Result<(), Error> {
8585
for (idx, ct) in encrypted.iter().enumerate() {
8686
if let Some(ct) = ct {
8787
let json = serde_json::to_value(ct)?;

packages/cipherstash-proxy/src/postgresql/messages/data_row.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use super::{BackendCode, NULL};
22
use crate::{
3-
eql,
43
error::{EncryptError, Error, ProtocolError},
54
log::DECRYPT,
65
postgresql::Column,
76
};
87
use bytes::{Buf, BufMut, BytesMut};
8+
use cipherstash_client::eql::EqlEncrypted;
99
use std::io::Cursor;
1010
use tracing::{debug, error};
1111

@@ -23,7 +23,7 @@ impl DataRow {
2323
pub fn as_ciphertext(
2424
&mut self,
2525
column_configuration: &Vec<Option<Column>>,
26-
) -> Vec<Option<eql::EqlEncrypted>> {
26+
) -> Vec<Option<EqlEncrypted>> {
2727
let mut result = vec![];
2828
for (data_column, column_config) in self.columns.iter_mut().zip(column_configuration) {
2929
let encrypted = column_config
@@ -175,7 +175,7 @@ impl TryFrom<DataColumn> for BytesMut {
175175
}
176176
}
177177

178-
impl TryFrom<&mut DataColumn> for eql::EqlEncrypted {
178+
impl TryFrom<&mut DataColumn> for EqlEncrypted {
179179
type Error = Error;
180180

181181
fn try_from(col: &mut DataColumn) -> Result<Self, Error> {

0 commit comments

Comments
 (0)