aboutsummaryrefslogtreecommitdiffstats
path: root/teal-src
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2023-02-23 16:04:02 +0100
committerKim Alvefur <zash@zash.se>2023-02-23 16:04:02 +0100
commitef6ad34029730e300975d9e2b86d6aa8d8043b24 (patch)
treef219096ed58e140d0e3da23daec4159245bc25ff /teal-src
parentfe206323b5a8e04c8c5efe2b6519ac9d7f611f91 (diff)
downloadprosody-ef6ad34029730e300975d9e2b86d6aa8d8043b24.tar.gz
prosody-ef6ad34029730e300975d9e2b86d6aa8d8043b24.zip
core.usermanager: Add Teal description file
Diffstat (limited to 'teal-src')
-rw-r--r--teal-src/core/usermanager.d.tl43
1 files changed, 43 insertions, 0 deletions
diff --git a/teal-src/core/usermanager.d.tl b/teal-src/core/usermanager.d.tl
new file mode 100644
index 00000000..23bec060
--- /dev/null
+++ b/teal-src/core/usermanager.d.tl
@@ -0,0 +1,43 @@
+local Role = require "util.roles".Role;
+
+local record usermanager
+ record AuthProvider
+ -- TODO
+ end
+ record AccountInfo
+ created : number
+ password_updated : any
+ enabled : boolean
+ end
+
+ -- Users
+ test_password : function (username : string, host : string, password : string) : boolean
+ get_password : function (username : string, host : string) : string, string
+ set_password : function (username : string, host : string, password : string) : boolean, string
+ get_account_info : function (username : string, host : string) : AccountInfo
+ user_exists : function (username : string, host : string) : boolean
+ create_user : function (username : string, password : string, host : string) : boolean, string
+ delete_user : function (username : string, host : string) : boolean, string
+ users : function (host : string) : function () : string
+
+ -- Roles
+ get_user_role : function (username : string, host : string) : Role
+ set_user_role : function (username : string, host : string, role_name : string) : boolean, string
+ user_can_assume_role : function (username : string, host : string, role_name : string) : boolean
+ add_user_secondary_role : function (username : string, host: string, role_name : string) : boolean, string
+ remove_user_secondary_role : function (username : string, host: string, role_name : string) : boolean, string
+ get_user_secondary_roles : function (username : string, host : string) : { string : Role }
+ get_users_with_role : function (role : string, host : string) : { string }
+ get_jid_role : function (jid : string, host : string) : Role
+ set_jid_role : function (jid : string, host : string, role_name : string) : boolean
+ get_jids_with_role : function (role : string, host : string) : { string }
+ get_role_by_name : function (role_name : string) : Role
+
+ -- Etc
+ get_provider : function (host : string) : AuthProvider
+ get_sasl_handler : function (host : string, session : table) : table
+ initialize_host : function (host : string)
+ new_null_provider : function () : AuthProvider
+end
+
+return usermanager