File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed
packages/cipherstash-proxy Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ rust-toolchain.toml
1414# release artifacts
1515/cipherstash-proxy
1616/cipherstash-eql.sql
17+ /packages /cipherstash-proxy /eql-version-at-build-time.txt
1718
1819# credentials for local dev
1920.env.proxy.docker
Original file line number Diff line number Diff line change 1+ use std:: env;
2+
3+ fn main ( ) {
4+ if let Ok ( eql_version) = env:: var ( "CS_EQL_VERSION" ) {
5+ println ! (
6+ "cargo:rustc-env=EQL_VERSION_AT_BUILD_TIME={}" ,
7+ eql_version. trim( )
8+ ) ;
9+ }
10+ }
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ use tokio::signal::unix::{signal, SignalKind};
1111use tokio_util:: task:: TaskTracker ;
1212use tracing:: { error, info, warn} ;
1313
14+ const EQL_VERSION_AT_BUILD_TIME : Option < & ' static str > = option_env ! ( "EQL_VERSION_AT_BUILD_TIME" ) ;
15+
1416fn main ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
1517 let args = Args :: parse ( ) ;
1618
@@ -219,6 +221,13 @@ async fn init(mut config: TandemConfig) -> Encrypt {
219221 username = encrypt. config. database. username,
220222 eql_version = encrypt. eql_version,
221223 ) ;
224+ if encrypt. eql_version . as_deref ( ) != EQL_VERSION_AT_BUILD_TIME {
225+ warn ! (
226+ msg = "installed version of EQL is different to the version that Proxy was built with" ,
227+ eql_build_version = EQL_VERSION_AT_BUILD_TIME ,
228+ eql_installed_version = encrypt. eql_version,
229+ ) ;
230+ }
222231 encrypt
223232 }
224233 Err ( err) => {
You can’t perform that action at this time.
0 commit comments