]> git.proxmox.com Git - pve-access-control.git/commitdiff
api: users: s/realmtype/realm-type/ in response
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 2 Jul 2021 11:38:46 +0000 (13:38 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 2 Jul 2021 11:38:46 +0000 (13:38 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/API2/User.pm

index f1249a8cbdea650111906a8616bd3f8874334a5b..104c172f693c6c1f92e3abe2da208d2b4d7990aa 100644 (file)
@@ -150,9 +150,10 @@ __PACKAGE__->register_method ({
                        tokenid => get_standard_option('token-subid'),
                    }),
                },
-               realmtype => {
-                   type => 'string',
+               'realm-type' => {
+                   type => 'string', format => 'pve-realm',
                    description => 'The type of the users realm',
+                   optional => 1, # it should always be there, but we use conditional code below, so..
                },
            },
        },
@@ -192,9 +193,8 @@ __PACKAGE__->register_method ({
                if defined($entry->{tokens});
 
            my (undef, undef, $realm) = PVE::AccessControl::verify_username($user, 1);
-
-           if (defined($realm) && $domainids->{$realm}) {
-               $entry->{realmtype} = $domainids->{$realm}->{type};
+           if (defined($realm) && exists($domainids->{$realm})) {
+               $entry->{'realm-type'} = $domainids->{$realm}->{type};
            }
 
            $entry->{userid} = $user;