Fix token_cache_path behavior

This commit is contained in:
sinavir 2025-02-17 20:12:48 +01:00
parent dd17932a47
commit 6828d41779
No known key found for this signature in database
2 changed files with 9 additions and 0 deletions
libs/client/src
tools/cli/src/cli

View file

@ -453,6 +453,13 @@ impl KanidmClientBuilder {
}
}
pub fn set_token_cache_path(self, token_cache_path: Option<String>) -> Self {
KanidmClientBuilder {
token_cache_path,
..self
}
}
#[allow(clippy::result_unit_err)]
pub fn add_root_certificate_filepath(self, ca_path: &str) -> Result<Self, ClientError> {
//Okay we have a ca to add. Let's read it in and setup.

View file

@ -101,6 +101,8 @@ impl CommonOpt {
false => client_builder,
};
let client_builder = client_builder.set_token_cache_path(self.token_cache_path.clone());
client_builder.build().unwrap_or_else(|e| {
error!("Failed to build client instance -- {:?}", e);
std::process::exit(1);