Skip to content

Commit

Permalink
libsql: error on passing an encryption key without the feature
Browse files Browse the repository at this point in the history
  • Loading branch information
psarna committed Jan 14, 2024
1 parent 6aa139d commit f819239
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libsql/src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,10 @@ impl Database {

let conn = db.connect()?;

if !cfg!(feature = "encryption") {
let _ = encryption_key;
tracing::warn!("Encryption at rest is not enabled, ignoring encryption_key");
if !cfg!(feature = "encryption") && encryption_key.is_some() {
return Err(crate::Error::Misuse(
"Encryption is not enabled: enable the `encryption` feature in order to enable encryption-at-rest".to_string(),
));
}
#[cfg(feature = "encryption")]
if let Some(encryption_key) = encryption_key {
Expand Down

0 comments on commit f819239

Please sign in to comment.