mirror of
https://git.proxmox.com/git/proxmox-perl-rs
synced 2025-08-14 00:10:21 +00:00
pve: enable tfa lockout, add api_unlock_tfa method
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
10472bc265
commit
590af894ef
@ -484,6 +484,14 @@ mod export {
|
|||||||
Err(methods::EntryNotFound) => bail!("no such entry"),
|
Err(methods::EntryNotFound) => bail!("no such entry"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[export]
|
||||||
|
fn api_unlock_tfa(#[try_from_ref] this: &Tfa, userid: &str) -> Result<bool, Error> {
|
||||||
|
Ok(methods::unlock_tfa(
|
||||||
|
&mut this.inner.lock().unwrap(),
|
||||||
|
userid,
|
||||||
|
)?)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Version 1 format of `/etc/pve/priv/tfa.cfg`
|
/// Version 1 format of `/etc/pve/priv/tfa.cfg`
|
||||||
@ -993,9 +1001,8 @@ impl proxmox_tfa::api::OpenUserChallengeData for UserAccess {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// TODO: Enable this once we can consider most clusters to support the new format.
|
|
||||||
fn enable_lockout(&self) -> bool {
|
fn enable_lockout(&self) -> bool {
|
||||||
false
|
true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user