]> git.proxmox.com Git - proxmox-backup.git/commitdiff
tfa: r#type parameter name
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 14 Dec 2020 15:32:42 +0000 (16:32 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 11 Jan 2021 09:23:03 +0000 (10:23 +0100)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/api2/access/tfa.rs

index e9a512ad7b906b6d5c8b1fb181ceb6b2151c61e1..7f46f00f9785e85fe0e0589b607f44ddb2c92262 100644 (file)
@@ -408,17 +408,15 @@ fn add_tfa_entry(
     value: Option<String>,
     challenge: Option<String>,
     password: Option<String>,
-    mut params: Value, // FIXME: once api macro supports raw parameters names, use `r#type`
+    r#type: TfaType,
     rpcenv: &mut dyn RpcEnvironment,
 ) -> Result<TfaUpdateInfo, Error> {
     tfa_update_auth(rpcenv, &userid, password)?;
 
-    let tfa_type: TfaType = serde_json::from_value(params["type"].take())?;
-
     let need_description =
         move || description.ok_or_else(|| format_err!("'description' is required for new entries"));
 
-    match tfa_type {
+    match r#type {
         TfaType::Totp => match (totp, value) {
             (Some(totp), Some(value)) => {
                 if challenge.is_some() {