aboutsummaryrefslogtreecommitdiffstats
path: root/util
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | doap: Update XEP versions for which no code changes appear neededKim Alvefur2022-08-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | XEP-0004: Partial forms are handled XEP-0045: We're already strict with GC 1.0 XEP-0060: Change in semantics wrt 'pubsub#type', but not in code XEP-0115: No protocol change XEP-0138: Specification moved to Obsolete XEP-0163: Editorial only change XEP-0215: Minor schema change XEP-0280: Editorial change XEP-0297: Had the wrong version number XEP-0106: Note missing piece for version 1.1 XEP-0313: Editorial change XEP-0363: Editorial clarification, no code change required XEP-0380: Registry additions, no code change needed XEP-0384: Not directly supported, only here because people will ask otherwise XEP-0445: Broken out of XEP-0401
| * | | | | various: Update IETF RFC URLs for tools.ietf.org transitionKim Alvefur2022-08-051-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See https://www.ietf.org/blog/finalizing-ietf-tools-transition/ Already done in various other places.
| * | | | | util.sasl.scram: Add 'tls-exporter' as recognised channel binding methodKim Alvefur2022-07-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The last missing piece of #1760, otherwise SCRAM-SHA-*-PLUS is not actually advertised.
| * | | | | compat: Use table.pack (there since Lua 5.2) over our util.tableKim Alvefur2022-07-113-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added in d278a770eddc avoid having to deal with its absence in Lua 5.1. No longer needed when Lua 5.1 support is dropped.
| * | | | | compat: Remove handling of Lua 5.1 location of 'unpack' functionKim Alvefur2022-07-117-7/+7
| | | | | |
| * | | | | Merge 0.12->trunkKim Alvefur2022-07-082-145/+168
| |\ \ \ \ \
| * | | | | | util.envload: Remove Lua 5.1 methodKim Alvefur2022-07-051-29/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Part of #1600 Is this module even needed anymore?
| * | | | | | util: Remove various Lua 5.1 compatibility hacksKim Alvefur2022-07-025-31/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Part of #1600
| * | | | | | util.dependencies: Reject Lua 5.1, Lua 5.2 or later is now required (see #1600)Kim Alvefur2022-07-021-2/+2
| | | | | | |
| * | | | | | util.dependencies: Deprecate support for Lua 5.1, this is your final warningKim Alvefur2022-06-301-1/+1
| | | | | | |
| * | | | | | util.hashes: Bind BLAKE2 algoritms supported by OpenSSLKim Alvefur2020-09-101-0/+2
| | | | | | |
| * | | | | | util.hashes: Expose sha224 and sha384 HMAC functionsKim Alvefur2020-11-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For completeness and consistency with set of plain hash functions
| * | | | | | Merge 0.12->trunkKim Alvefur2022-06-141-1/+5
| |\ \ \ \ \ \
| * | | | | | | util.watchdog: Allow passing a new timeout to :reset()Matthew Wild2022-06-111-1/+4
| | | | | | | |
| * | | | | | | util.watchdog: Allow :reset() to restart a cancelled watchdogMatthew Wild2022-06-111-5/+6
| | | | | | | |
| * | | | | | | util.watchdog: Update to use "new" util.timer APIMatthew Wild2022-06-111-13/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When this module was written, it wasn't possible to cancel or reschedule a timer. Times have changed, and we should take advantage of those new methods. This module becomes a very thin wrapper around util.timer now, but I'd argue it's still a very common and useful concept/abstraction to have around. Possible API change: this removes the 'last_reset' field of the watchdog. This was never really intended as a public thing, and I can't find any code that uses it, so I consider removal to be safe.
| * | | | | | | util.prosodyctl.shell: Print errors in red to highlight themKim Alvefur2022-06-011-1/+8
| | | | | | | |
| * | | | | | | util.openmetrics: Set __name field on metatables to improve error messagesKim Alvefur2022-05-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't think we cause any such errors right now, but you never know!
| * | | | | | | util.openmetrics: Set (previously unused, empty) metatableKim Alvefur2022-05-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Silences luacheck warning about the metatable being unused.
| * | | | | | | util.vcard: Delete since nothing uses itKim Alvefur2022-05-301-574/+0
| | | | | | | |
| * | | | | | | prosodyctl shell: Communicate width of terminal to mod_admin_shellKim Alvefur2022-05-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This lets it adjust the width of tables to the actual terminal width.
| * | | | | | | Merge 0.12->trunkKim Alvefur2022-05-261-4/+0
| |\ \ \ \ \ \ \
| * \ \ \ \ \ \ \ Merge 0.12->trunkKim Alvefur2022-05-092-2/+9
| |\ \ \ \ \ \ \ \
| * \ \ \ \ \ \ \ \ Merge 0.12->trunkKim Alvefur2022-05-081-1/+1
| |\ \ \ \ \ \ \ \ \
| * \ \ \ \ \ \ \ \ \ Merge 0.12->trunkKim Alvefur2022-05-051-0/+1
| |\ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | net: refactor sslconfig to not depend on LuaSecJonas Schäfer2022-04-021-16/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This now requires that the network backend exposes a tls_builder function, which essentially wraps the former util.sslconfig.new() function, passing a factory to create the eventual SSL context. That allows a net.server backend to pick whatever it likes as SSL context factory, as long as it understands the config table passed by the SSL config builder. Heck, a backend could even mock and replace the entire SSL config builder API.
| * | | | | | | | | | | net: isolate LuaSec-specificsJonas Schäfer2022-04-271-1/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For this, various accessor functions are now provided directly on the sockets, which reach down into the LuaSec implementation to obtain the information. While this may seem of little gain at first, it hides the implementation detail of the LuaSec+LuaSocket combination that the actual socket and the TLS layer are separate objects. The net gain here is that an alternative implementation does not have to emulate that specific implementation detail and "only" has to expose LuaSec-compatible data structures on the new functions.
| * | | | | | | | | | | Merge 0.12->trunkMatthew Wild2022-04-251-2/+5
| |\ \ \ \ \ \ \ \ \ \ \
| * \ \ \ \ \ \ \ \ \ \ \ Merge 0.12->trunkMatthew Wild2022-04-251-2/+2
| |\ \ \ \ \ \ \ \ \ \ \ \
| * \ \ \ \ \ \ \ \ \ \ \ \ Merge 0.12->trunkMatthew Wild2022-04-131-2/+2
| |\ \ \ \ \ \ \ \ \ \ \ \ \
| * \ \ \ \ \ \ \ \ \ \ \ \ \ Merge 0.12->trunkKim Alvefur2022-04-021-1/+1
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ Merge 0.12->trunkMatthew Wild2022-03-281-0/+7
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Merge 0.12->trunkMatthew Wild2022-03-211-6/+13
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Merge 0.12->trunkMatthew Wild2022-03-191-0/+6
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Merge 0.12->trunkMatthew Wild2022-03-192-6/+21
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | | | | | | | | | util.stanza: Create tables with correct size to avoid reallocationsKim Alvefur2022-03-181-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Potential performance gain since the tables don't need to be resized as they grow to the final size.
| * | | | | | | | | | | | | | | | | | | util.stanza: Use table.move in cloneKim Alvefur2022-03-181-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Code reduction, potentially a performance gain.
| * | | | | | | | | | | | | | | | | | | util.array: Take advantage of table.move()Matthew Wild2022-03-181-10/+6
| | | | | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | | | | util.prosodyctl.shell: Support for receiving partial lines (no automatic \n)Matthew Wild2022-03-171-2/+6
| | | | | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | | | | util.logger: Return sink_function from add_simple_sink()Matthew Wild2022-03-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows a simple sink to be later removed via remove_sink()
| * | | | | | | | | | | | | | | | | | | util.logger: Support for removing individual log sinks without a full resetMatthew Wild2022-03-171-0/+15
| | | | | | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | | | | | Merge 0.11->0.120.12.2Kim Alvefur2022-12-121-1/+5
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | | | | util.stanza: Allow U+7F0.11.14Kim Alvefur2022-11-221-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allowed by XML despite arguably being a control character. Drops the part of the range meant to rule out octets invalid in UTF-8 (\247 starts a 4-byte sequence), since UTF-8 correctness is validated by util.encodings.utf8.valid().
* | | | | | | | | | | | | | | | | | | | util.json: Accept empty arrays with whitespace (fixes #1782)Matthew Wild2022-11-041-5/+14
| |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | | | | util.startup: Ensure import() is available in prosodyctl (thanks keyzer)Kim Alvefur2022-10-201-1/+1
| |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes error in mod_authz_internal due to import() being unavailable as it was only loaded in Prosody proper
* | | | | | | | | | | | | | | | | | util.jsonschema: Use same integer/float logic on Lua 5.2 and 5.3Kim Alvefur2022-10-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes test case type.json:0:1 covering treatment of 1.0 as an integer according to the JSON definition
* | | | | | | | | | | | | | | | | | util.jsonschema: Fix Lua 5.2 integer compatKim Alvefur2022-10-091-1/+1
| |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | math.type() is unavailable before Lua 5.3 so this should use the compat function added at the top
* | | | | | | | | | | | | | | | | util.stanza: Return nil instead of nothing (fix test with luassert >=1.9)Kim Alvefur2022-09-151-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to a change in luassert, a dependency luassert of the Busted test framework, returning nothing is no longer treated as not falsy.
* | | | | | | | | | | | | | | | | luacheck: Shut up (backports 3caff1f93520, ignores module deleted in trunk)Kim Alvefur2022-05-301-2/+2
| |_|_|_|_|_|_|_|_|_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | util.datamapper: Improve handling of schemas with non-obvious "type"Kim Alvefur2022-07-081-10/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The JSON Schema specification says that schemas are objects or booleans, and that the 'type' property is optional and can be an array. This module previously allowed bare type names as schemas and did not really handle booleans. It now handles missing 'type' properties and boolean 'true' as a schema. Objects and arrays are guessed based on the presence of 'properties' or 'items' field.