changeset 5888:432efc39572f

mod_http_admin_api: Return roles for existing invites, if any
author Matthew Wild <mwild1@gmail.com>
date Tue, 16 Apr 2024 15:01:40 +0100
parents 2aa66e928aa0
children 2597e2113561
files mod_http_admin_api/mod_http_admin_api.lua mod_http_admin_api/openapi.yaml
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_http_admin_api/mod_http_admin_api.lua	Tue Apr 16 14:15:16 2024 +0100
+++ b/mod_http_admin_api/mod_http_admin_api.lua	Tue Apr 16 15:01:40 2024 +0100
@@ -80,6 +80,7 @@
 local function token_info_to_invite_info(token_info)
 	local additional_data = token_info.additional_data;
 	local groups = additional_data and additional_data.groups or nil;
+	local roles = additional_data and additional_data.roles or nil;
 	local source = additional_data and additional_data.source or nil;
 	local reset = not not (additional_data and additional_data.allow_reset or nil);
 	return {
@@ -93,6 +94,7 @@
 		created_at = token_info.created_at;
 		expires = token_info.expires;
 		groups = groups;
+		roles = roles;
 		source = source;
 		reset = reset;
 	};
--- a/mod_http_admin_api/openapi.yaml	Tue Apr 16 14:15:16 2024 +0100
+++ b/mod_http_admin_api/openapi.yaml	Tue Apr 16 15:01:40 2024 +0100
@@ -557,6 +557,12 @@
           items:
             type: string
             description: Group ID
+        roles:
+          type: array
+          description: Array of role names that accepting users will have (primary first)
+          items:
+            type: string
+            description: Role name
         source:
           type: string
           description: |