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

Wolfgang Bumiller w.bumiller at proxmox.com
Wed Mar 27 11:16:24 CET 2019


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 aca18bc..b32c452 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 "no active u2f challenge\n";
+}
+
 sub is_worker {
     my ($class) = @_;
 
-- 
2.11.0





More information about the pve-devel mailing list