openid: configuration: split scopes and response types in own mods, to be used in ezidam later

This commit is contained in:
Philippe Loctaux 2023-03-13 23:31:00 +01:00
parent 3d065bbc22
commit a0c0c3fa8f
6 changed files with 46 additions and 13 deletions

View file

@ -0,0 +1,20 @@
use itertools::Itertools;
use openidconnect::Scope;
pub struct SupportedScopes(pub Vec<Scope>);
impl SupportedScopes {
pub fn url_format() -> String {
Self::default().0.iter().map(|s| s.as_str()).join(" ")
}
}
impl Default for SupportedScopes {
fn default() -> Self {
Self(vec![
Scope::new("openid".to_string()),
Scope::new("profile".to_string()),
Scope::new("email".to_string()),
])
}
}