mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-20 06:50:37 +00:00
@@ -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",
|
||||
}
|
||||
);
|
||||
|
||||
@@ -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>>>>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user