From 3f6023f55c4fc8a9383a48e3447b72392a3c7508 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Fri, 2 Jul 2021 13:38:46 +0200 Subject: [PATCH] api: users: s/realmtype/realm-type/ in response Signed-off-by: Thomas Lamprecht --- src/PVE/API2/User.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/PVE/API2/User.pm b/src/PVE/API2/User.pm index f1249a8..104c172 100644 --- a/src/PVE/API2/User.pm +++ b/src/PVE/API2/User.pm @@ -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; -- 2.39.2