Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Switch to a new role-based authorization framework, removing is_admin() | Matthew Wild | 2022-06-15 | 1 | -6/+0 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. | ||||
* | usermanager, mod_saslauth: Default to internal_hashed if no auth module ↵ | Matthew Wild | 2022-02-10 | 1 | -1/+1 |
| | | | | | | | | | | specified The default config was updated in this way long ago, but if no option was present in the config, Prosody would load internal_plain. This change can result in changes (for the better) for people using very old configuration files lacking an 'authentication' setting. | ||||
* | core.usermanager: Implement noop role writes on global authz provider | Kim Alvefur | 2021-12-06 | 1 | -0/+2 |
| | | | | So that the methods are there and don't cause an error. | ||||
* | usermanager: Fire user-roles-changed event when updating roles of a local user | Matthew Wild | 2021-11-12 | 1 | -1/+7 |
| | |||||
* | usermanager, mod_authz_internal: Add methods to fetch users/JIDs of given role | Matthew Wild | 2021-08-26 | 1 | -0/+24 |
| | |||||
* | usermanager: expose set_roles through API | Jonas Schäfer | 2021-03-22 | 1 | -0/+18 |
| | |||||
* | usermanager: Fix traceback when checking admin status of host-only JIDs ↵ | Matthew Wild | 2020-03-19 | 1 | -1/+1 |
| | | | | (fixes #1508) | ||||
* | usermanager, mod_authz_*: Merge mod_authz_config and mod_authz_internal into ↵ | Matthew Wild | 2020-02-23 | 1 | -1/+1 |
| | | | | the latter | ||||
* | usermanager: Add get_roles() function | Matthew Wild | 2020-02-05 | 1 | -1/+7 |
| | |||||
* | mod_authz_internal, usermanager: Rename to mod_authz_config | Matthew Wild | 2020-01-27 | 1 | -1/+1 |
| | |||||
* | usermanager: Load authz providers on components also | Matthew Wild | 2020-01-27 | 1 | -4/+6 |
| | |||||
* | usermanager, mod_authz_internal: Move admin-checking functionality into a ↵ | Matthew Wild | 2020-01-27 | 1 | -30/+32 |
| | | | | | | | module. Fixes #517 (ish). Note: Removes the ability for mod_auth_* providers to determine user admin status. Such modules will need to have their is_admin methods ported to be a mod_authz_* provider. | ||||
* | core: Use prosody.hosts instead of _G.hosts for consistency | Kim Alvefur | 2018-03-29 | 1 | -1/+1 |
| | |||||
* | vairious: Add annotation when an empty environment is set [luacheck] | Kim Alvefur | 2018-02-28 | 1 | -0/+1 |
| | |||||
* | core.usermanager, various modules: Disconnect other resources on password ↵ | Kim Alvefur | 2017-07-28 | 1 | -2/+6 |
| | | | | change (thanks waqas) (fixes #512) | ||||
* | usermanager: Shortcircuit user existence check if they have existing sessions | Kim Alvefur | 2016-02-21 | 1 | -0/+1 |
| | |||||
* | core.usermanager: Return as soon as possible once admin status is known | Kim Alvefur | 2015-12-06 | 1 | -9/+6 |
| | |||||
* | core.*: Remove use of module() function | Kim Alvefur | 2015-02-21 | 1 | -14/+27 |
| | |||||
* | portmanager, s2smanager, sessionmanager, stanza_router, storagemanager, ↵ | Matthew Wild | 2015-05-06 | 1 | -1/+1 |
| | | | | usermanager, util.xml: Add luacheck annotations | ||||
* | usermanager: Capitalize log message | Kim Alvefur | 2015-04-25 | 1 | -1/+1 |
| | |||||
* | usermanager: Remove unused import of pairs() | Matthew Wild | 2013-08-13 | 1 | -1/+0 |
| | |||||
* | Remove all trailing whitespace | Florian Zeitz | 2013-08-09 | 1 | -5/+5 |
| | |||||
* | core.*: Complete removal of all traces of the "core" section and ↵ | Kim Alvefur | 2013-03-23 | 1 | -6/+6 |
| | | | | section-related code. | ||||
* | usermanager: Add support for iterating over accounts | Kim Alvefur | 2012-09-21 | 1 | -0/+4 |
| | |||||
* | storagemanager: Add purge() for purging user data from all backends in use | Kim Alvefur | 2012-09-16 | 1 | -1/+1 |
| | |||||
* | core.usermanager: Don't close sessions ourselves when deleting users. ↵ | Kim Alvefur | 2012-08-25 | 1 | -6/+1 |
| | | | | Instead, fire an event that modules can hook. | ||||
* | usermanager: Add method for deleting a user | Kim Alvefur | 2012-07-28 | 1 | -1/+11 |
| | |||||
* | usermanager: Pass session on to auth provider (missing half of commit ↵ | Matthew Wild | 2012-07-07 | 1 | -2/+2 |
| | | | | 0545a574667b) (thanks Zash) | ||||
* | usermanager: Add log error for use of COMPAT config option ↵ | Matthew Wild | 2012-04-28 | 1 | -1/+4 |
| | | | | 'anonymous_login'. To be removed in next version. | ||||
* | usermanager: Prep admin JIDs (fixes issue#276). | Waqas Hussain | 2011-12-14 | 1 | -2/+4 |
| | |||||
* | usermanager: Check host exists before trying to look up admins for it | Matthew Wild | 2011-04-05 | 1 | -0/+2 |
| | |||||
* | usermanager: Add delete_user method | Matthew Wild | 2011-01-04 | 1 | -0/+4 |
| | |||||
* | usermanager: Have methods not implemented in the active provider fall back ↵ | Matthew Wild | 2011-01-04 | 1 | -1/+3 |
| | | | | to the null provider (later we can add support for chains of providers) | ||||
* | usermanager: Change dummy provider method to return an error string also ↵ | Matthew Wild | 2011-01-04 | 1 | -2/+4 |
| | | | | (method not implemented) | ||||
* | usermanager: Assume authentication="anonymous" when anonymous_login=true. | Waqas Hussain | 2010-12-27 | 1 | -0/+2 |
| | |||||
* | usermanager: Fixed a possible traceback when is_admin() was used on a component. | Waqas Hussain | 2010-12-17 | 1 | -1/+1 |
| | |||||
* | usermanager: Removed redundant import of util.datamanager and util.hashes. | Waqas Hussain | 2010-12-10 | 1 | -3/+0 |
| | |||||
* | usermanager: Don't load auth modules for components. | Waqas Hussain | 2010-11-11 | 1 | -0/+2 |
| | |||||
* | modulemanager, usermanager: Removed hooks for the 'component-activated' ↵ | Waqas Hussain | 2010-11-10 | 1 | -1/+0 |
| | | | | event (components now fire 'host-activated'). | ||||
* | Monster whitespace commit (beware the whitespace monster). | Waqas Hussain | 2010-10-16 | 1 | -5/+5 |
| | |||||
* | usermanager: Get rid unused Cyrus SASL related code. | Waqas Hussain | 2010-08-23 | 1 | -4/+0 |
| | |||||
* | usermanager: Fix two nil global accesses | Matthew Wild | 2010-07-31 | 1 | -2/+2 |
| | |||||
* | usermanager, mod_auth_internal_hashed, mod_legacyauth: New order of ↵ | Matthew Wild | 2010-07-21 | 1 | -1/+1 |
| | | | | parameters for usermanager.test_password - username, host, password | ||||
* | usermanager: Return a non-nil SASL handler from the null auth provider ↵ | Waqas Hussain | 2010-07-14 | 1 | -1/+3 |
| | | | | (fixes a traceback). | ||||
* | mod_auth_internal, usermanager: Rename to mod_auth_internal_plain, and ↵ | Matthew Wild | 2010-07-08 | 1 | -1/+1 |
| | | | | update usermanager to still use it as the default | ||||
* | usermanager: Expose host_handler() as initialize_host() | Matthew Wild | 2010-06-29 | 1 | -3/+3 |
| | |||||
* | usermanager: is_admin: Resume the old role of determining precisely whether ↵ | Matthew Wild | 2010-06-22 | 1 | -9/+28 |
| | | | | a user is an admin for a given host (or a global admin) - auth providers checked for JIDs not listed in the config if they support it | ||||
* | usermanager: Handle checking for global admins on behalf of providers | Matthew Wild | 2010-06-09 | 1 | -4/+9 |
| | |||||
* | usermanager: Changed get_supported_methods to get_sasl_handler. | Waqas Hussain | 2010-06-07 | 1 | -2/+2 |
| | |||||
* | Rename mod_defaultauth -> mod_auth_internal, mod_hashpassauth -> ↵ | Matthew Wild | 2010-06-04 | 1 | -3/+9 |
| | | | | mod_auth_internal_hashed, and the providers to internal and internal_hashed respectively. Also no longer auto-load defaultauth, but instead auto-load the plugin selected for each host at startup based on the provider name. |