Software /
code /
prosody
Annotate
teal-src/core/usermanager.d.tl @ 12945:d2c1c327a4d1
util.sasl.{scram,plain}: Pass authzid to SASL profile callback
For potential future use.
Used for logging into a different account than the one used for
authentication.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 16 Mar 2023 13:57:30 +0100 |
parent | 12905:8473a516004f |
rev | line source |
---|---|
12904
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
1 local Role = require "util.roles".Role; |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
2 |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
3 local record usermanager |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
4 record AuthProvider |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
5 -- TODO |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
6 end |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
7 record AccountInfo |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
8 created : number |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
9 password_updated : any |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
10 enabled : boolean |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
11 end |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
12 |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
13 -- Users |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
14 test_password : function (username : string, host : string, password : string) : boolean |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
15 get_password : function (username : string, host : string) : string, string |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
16 set_password : function (username : string, host : string, password : string) : boolean, string |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
17 get_account_info : function (username : string, host : string) : AccountInfo |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
18 user_exists : function (username : string, host : string) : boolean |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
19 create_user : function (username : string, password : string, host : string) : boolean, string |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
20 delete_user : function (username : string, host : string) : boolean, string |
12905
8473a516004f
core.usermanager: Add methods for enabling and disabling users
Kim Alvefur <zash@zash.se>
parents:
12904
diff
changeset
|
21 user_is_enabled : function (username : string, host : string) : boolean, string |
8473a516004f
core.usermanager: Add methods for enabling and disabling users
Kim Alvefur <zash@zash.se>
parents:
12904
diff
changeset
|
22 enable_user : function (username : string, host : string) : boolean, string |
8473a516004f
core.usermanager: Add methods for enabling and disabling users
Kim Alvefur <zash@zash.se>
parents:
12904
diff
changeset
|
23 disable_user : function (username : string, host : string) : boolean, string |
12904
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
24 users : function (host : string) : function () : string |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
25 |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
26 -- Roles |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
27 get_user_role : function (username : string, host : string) : Role |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
28 set_user_role : function (username : string, host : string, role_name : string) : boolean, string |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
29 user_can_assume_role : function (username : string, host : string, role_name : string) : boolean |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
30 add_user_secondary_role : function (username : string, host: string, role_name : string) : boolean, string |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
31 remove_user_secondary_role : function (username : string, host: string, role_name : string) : boolean, string |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
32 get_user_secondary_roles : function (username : string, host : string) : { string : Role } |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
33 get_users_with_role : function (role : string, host : string) : { string } |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
34 get_jid_role : function (jid : string, host : string) : Role |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
35 set_jid_role : function (jid : string, host : string, role_name : string) : boolean |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
36 get_jids_with_role : function (role : string, host : string) : { string } |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
37 get_role_by_name : function (role_name : string) : Role |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
38 |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
39 -- Etc |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
40 get_provider : function (host : string) : AuthProvider |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
41 get_sasl_handler : function (host : string, session : table) : table |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
42 initialize_host : function (host : string) |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
43 new_null_provider : function () : AuthProvider |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
44 end |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
45 |
4c321d889fdc
core.usermanager: Add Teal description file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
46 return usermanager |