[pve-devel] [PATCH v3 access-control 08/20] API: add API token API endpoints

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Jan 29 21:49:21 CET 2020


On 1/21/20 1:54 PM, Fabian Grünbichler wrote:
> ...
> @@ -53,6 +98,7 @@ my $extract_user_data = sub {
>      return $res if !$full;
>  
>      $res->{groups} = $data->{groups} ? [ keys %{$data->{groups}} ] : [];
> +    $res->{tokens} = $data->{tokens};
>  
>      return $res;
>  };
> @@ -228,7 +274,16 @@ __PACKAGE__->register_method ({
>  	    email => get_standard_option('user-email'),
>  	    comment => get_standard_option('user-comment'),
>  	    keys => get_standard_option('user-keys'),
> -	    groups => { type => 'array' },
> +	    groups => {
> +		type => 'array',
> +		items => {
> +		    type => 'string',
> +		    format => 'pve-groupid',
> +		},
> +	    },
> +	    tokens => {
> +		type => 'object',
> +	    },

made above two optional in the schema, as they are so. Fixes an issue with doing
this GET call for an users without any token, which now died during result
verification.


>  	},
>  	type => "object"
>      },






More information about the pve-devel mailing list