aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* teal-src: Add a README with a few pointers to get startedKim Alvefur2023-03-281-0/+29
|
* teal-src: Add keyval+ store typeMatthew Wild2023-03-281-0/+1
|
* mod_tokenauth: Fix storage API mistake in revocationKim Alvefur2023-03-281-1/+1
|
* mod_tokenauth: Fix traceback when checking expiry of tokens with no expiryMatthew Wild2023-03-271-1/+2
|
* mod_tokenauth: Refactor API to separate tokens and grantsMatthew Wild2023-03-271-115/+92
| | | | | | | This is another iteration on top of the previous sub-tokens work. Essentially, the concept of a "parent token" has been replaced with the concept of a "grant" to which all tokens now belong. The grant does not have any tokens when first created, but the create_token() call can add them.
* mod_tokenauth: Support for creating sub-tokensMatthew Wild2023-03-261-22/+110
| | | | | | | | | | | | | | | | Properties of sub-tokens: - They share the same id as their parent token - Sub-tokens may not have their own sub-tokens (but may have sibling tokens) - They always have the same or shorter lifetime compared to their parent token - Revoking a parent token revokes all sub-tokens - Sub-tokens always have the same JID as the parent token - They do not have their own 'accessed' property - accessing a sub-token updates the parent token's accessed time Although this is a generic API, it is designed to at least fill the needs of OAuth2 refresh + access tokens (where the parent token is the refresh token and the sub-tokens are access tokens).
* mod_tokenauth: return error if storage of new token failsMatthew Wild2023-03-261-1/+4
|
* moduleapi: Add 'peek' to :may() and new :could() helper to suppress loggingMatthew Wild2023-03-261-7/+19
| | | | | | | | | | | | | The current method logs scary "access denied" messages on failure - this is generally very useful when debugging access control stuff, but in some cases the call is simply a check to see if someone *could* perform an action, even if they haven't requested it yet. One example is determining whether to show the user as an admin in disco. The 'peek' parameter, if true, will suppress such logging. The :could() method is just a simple helper that can make the calling code a bit more readable (suggested by Zash).
* moduleapi: may: Fail early if a local session has no role assignedMatthew Wild2023-03-251-3/+8
| | | | | | | We expect every session to explicitly have a role assigned. Falling back to any kind of "default" role (even the user's default role) in the absence of an explicit role could open up the possibility of accidental privilege escalation.
* core.usermanager: Correct formatting of not implemented errorKim Alvefur2023-03-262-5/+5
| | | | Spaces, no hyphen, apparently.
* mod_admin_shell: Enable user after creation with roleKim Alvefur2023-03-261-0/+5
| | | | | Fixes that otherwise the user was created in a disabled state and left as such.
* mod_admin_shell: Simplify user creation when no role givenKim Alvefur2023-03-261-8/+16
| | | | | | Idea here is to prevent a user from being created with the default role if a different role was given, but that dance wouldn't be needed if no role is provided.
* util.jsonschema: Reorder type definition by specification, sectionKim Alvefur2023-03-261-14/+37
| | | | Also some comment headers and missing properties
* util.jsonschema: Implement 'dependentSchemas'Kim Alvefur2023-03-263-1/+18
| | | | | If this object key exists then this schema must validate against the current object. Seems useful.
* util.jsonschema: Implement 'dependentRequired'Kim Alvefur2023-03-263-1/+24
| | | | If this field exists, then these fields must also exist.
* util.roles: Implement a serialization preparation metamethodKim Alvefur2023-03-261-0/+13
| | | | | | Should be able to roundtrip trough serialization. Also nice for debug and logging purposes where you might want more details than what the __tostring method provides.
* util.set: Add a serialization preparation metamethodKim Alvefur2023-03-261-0/+9
| | | | | | Enables util.serialization to turn Sets into a representation that can be deserialized with an environment trick, i.e. `set{"a","b"}`. Also useful for debug purposes.
* util.format: Update tests for serialization changesKim Alvefur2023-03-261-5/+5
|
* util.format: Restore "freeze" serialization behavior in loggingKim Alvefur2023-03-261-0/+1
| | | | | | This was implied with the "debug" preset and does nice things like turn util.set objects into "set{a,b,c}" instead of the quite verbose thing you get otherwise.
* util.format: Tweak serialization of %q formatted entriesKim Alvefur2023-03-261-1/+8
| | | | | | | Improves serialization of function references especially, the built-in default handling of that in util.serialization is not the most informative. Now, along with the function metatable from util.startup, the actual function can be found by filename and line number.
* util.startup: Tweak function string representationKim Alvefur2023-03-261-1/+1
| | | | | Mostly in order to avoid triggering the XML syntax highlighting in the console logger.
* mod_server_contact_info: Reorder dataform keys for more aligned viewKim Alvefur2023-03-241-9/+10
|
* mod_tokenauth: Track last access time (last time a token was used)Matthew Wild2023-03-241-3/+15
|
* teal: Move into prosody namespaceKim Alvefur2023-03-2361-20/+20
|
* CHANGES: The Great Rename-ning completed! #1223Kim Alvefur2023-03-171-0/+1
|
* plugins: Prefix module imports with prosody namespaceKim Alvefur2023-03-24100-503/+503
|
* util: Add compat for prosody module name change to C sourcesKim Alvefur2023-03-1714-14/+64
|
* util: Prefix module imports with prosody namespaceKim Alvefur2023-03-1768-246/+246
|
* net: Prefix module imports with prosody namespaceKim Alvefur2023-03-1720-108/+108
|
* tests: Make tests work with new namespace prefixKim Alvefur2023-03-171-2/+2
|
* core: Prefix module imports with prosody namespaceKim Alvefur2023-03-1715-103/+103
|
* executables: Prefix module imports with prosody namespaceKim Alvefur2023-03-172-21/+21
|
* mod_debug_reset: Remove unused importMatthew Wild2023-03-231-1/+0
|
* scansion: Enable mod_debug_reset during testsMatthew Wild2023-03-231-0/+3
|
* mod_debug_reset: New module to "reset" a running server (e.g. for testing)Matthew Wild2023-03-231-0/+41
| | | | Plan to use this for integration tests.
* scansion: vcard_temp: Ensure at least one connection is open throughout testMatthew Wild2023-03-231-2/+2
| | | | | | | I plan to introduce logic to "reset" the server between individual tests, which is currently triggered by the lack of any connections. This is the only test that has a point where no clients are connected, and it's not necessary, so I changed it to keep the connection open for the duration of the test.
* scansion: Fix tests failing after addition of pubsub#itemreply config fieldMatthew Wild2023-03-234-0/+51
| | | | This is a newly added field, and we expect to see it in these places now.
* scansion: Fix tests failing due to lack of 'publisher'Matthew Wild2023-03-231-1/+1
| | | | | publisher is no longer included by default in broadcasts, but configured via pubsub#itemreply instead.
* scansion: Add tests for pubsub#itemreply in PEPMatthew Wild2023-03-221-0/+205
|
* scansion: PEP notifications no longer carry 'publisher' by defaultMatthew Wild2023-03-221-3/+3
| | | | | | | | | | | | | Previous behaviour: - publisher was always included in PEP notifications - publisher was never included in get_items requests New behaviour: - publisher is included in both notifications and retrieval if itemreply == publisher - publisher is not ever included if itemreply ~= publisher
* mod_pep: Pass node/service objects to broadcaster when resending last itemMatthew Wild2023-03-221-1/+1
| | | | | | This gives the broadcaster access to the node configuration, which is now important for itemreply. It probably also fixes a bug with the notify_* node config options?
* mod_pubsub/pubsub.lib: Fix accidental name/var swap (thanks scansion)Matthew Wild2023-03-221-2/+2
|
* mod_pubsub, mod_pep: Support per-node configurable inclusion of publisherMatthew Wild2023-03-223-4/+36
| | | | | | | | | | | | | | | | | This matches ejabberd's behaviour, using the 'pubsub#itemreply' config option. Although the current definition of this option in the specification is not as clear as it could be, I think matching what existing deployments do is the best option to resolve the ambiguity and reduce fragmentation. We should update the spec to be clearer about how to use and interpret this option. The 'expose_publisher' option for mod_pubsub is now an override (always expose or never expose). If unset, it will use the per-node config (which defaults to not exposing). Thanks to Link Mauve, edhelas and goffi for sparking this feature.
* mod_tokenauth: Fix traceback in get_token_session()Kim Alvefur2023-03-211-2/+2
| | | | | | | Errors in sha256 becasue `token_secret` is nil since it was not passed to _get_validated_token_info(). Looks like a simple oversight in ebe3b2f96cad
* CHANGES: Add keyval+Matthew Wild2023-03-211-0/+4
|
* features: Add "keyval+"Matthew Wild2023-03-211-0/+2
|
* storagemanager: Add keyval+ (combined keyval + map) store typeMatthew Wild2022-09-272-0/+203
| | | | | | | | This combines the two most common store types, which modules often end up opening with both interfaces separately anyway. As well as combining them, I've taken the opportunity to improve some of the method names to make them clearer.
* core.features: Add feature for prosody.loaderKim Alvefur2023-03-181-0/+2
| | | | Allows modules explicit dependencies upon its availability
* executables: Invoke loader to allow mixing of old and new import styleKim Alvefur2023-03-172-0/+8
| | | | | Now both require"util.foo" and require"prosody.util.foo" should be equivalent.
* mod_tokenauth: Switch to new token format (invalidates existing tokens!)Matthew Wild2023-03-211-14/+35
| | | | | | | | | | | | | | The new format has the following properties: - 5 bytes longer than the previous format - The token now has separate 'id' and 'secret' parts - the token itself is no longer stored in the DB, and the secret part is hashed - The only variable length field (JID) has been moved to the end - The 'secret-token:' prefix (RFC 8959) is now included Compatibility with the old token format was not maintained, and all previously issued tokens are invalid after this commit (they will be removed from the DB if used).