]> git.proxmox.com Git - pve-access-control.git/blobdiff - PVE/API2/Domains.pm
change from dpkg-deb to dpkg-buildpackage
[pve-access-control.git] / PVE / API2 / Domains.pm
index 10515c0da9f3cc43e9d8b46b6ef217466eedcd5b..b5fa65efc9253847ee49e73bef577c0ab9cf2bf9 100644 (file)
@@ -34,7 +34,17 @@ __PACKAGE__->register_method ({
            type => "object",
            properties => {
                realm => { type => 'string' },
-               comment => { type => 'string', optional => 1 },
+               tfa => {
+                   description => "Two-factor authentication provider.",
+                   type => 'string',
+                   enum => [ 'yubico', 'oath' ],
+                   optional => 1,
+               },
+               comment => {
+                   description => "A comment. The GUI use this text when you select a domain (Realm) on the login window.",
+                   type => 'string',
+                   optional => 1,
+               },
            },
        },
        links => [ { rel => 'child', href => "{realm}" } ],
@@ -52,6 +62,9 @@ __PACKAGE__->register_method ({
            my $entry = { realm => $realm, type => $d->{type} };
            $entry->{comment} = $d->{comment} if $d->{comment};
            $entry->{default} = 1 if $d->{default};
+           if ($d->{tfa} && (my $tfa_cfg = PVE::Auth::Plugin::parse_tfa_config($d->{tfa}))) {
+               $entry->{tfa} = $tfa_cfg->{type};
+           }
            push @$res, $entry;
        }
 
@@ -132,9 +145,6 @@ __PACKAGE__->register_method ({
 
                my $realm = extract_param($param, 'realm');
 
-               die "unable to modify bultin domain '$realm'\n"
-                   if ($realm eq 'pam' || $realm eq 'pve');
-
                die "domain '$realm' does not exist\n" 
                    if !$ids->{$realm};