aboutsummaryrefslogtreecommitdiffstats
path: root/spec
Commit message (Collapse)AuthorAgeFilesLines
...
* util.async: Add next-tick configurationMatthew Wild2021-11-291-0/+46
| | | | | | | | Running woken runners in the next iteration of the event loop prevents unexpected recursion, unexpected tracebacks, and is generally more predictable. The pattern is borrowed from util.promise, where we're now doing the same.
* util.async: Add sleep() method with configurable scheduling backendMatthew Wild2021-11-291-0/+54
| | | | | | | | | No scheduler set by default, so it will error (we plan to initialize it in util.startup). We wanted to avoid a hard dependency on util.timer (which in turn depends on network backends, etc.), and we didn't add timer.sleep() because we didn't want to add a hard dependency on util.async for things that don't need it.
* util.promise: Fix testKim Alvefur2021-11-261-1/+1
| | | | | Could not reproduce locally but it complained in CI that > spec/util_promise_spec.lua:676: Cannot spy on type 'nil', only on functions or callable elements
* util.promise: Support delayed promise executionKim Alvefur2019-01-051-0/+14
|
* util.human.io: Fix cutting of UTF-8 into piecesKim Alvefur2021-11-121-0/+19
| | | | Down the rabbit hole we go...
* util.dataforms: Ensure larger integers are serialized as suchKim Alvefur2021-10-281-0/+6
| | | | | | | Assumes that most number fields are integers, as most numeric types listed in XEP-0122 are, as are all such fields in Prosody as of this. Otherwise %g produces something like 1.1259e+15
* util.dataforms: Scope integer handling testsKim Alvefur2021-10-261-26/+29
| | | | | So they're separate from the datetime tests, and any future validation tests
* util.dataforms: Turn number values into timestamps for datetime fieldsKim Alvefur2021-10-261-1/+1
| | | | Makes it symmetric with parsing.
* util.dataforms: Coerce number values for boolean fieldsKim Alvefur2021-10-261-0/+10
| | | | | Makes more sense than coercing to a string, which would always be truthy.
* util.dataforms: Add support for datetime field types via XEP-0122Kim Alvefur2021-10-251-0/+14
|
* mod_pubsub,mod_pep: Advertise maximum number of items via XEP-0122Kim Alvefur2021-10-204-6/+6
| | | | | | Clients would generally be using the "max" symbol instead of discovering this, but this also gets us validation and earlier rejection of out of bounds values.
* mod_pubsub: Prevent max_items from being set to zeroKim Alvefur2021-10-204-6/+18
| | | | | | | Disable persistence instead if no items should be persisted. XEP-0060 is not entirely clear on what either of those option really mean.
* mod_pubsub,mod_pep: Implement 'send_last_published_item' option #1436Kim Alvefur2021-10-195-0/+206
| | | | | | | | Default left as 'never' in mod_pubsub to preserve the previous behavior. Unclear if this is desirable, but can always be changed later. In mod_pep this allows turning off the automatic resending of most recent item.
* util.argparse: Add test for #1691Kim Alvefur2021-10-121-0/+7
|
* util.argparse: TestsKim Alvefur2021-10-121-0/+46
|
* util.array: Add :slice() method + testsMatthew Wild2021-09-121-0/+19
| | | | Behaviour follows the same logic as string.sub (so yes, 1-indexed).
* util.stanza: Add :get_child_with_attr() + testsMatthew Wild2021-09-121-0/+20
|
* mod_pubsub: Add support for limiting result size #1608Kim Alvefur2021-09-051-0/+196
|
* util.pubsub: Add support for limiting number of items to retrieveKim Alvefur2021-09-051-0/+57
| | | | | Hopefully this will eventually be upgraded to RSM, which is why the argument is called 'resultspec' and is a table.
* mod_external_services: Validate required attributes on credentials requestsKim Alvefur2021-08-291-0/+14
|
* core.storagemanager: Respect archive ids issued by storage drivers in testsKim Alvefur2021-08-151-5/+6
| | | | | | Storage drivers may issue their own IDs tho none of the included ones do this atm, but the 3rd party module mod_storage_xmlarchive has its special format.
* Fix various spelling errors (thanks codespell)Kim Alvefur2021-07-272-2/+2
| | | | | Also special thanks to timeless, for wordlessly reminding me to check for typos.
* util.pubsub: Signal that 'persistent-items' is unsupported when disabledKim Alvefur2021-07-221-2/+2
| | | | | | XEP-0060 says that this the way to indicate that 'persistent-items' is unsupported, but doesn't explicitly say if it being disabled in the node configuration also counts as unsupported.
* util.pubsub: Fix behavior of persist_items disabledKim Alvefur2021-07-221-0/+19
| | | | | | | | | | | | | When set to 'false' there is no need for a persistence interface at all, since items are not persisted after being broadcast. Had started wondering if maybe the behavior was wrong, after reading parts of XEP-0060 that pointed in that direction. Some discussion of this can be found in logs of xmpp:xsf@muc.xmpp.org?join from around 2021-07-20 Thanks to Ralph for confirming.
* mod_pubsub: Explicitly enable persistence by default to preserve behaviorKim Alvefur2021-07-211-1/+1
| | | | | | Since nodes were always persistent according to the XEP-0060 definition. Whether data is stored in memory or on disk was not what this setting was meant for.
* scansion tests: Enable 'expose_publisher' since we test for itKim Alvefur2021-07-251-0/+1
|
* mod_pubsub: Fix inclusion of publisher (fixes #1399)Kim Alvefur2019-05-015-15/+15
|
* Merge 0.11->trunkKim Alvefur2021-07-231-57/+83
|\
| * MUC: Fix logic for access to affiliation lists0.11.10Kim Alvefur2021-07-221-57/+83
| | | | | | | | | | | | Fixes https://prosody.im/security/advisory_20210722/ Backs out 4d7b925652d9
* | scansion tests: Allow specifying network settings via environment variableKim Alvefur2021-07-111-2/+1
| | | | | | | | | | | | | | Allows testing e.g. opportunistic writes or other settings easily in CI or otherwise without editing the config file. make integration-test PROSODY_NETWORK_SETTINGS='{"opportunistic_writes":true}'
* | scansion tests: Allow specifying network backend via environment variableKim Alvefur2021-07-111-1/+1
| | | | | | | | | | | | | | To make it easier to test select and event without having to edit the config file, e.g. in CI. make integration-test PROSODY_NETWORK_BACKEND=event
* | util.format: Change formatting of nil values to avoid looking like XMLKim Alvefur2021-06-291-4/+4
| |
* | util.format: Escape ASCII control characters in outputKim Alvefur2021-06-151-0/+5
| | | | | | | | | | | | | | This should offer some protection against doing evil things to terminals. Doesn't protect against pure broken UTF-8 garbage however. See #734
* | util.dbuffer: Fix bugs, remove multi-char support (more complex than first ↵Matthew Wild2021-06-291-21/+0
| | | | | | | | | | | | | | | | | | thought) Character sequences could be split across chunk boundaries. Would require a bunch of code to make that work reliably. Only apply front_consumed on first chunk, and adjust buffer_pos accordingly.
* | util.dbuffer: Add read_until() methodMatthew Wild2021-06-291-0/+44
| |
* | mod_pubsub,mod_pep: Support "max" as 'pubsub#max_items'Kim Alvefur2021-06-094-5/+52
| | | | | | | | | | | | Fixes #1643 API change: The argument to archive_itemstore() changes type to integer
* | scansion: Really silence the certificates dir errorKim Alvefur2021-05-281-1/+1
| | | | | | | | certificate_s_, plural, is the directory setting
* | scansion: Silence an error from cert indexer due to missing certs dirKim Alvefur2021-05-271-1/+4
| |
* | core.modulemanager: Inherit mod_server_contact_info onto components #1270Kim Alvefur2021-05-271-1/+0
| |
* | mod_server_contact_info: Apply JID normalizationKim Alvefur2020-09-112-0/+27
| |
* | util.datamapper: Fix spelling in testsKim Alvefur2021-03-281-2/+2
| |
* | util.envload: Add basic test of envload()Kim Alvefur2021-03-261-0/+22
| |
* | util.datamapper: Revert one special attribute to longer formKim Alvefur2021-03-261-1/+1
| | | | | | | | Had a name, using attr() broke it.
* | util.datamapper: Use attribute convenience function throughoutKim Alvefur2021-03-261-3/+4
| |
* | util.promise: Switch order of parameters to join()Matthew Wild2021-03-251-2/+2
| | | | | | | | | | This saves awkward fiddlery with varargs and also echoes the signature of pcall/xpcall.
* | util.promise: all()/all_settled() pass through non-promise valuesMatthew Wild2021-03-251-0/+33
| |
* | util.promise: Add join() convenience methodMatthew Wild2021-03-251-0/+26
| | | | | | | | | | | | Usage: promise.join(p1, p2, function (result1, result2) [...] end)
* | util.promise: Add support for arbitrary keys in all()/all_settled()Matthew Wild2021-03-251-0/+37
| |
* | util.datamapper: Add test coverage of unwrapped arrays of objectsKim Alvefur2021-03-241-0/+14
| | | | | | | | | | Should the xml name/ns go on the array or the items schema? The later apparently.
* | util.datamapper: Deal with locally built stanzas missing xmlnsKim Alvefur2021-03-231-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So the problem is that xmlns is not inherited when building a stanza, and then :get_child(n, ns) with an explicit namespace does not find that such child tags. E.g. local t = st.stanza("foo", { xmlns = "urn:example:bar" }) :text_tag("hello", "world"); assert(t:get_child("hello", "urn:example:bar"), "This fails"); Meanwhile, during parsing (util.xmppstream or util.xml) child tags do get the parents xmlns when not overriding them. Thus, in the above example, if the stanza is passed trough `t = util.xml.parse(tostring(t))` then the assert succeeds. This change makes it so that it leaves out the namespace argument to :get_child when it is the same as the current/parent namespace, which behaves the same for both built and parsed stanzas.