Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
535 changes: 401 additions & 134 deletions Cargo.lock

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ debug = true

[workspace.dependencies]
sqltk = { version = "0.10.0" }
cipherstash-client = "0.27.0"
cts-common = { version = "0.3.0" }
cipherstash-client = "0.30.0"
cts-common = { version = "0.4.0" }

thiserror = "2.0.9"
tokio = { version = "1.44.2", features = ["full"] }
tracing = "0.1"
Expand Down
254 changes: 0 additions & 254 deletions packages/cipherstash-proxy/src/eql/mod.rs

This file was deleted.

3 changes: 1 addition & 2 deletions packages/cipherstash-proxy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
pub mod cli;
pub mod config;
pub mod connect;
pub mod eql;
pub mod error;
pub mod log;
pub mod postgresql;
Expand All @@ -14,9 +13,9 @@ pub mod tls;
pub use crate::cli::Args;
pub use crate::cli::Migrate;
pub use crate::config::{DatabaseConfig, ServerConfig, TandemConfig, TlsConfig};
pub use crate::eql::{EqlEncrypted, ForQuery, Identifier, Plaintext};
pub use crate::log::init;
pub use crate::proxy::Proxy;
pub use cipherstash_client::eql::{EqlEncrypted, ForQuery, Identifier, Plaintext};

use std::mem;

Expand Down
2 changes: 1 addition & 1 deletion packages/cipherstash-proxy/src/postgresql/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use super::messages::row_description::RowDescription;
use super::messages::BackendCode;
use super::Column;
use crate::connect::Sender;
use crate::eql::EqlEncrypted;
use crate::error::{EncryptError, Error};
use crate::log::{CONTEXT, DEVELOPMENT, MAPPER, PROTOCOL};
use crate::postgresql::context::Portal;
Expand All @@ -21,6 +20,7 @@ use crate::prometheus::{
};
use crate::proxy::EncryptionService;
use bytes::BytesMut;
use cipherstash_client::eql::EqlEncrypted;
use metrics::{counter, histogram};
use std::time::Instant;
use tokio::io::AsyncRead;
Expand Down
9 changes: 5 additions & 4 deletions packages/cipherstash-proxy/src/postgresql/column_mapper.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use crate::{
eql::Identifier,
error::{EncryptError, Error},
log::MAPPER,
postgresql::Column,
proxy::EncryptConfig,
};
use cipherstash_client::eql::Identifier;
use eql_mapper::{EqlTerm, TableColumn, TypeCheckedStatement};
use postgres_types::Type;
use std::sync::Arc;
Expand Down Expand Up @@ -40,7 +40,8 @@ impl ColumnMapper {
let configured_column = match &**ty {
eql_mapper::Type::Value(eql_mapper::Value::Eql(eql_term)) => {
let TableColumn { table, column } = eql_term.table_column();
let identifier: Identifier = Identifier::from((table, column));
let identifier: Identifier =
Identifier::new(table.to_string(), column.to_string());

debug!(
target: MAPPER,
Expand Down Expand Up @@ -74,7 +75,7 @@ impl ColumnMapper {
let configured_column = match param {
(_, eql_mapper::Value::Eql(eql_term)) => {
let TableColumn { table, column } = eql_term.table_column();
let identifier = Identifier::from((table, column));
let identifier = Identifier::new(table.to_string(), column.to_string());

debug!(
target: MAPPER,
Expand Down Expand Up @@ -102,7 +103,7 @@ impl ColumnMapper {

for (eql_term, _) in typed_statement.literals.iter() {
let TableColumn { table, column } = eql_term.table_column();
let identifier = Identifier::from((table, column));
let identifier = Identifier::new(table.to_string(), column.to_string());

debug!(
target: MAPPER,
Expand Down
4 changes: 2 additions & 2 deletions packages/cipherstash-proxy/src/postgresql/messages/bind.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use super::{maybe_json, maybe_jsonb, Name, NULL};
use crate::eql;
use crate::error::{Error, MappingError, ProtocolError};
use crate::log::MAPPER;
use crate::postgresql::context::column::Column;
Expand All @@ -9,6 +8,7 @@ use crate::postgresql::protocol::BytesMutReadString;
use crate::{SIZE_I16, SIZE_I32};
use bytes::{Buf, BufMut, BytesMut};
use cipherstash_client::encryption::Plaintext;
use cipherstash_client::eql::{self, EqlEncrypted};
use postgres_types::Type;
use std::fmt::{self, Display, Formatter};
use std::io::Cursor;
Expand Down Expand Up @@ -81,7 +81,7 @@ impl Bind {
Ok(plaintexts)
}

pub fn rewrite(&mut self, encrypted: Vec<Option<eql::EqlEncrypted>>) -> Result<(), Error> {
pub fn rewrite(&mut self, encrypted: Vec<Option<EqlEncrypted>>) -> Result<(), Error> {
for (idx, ct) in encrypted.iter().enumerate() {
if let Some(ct) = ct {
let json = serde_json::to_value(ct)?;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use super::{BackendCode, NULL};
use crate::{
eql,
error::{EncryptError, Error, ProtocolError},
log::DECRYPT,
postgresql::Column,
};
use bytes::{Buf, BufMut, BytesMut};
use cipherstash_client::eql::EqlEncrypted;
use std::io::Cursor;
use tracing::{debug, error};

Expand All @@ -23,7 +23,7 @@ impl DataRow {
pub fn as_ciphertext(
&mut self,
column_configuration: &Vec<Option<Column>>,
) -> Vec<Option<eql::EqlEncrypted>> {
) -> Vec<Option<EqlEncrypted>> {
let mut result = vec![];
for (data_column, column_config) in self.columns.iter_mut().zip(column_configuration) {
let encrypted = column_config
Expand Down Expand Up @@ -175,7 +175,7 @@ impl TryFrom<DataColumn> for BytesMut {
}
}

impl TryFrom<&mut DataColumn> for eql::EqlEncrypted {
impl TryFrom<&mut DataColumn> for EqlEncrypted {
type Error = Error;

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