tfa: derive WebauthnConfigUpdater via api macro
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
@ -5,6 +5,7 @@ use anyhow::Error;
|
||||
|
||||
use crate::api2::types::PROXMOX_CONFIG_DIGEST_SCHEMA;
|
||||
use proxmox::api::{api, Permission, Router, RpcEnvironment, SubdirMap};
|
||||
use proxmox::api::schema::Updatable;
|
||||
use proxmox::list_subdirs_api_method;
|
||||
|
||||
use crate::config::tfa::{self, WebauthnConfig, WebauthnConfigUpdater};
|
||||
@ -73,9 +74,9 @@ pub fn update_webauthn_config(
|
||||
let digest = proxmox::tools::hex_to_digest(digest)?;
|
||||
crate::tools::detect_modified_configuration_file(&digest, &wa.digest()?)?;
|
||||
}
|
||||
webauthn.apply_to(wa);
|
||||
wa.update_from::<&str>(webauthn, &[])?;
|
||||
} else {
|
||||
tfa.webauthn = Some(webauthn.build()?);
|
||||
tfa.webauthn = Some(WebauthnConfig::try_build_from(webauthn)?);
|
||||
}
|
||||
|
||||
tfa::write(&tfa)?;
|
||||
|
Reference in New Issue
Block a user