Can specify environment variables in client configuration
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use crate::data::entity_manager::EntityManager;
|
||||
use crate::utils::string_utils::apply_env_vars;
|
||||
|
||||
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize, Eq, PartialEq)]
|
||||
pub struct ClientID(pub String);
|
||||
@@ -32,4 +33,14 @@ impl EntityManager<Client> {
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
pub fn apply_environment_variables(&mut self) {
|
||||
for c in self.iter_mut() {
|
||||
c.id = ClientID(apply_env_vars(&c.id.0));
|
||||
c.name = apply_env_vars(&c.name);
|
||||
c.description = apply_env_vars(&c.description);
|
||||
c.secret = apply_env_vars(&c.secret);
|
||||
c.redirect_uri = apply_env_vars(&c.redirect_uri);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user