[pve-devel] [PATCH common] add u2f challenge accessors to RESTEnvironment

Wolfgang Bumiller w.bumiller at proxmox.com
Thu May 24 15:28:47 CEST 2018


Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
---
 src/PVE/RESTEnvironment.pm | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/PVE/RESTEnvironment.pm b/src/PVE/RESTEnvironment.pm
index 32ffdd1..9c966dd 100644
--- a/src/PVE/RESTEnvironment.pm
+++ b/src/PVE/RESTEnvironment.pm
@@ -217,6 +217,20 @@ sub get_user {
     die "user name not set\n";
 }
 
+sub set_u2f_challenge {
+    my ($self, $challenge) = @_;
+
+    $self->{u2f_challenge} = $challenge;
+}
+
+sub get_u2f_challenge {
+    my ($self, $noerr) = @_;
+
+    return $self->{u2f_challenge} if defined($self->{u2f_challenge}) || $noerr;
+
+    die "user active challenge\n";
+}
+
 sub is_worker {
     my ($class) = @_;
 
-- 
2.11.0




More information about the pve-devel mailing list