config: new domains.cfg to configure openid realm
Or other realmy types...
This commit is contained in:
@ -38,10 +38,31 @@ use crate::api2::types::*;
|
||||
)]
|
||||
/// Authentication domain/realm index.
|
||||
fn list_domains() -> Result<Value, Error> {
|
||||
|
||||
let mut list = Vec::new();
|
||||
|
||||
list.push(json!({ "realm": "pam", "comment": "Linux PAM standard authentication", "default": true }));
|
||||
list.push(json!({ "realm": "pbs", "comment": "Proxmox Backup authentication server" }));
|
||||
|
||||
let (config, _digest) = crate::config::domains::config()?;
|
||||
|
||||
for (realm, (section_type, v)) in config.sections.iter() {
|
||||
let mut item = json!({
|
||||
"type": section_type,
|
||||
"realm": realm,
|
||||
});
|
||||
|
||||
if v["comment"].as_str().is_some() {
|
||||
item["comment"] = v["comment"].clone();
|
||||
}
|
||||
list.push(item);
|
||||
|
||||
}
|
||||
|
||||
Ok(list.into())
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
pub const ROUTER: Router = Router::new()
|
||||
|
Reference in New Issue
Block a user