Skip to content

Commit 6f5ae17

Browse files
dasha-uwujevolk
authored andcommitted
Trim client_secret_file value, fixes #302
1 parent bccc251 commit 6f5ae17

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

src/core/config/mod.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use self::proxy::ProxyConfig;
2828
pub use self::{check::check, manager::Manager};
2929
use crate::{
3030
Err, Result, err,
31-
utils::{self, option::OptionExt, string::EMPTY, sys},
31+
utils::{self, string::EMPTY, sys},
3232
};
3333

3434
/// All the config options for tuwunel.
@@ -2751,12 +2751,13 @@ impl IdentityProvider {
27512751
return Ok(client_secret.clone());
27522752
}
27532753

2754-
self.client_secret_file
2755-
.as_ref()
2756-
.map_async(tokio::fs::read_to_string)
2757-
.await
2758-
.transpose()?
2759-
.ok_or_else(|| err!("No client secret or client secret file configured"))
2754+
let Some(client_secret_file) = &self.client_secret_file else {
2755+
return Err!("No client secret or client secret file configured");
2756+
};
2757+
2758+
let client_secret = tokio::fs::read_to_string(client_secret_file).await?;
2759+
2760+
Ok(client_secret.trim().to_owned())
27602761
}
27612762
}
27622763

0 commit comments

Comments
 (0)