[pve-devel] [PATCH access-control] api: get user: declare token schema

Wolfgang Bumiller w.bumiller at proxmox.com
Mon Mar 21 15:29:12 CET 2022


Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
---
The tokens are a mapping from tokenid to the token data, so let's
include this in the output specification.

We don't really make use of additionalProperties like this yet but it
*is* supported in PVE::JSONSchema, and it's the only way to clarify what
this is supposed to be.

 src/PVE/API2/User.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/PVE/API2/User.pm b/src/PVE/API2/User.pm
index 244264e..49d42d3 100644
--- a/src/PVE/API2/User.pm
+++ b/src/PVE/API2/User.pm
@@ -323,6 +323,7 @@ __PACKAGE__->register_method ({
 	    tokens => {
 		optional => 1,
 		type => 'object',
+		additionalProperties => get_standard_option('token-info'),
 	    },
 	},
 	type => "object"
-- 
2.30.2






More information about the pve-devel mailing list