# HG changeset patch # User Matthew Wild # Date 1714409359 -3600 # Node ID 095030677ae62e6fe615764b3536131b76cf78b5 # Parent 423163b65bb1c247eff8099f421bd1f394c37887 mod_http_admin_api: Support storing free-form text note with invitations diff -r 423163b65bb1 -r 095030677ae6 mod_http_admin_api/mod_http_admin_api.lua --- a/mod_http_admin_api/mod_http_admin_api.lua Mon Apr 29 02:00:34 2024 +0200 +++ b/mod_http_admin_api/mod_http_admin_api.lua Mon Apr 29 17:49:19 2024 +0100 @@ -82,6 +82,7 @@ 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 note = additional_data and additional_data.note or nil; local reset = not not (additional_data and additional_data.allow_reset or nil); return { id = token_info.token; @@ -97,6 +98,7 @@ roles = roles; source = source; reset = reset; + note = note; }; end @@ -156,12 +158,14 @@ invite = invites.create_group(options.groups, { source = source; roles = options.roles; + note = options.note; }, options.ttl); elseif invite_type == "account" then invite = invites.create_account(options.username, { source = source; groups = options.groups; roles = options.roles; + note = options.note; }, options.ttl); else return 400; diff -r 423163b65bb1 -r 095030677ae6 mod_http_admin_api/openapi.yaml --- a/mod_http_admin_api/openapi.yaml Mon Apr 29 02:00:34 2024 +0200 +++ b/mod_http_admin_api/openapi.yaml Mon Apr 29 17:49:19 2024 +0100 @@ -545,6 +545,10 @@ type: string description: HTTPS URL of invite page (use in preference to XMPP URI when available) nullable: true + note: + type: string + nullable: true + description: Free-form text note/annotation to help identify the invitation created_at: type: integer description: Unix timestamp of invite creation @@ -599,6 +603,10 @@ items: type: string description: "Role name" + note: + type: string + nullable: true + description: Free-form text note/annotation to help identify the invitation NewGroupInvite: type: object properties: @@ -621,6 +629,10 @@ items: type: string description: "Role name" + note: + type: string + nullable: true + description: Free-form text note/annotation to help identify the invitation NewResetInvite: type: object properties: