Trim client_secret_file value, fixes #302
This commit is contained in:
@@ -28,7 +28,7 @@ use self::proxy::ProxyConfig;
|
|||||||
pub use self::{check::check, manager::Manager};
|
pub use self::{check::check, manager::Manager};
|
||||||
use crate::{
|
use crate::{
|
||||||
Err, Result, err,
|
Err, Result, err,
|
||||||
utils::{self, option::OptionExt, string::EMPTY, sys},
|
utils::{self, string::EMPTY, sys},
|
||||||
};
|
};
|
||||||
|
|
||||||
/// All the config options for tuwunel.
|
/// All the config options for tuwunel.
|
||||||
@@ -2751,12 +2751,13 @@ impl IdentityProvider {
|
|||||||
return Ok(client_secret.clone());
|
return Ok(client_secret.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
self.client_secret_file
|
let Some(client_secret_file) = &self.client_secret_file else {
|
||||||
.as_ref()
|
return Err!("No client secret or client secret file configured");
|
||||||
.map_async(tokio::fs::read_to_string)
|
};
|
||||||
.await
|
|
||||||
.transpose()?
|
let client_secret = tokio::fs::read_to_string(client_secret_file).await?;
|
||||||
.ok_or_else(|| err!("No client secret or client secret file configured"))
|
|
||||||
|
Ok(client_secret.trim().to_owned())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user