From 774ccbdf83ab40a6d19d1f348f5050745f00c347 Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Tue, 8 Aug 2023 07:48:32 -0300 Subject: [PATCH] fix features --- plugins/stronghold/src/lib.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/stronghold/src/lib.rs b/plugins/stronghold/src/lib.rs index 6e83f215..2ba24508 100644 --- a/plugins/stronghold/src/lib.rs +++ b/plugins/stronghold/src/lib.rs @@ -1,7 +1,7 @@ use std::{ collections::HashMap, fmt, - path::{Path, PathBuf}, + path::PathBuf, sync::{Arc, Mutex}, time::Duration, }; @@ -398,6 +398,7 @@ fn get_client( } enum PasswordHashFunctionKind { + #[cfg(feature = "kdf")] Argon2(PathBuf), Custom(Box), } @@ -431,7 +432,8 @@ impl Builder { /// Ok(()) /// }); /// ``` - pub fn with_argon2(salt_path: &Path) -> Self { + #[cfg(feature = "kdf")] + pub fn with_argon2(salt_path: &std::path::Path) -> Self { Self { password_hash_function: PasswordHashFunctionKind::Argon2(salt_path.to_owned()), } @@ -443,6 +445,7 @@ impl Builder { let plugin_builder = PluginBuilder::new("stronghold").setup(move |app| { app.manage(StrongholdCollection::default()); app.manage(PasswordHashFunction(match password_hash_function { + #[cfg(feature = "kdf")] PasswordHashFunctionKind::Argon2(path) => { Box::new(move |p| kdf::KeyDerivation::argon2(p, &path)) }