aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_disco.lua
Commit message (Collapse)AuthorAgeFilesLines
* Switch to a new role-based authorization framework, removing is_admin()Matthew Wild2022-06-151-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We began moving away from simple "is this user an admin?" permission checks before 0.12, with the introduction of mod_authz_internal and the ability to dynamically change the roles of individual users. The approach in 0.12 still had various limitations however, and apart from the introduction of roles other than "admin" and the ability to pull that info from storage, not much actually changed. This new framework shakes things up a lot, though aims to maintain the same functionality and behaviour on the surface for a default Prosody configuration. That is, if you don't take advantage of any of the new features, you shouldn't notice any change. The biggest change visible to developers is that usermanager.is_admin() (and the auth provider is_admin() method) have been removed. Gone. Completely. Permission checks should now be performed using a new module API method: module:may(action_name, context) This method accepts an action name, followed by either a JID (string) or (preferably) a table containing 'origin'/'session' and 'stanza' fields (e.g. the standard object passed to most events). It will return true if the action should be permitted, or false/nil otherwise. Modules should no longer perform permission checks based on the role name. E.g. a lot of code previously checked if the user's role was prosody:admin before permitting some action. Since many roles might now exist with similar permissions, and the permissions of prosody:admin may be redefined dynamically, it is no longer suitable to use this method for permission checks. Use module:may(). If you start an action name with ':' (recommended) then the current module's name will automatically be used as a prefix. To define a new permission, use the new module API: module:default_permission(role_name, action_name) module:default_permissions(role_name, { action_name[, action_name...] }) This grants the specified role permission to execute the named action(s) by default. This may be overridden via other mechanisms external to your module. The built-in roles that developers should use are: - prosody:user (normal user) - prosody:admin (host admin) - prosody:operator (global admin) The new prosody:operator role is intended for server-wide actions (such as shutting down Prosody). Finally, all usage of is_admin() in modules has been fixed by this commit. Some of these changes were trickier than others, but no change is expected to break existing deployments. EXCEPT: mod_auth_ldap no longer supports the ldap_admin_filter option. It's very possible nobody is using this, but if someone is then we can later update it to pull roles from LDAP somehow.
* spelling: non-existing mistakes (thanks timeless)0.12.0Kim Alvefur2022-03-071-1/+1
|
* mod_disco: Optionally return info on admin accounts to non-contactsKim Alvefur2021-04-151-2/+5
| | | | | If you already know the account, from say the server contact info, then this confirms their admin status.
* mod_disco: Advertise anonymous usersKim Alvefur2020-07-041-0/+2
| | | | Can these even be seen?
* mod_disco: Advertise admin accounts as such via disco identityKim Alvefur2020-07-041-1/+6
|
* mod_disco: Send XEP-0115 caps in s2s stream featuresKim Alvefur2021-08-121-0/+6
| | | | | Not currently used for anything, but allowed and could be used in the future and might be used by other servers.
* mod_disco: Add some spacing to improve readability and code navigationKim Alvefur2020-11-101-0/+4
|
* mod_disco: Simplify iq handling by hooking on iq-get/ instead of iq/.Emmanuel Gil Peyrot2018-08-241-8/+4
|
* mod_disco: Skip code specific to disco on user accounts (avoids invoking ↵Kim Alvefur2018-05-281-0/+1
| | | | usermanager, fixes #1150)
* mod_disco: Advertise in stream-features after auth (probably what was meant ↵Kim Alvefur2017-07-271-1/+1
| | | | in 200f1f6306a7) (fixes #957)
* Merge 0.9->0.10Kim Alvefur2017-05-271-0/+1
|\
| * mod_disco: Add an account/registered identity on subscribed accounts, fixes ↵Emmanuel Gil Peyrot2017-05-271-0/+1
| | | | | | | | #826.
* | mod_disco: Rename variables to avoid name clash [luacheck]Kim Alvefur2017-04-011-12/+12
| |
* | Merge 0.9->0.10Kim Alvefur2017-03-241-1/+1
|\|
| * mod_disco: Correctly set the 'node' attr (fixes #449)Kim Alvefur2017-03-241-1/+1
| |
* | plugins/various: Use type-specific config APIKim Alvefur2017-03-161-1/+1
| |
* | mod_disco: Update to account for new intermediate session type (from ↵Kim Alvefur2016-12-151-1/+1
| | | | | | | | 9f70d35a1602)
* | Remove all trailing whitespaceFlorian Zeitz2013-08-091-1/+1
| |
* | mod_disco: Check for host type == 'local' ('normal' never existed)Matthew Wild2013-08-061-1/+1
| |
* | mod_disco: Allow ansering disco requests including nodes, and adding custom ↵Florian Zeitz2013-06-041-8/+35
| | | | | | | | items to disco#items requests
* | mod_disco: Emit events for disco requests, which contain a node, on user ↵Florian Zeitz2013-05-171-4/+26
|/ | | | accounts
* hostmanager, mod_disco: Show optional 'name' option from the config in ↵Matthew Wild2012-08-051-2/+2
| | | | disco#items queries (fixes use-case in #292) (thanks diSabler, mva)
* mod_disco: Allow configurable name in disco identity (defaults to 'Prosody')Matthew Wild2012-07-231-1/+1
|
* core.modulemanager, mod_disco: Add support for XEP-0128: Service Discovery ↵Kim Alvefur2011-08-081-0/+8
| | | | Extensions
* mod_disco: Don't add caps hash to stream features on unauthenticated ↵Waqas Hussain2010-12-031-1/+3
| | | | connections.
* mod_disco: Fixed: Service discovery features were not being removed on ↵Waqas Hussain2010-11-281-0/+2
| | | | module unload (issue #205).
* mod_disco: Updated to use hostmanager.get_children instead of ↵Waqas Hussain2010-11-101-2/+2
| | | | componentmanager.get_children.
* mod_disco: Renamed the 'session' property of the account-disco-info and ↵Waqas Hussain2010-11-071-2/+2
| | | | account-disco-items events to 'origin' for consistency.
* mod_disco: Reflect requested 'node' attribute in the disco#info reply.Waqas Hussain2010-07-121-1/+3
|
* mod_disco: Respond to disco#info to the correct caps hash node ("node#ver").Waqas Hussain2010-07-111-1/+1
|
* mod_disco: Cache disco#info reply and caps hash for host, return correct ↵Waqas Hussain2010-07-111-28/+38
| | | | caps hash, and respond to disco#info to the caps hash node.
* mod_disco: Support for putting the server's caps hash in stream:features to ↵Matthew Wild2010-07-091-8/+38
| | | | allow the client to cache disco#info for the server instead of requesting it at each login.
* Merge 0.6->0.7Matthew Wild2010-03-221-2/+2
|\
| * Update copyright headers for 2010Matthew Wild2010-03-221-2/+2
| |
* | mod_disco: Added option 'disco_items' to allow appending items to a host's ↵Waqas Hussain2010-01-231-0/+22
| | | | | | | | disco#items result.
* | mod_disco: Handle and fire events for service discovery queries for bare ↵Waqas Hussain2009-12-211-0/+31
|/ | | | account JIDs (thanks darkrain).
* mod_disco: Rearranged some lines, and added a FIXME commentWaqas Hussain2009-08-181-2/+2
|
* mod_disco: Removed reference to core.discomanagerWaqas Hussain2009-08-181-1/+0
|
* mod_disco: Removed legacy IQ hooksWaqas Hussain2009-08-181-7/+0
|
* mod_disco: Handle disco#items queries using new APIsWaqas Hussain2009-08-181-0/+14
|
* mod_disco: Added identity server/im with name 'Prosody'Waqas Hussain2009-08-181-0/+1
|
* mod_disco: Handle disco#info queries using new APIsWaqas Hussain2009-08-181-2/+26
|
* Remove version number from copyright headersMatthew Wild2009-07-101-1/+1
|
* mod_disco: Convert from Windows line endingsMatthew Wild2009-07-091-12/+12
|
* 0.3->0.4Matthew Wild2009-03-201-1/+1
|
* Update copyright notices for 2009Matthew Wild2009-01-301-2/+2
|
* 0.2->0.3Matthew Wild2009-01-301-1/+1
|
* GPL->MIT!Matthew Wild2009-01-301-13/+2
|
* 0.1 -> 0.2Matthew Wild2008-12-101-1/+1
|
* Change modules to use the new add_feature module API method.Waqas Hussain2008-12-041-2/+2
| | | | This also fixes the bug causing disco features being added to every disco reply for every host.