From 7a3863e1527a01380a91ba4475cedf94055dcf56 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Wed, 1 Nov 2023 16:56:26 +0100 Subject: [PATCH 1/2] lualdap: fix method modify --- types/lualdap/lualdap.d.tl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/lualdap/lualdap.d.tl b/types/lualdap/lualdap.d.tl index ee8cfad..44d19de 100644 --- a/types/lualdap/lualdap.d.tl +++ b/types/lualdap/lualdap.d.tl @@ -34,7 +34,7 @@ local record LuaLDAP close: function(self: Cnx): integer compare: function(self: Cnx, name: DistinguishedName, attribute: string, value: string): function(): boolean, string delete: function(self: Cnx, name: DistinguishedName): function(): boolean, string - modify: function(self: Cnx, ...: DistinguishedName|{integer|string:string|{string}}): function(): boolean, string + modify: function(self: Cnx, name: DistinguishedName, ...: {integer|string:string|{string}}): function(): boolean, string rename: function(self: Cnx, name: DistinguishedName, new_relative_dn: DistinguishedName, new_parent: DistinguishedName, delete_old: integer): function(): boolean, string search: function(self: Cnx, params: Search): function(): DistinguishedName, {string:string|{string}} end From 34d519a3224f538919f96145ddc6a74fecd18a31 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Fri, 3 Nov 2023 18:33:53 +0100 Subject: [PATCH 2/2] lualdap: refactor with more types --- types/lualdap/lualdap.d.tl | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/types/lualdap/lualdap.d.tl b/types/lualdap/lualdap.d.tl index 44d19de..df1cc43 100644 --- a/types/lualdap/lualdap.d.tl +++ b/types/lualdap/lualdap.d.tl @@ -12,6 +12,10 @@ local record LuaLDAP record Cnx userdata + type TableOfAttributes = {string:string|{string}} + type TableOfOperations = {integer|string:string|{string}} + type ResultFunction = function(): boolean, string + record Search enum Scope "base" @@ -29,14 +33,14 @@ local record LuaLDAP timeout: number end - add: function(self: Cnx, name: DistinguishedName, table_of_attributes: {string:string|{string}}): function(): boolean, string + add: function(self: Cnx, name: DistinguishedName, attributes: TableOfAttributes): ResultFunction bind_simple: function(self: Cnx, who: DistinguishedName, password: string): Cnx, string close: function(self: Cnx): integer - compare: function(self: Cnx, name: DistinguishedName, attribute: string, value: string): function(): boolean, string - delete: function(self: Cnx, name: DistinguishedName): function(): boolean, string - modify: function(self: Cnx, name: DistinguishedName, ...: {integer|string:string|{string}}): function(): boolean, string - rename: function(self: Cnx, name: DistinguishedName, new_relative_dn: DistinguishedName, new_parent: DistinguishedName, delete_old: integer): function(): boolean, string - search: function(self: Cnx, params: Search): function(): DistinguishedName, {string:string|{string}} + compare: function(self: Cnx, name: DistinguishedName, attribute: string, value: string): ResultFunction + delete: function(self: Cnx, name: DistinguishedName): ResultFunction + modify: function(self: Cnx, name: DistinguishedName, ...: TableOfOperations): ResultFunction + rename: function(self: Cnx, name: DistinguishedName, new_rdn: DistinguishedName, new_parent: DistinguishedName, delete_old: integer): ResultFunction + search: function(self: Cnx, params: Search): function(): DistinguishedName, TableOfAttributes end open: function(hostname: string, usetls:boolean, timeout: number): Cnx, string