Apply comments

Signed-off-by: tison <wander4096@gmail.com>
This commit is contained in:
tison
2024-03-26 14:38:33 +08:00
parent 4399a77031
commit 704ac44c23
2 changed files with 3 additions and 2 deletions

View File

@@ -65,7 +65,7 @@ fn load_credential_from_file(filepath: &str) -> Result<HashMap<String, Vec<u8>>>
ensure!(
path.exists() && path.is_file(),
InvalidConfigSnafu {
value: filepath.to_string(),
value: filepath,
msg: "UserProvider file must be a valid file path",
}
);
@@ -86,7 +86,7 @@ fn load_credential_from_file(filepath: &str) -> Result<HashMap<String, Vec<u8>>>
ensure!(
!credential.is_empty(),
InvalidConfigSnafu {
value: filepath.to_string(),
value: filepath,
msg: "UserProvider's file must contains at least one valid credential",
}
);

View File

@@ -30,6 +30,7 @@ use crate::{Identity, Password, UserInfoRef, UserProvider};
pub(crate) const WATCH_FILE_USER_PROVIDER: &str = "watch_file_user_provider";
/// A user provider that reads user credential from a file and watches the file for changes.
pub(crate) struct WatchFileUserProvider {
users: Arc<Mutex<HashMap<String, Vec<u8>>>>,
}