Mercurial > prosody-hg
view spec/muc_util_spec.lua @ 14216:2ec517d8d43e
net.unbound: Enable DNSSEC by default with option for turning off
You know what they say about opt-in security.
Enabling DNSSEC in libunbound without a way to turn it off would likely
be a problem for those whose DNS resolvers do not support, or outright
block DNSSEC. The merge algorithm already in place here doesn't have a
way to unset something, so instead a simpler boolean setting is
introduced, similar to some existing ones like use_ipv6/4 and use_dane.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 07 Jun 2026 20:32:55 +0200 |
| parents | ad86b93093a3 |
| children |
line wrap: on
line source
local muc_util; local st = require "util.stanza"; do -- XXX Hack for lack of a mock moduleapi local env = setmetatable({ module = { _shared = {}; -- Close enough to the real module:shared() for our purposes here shared = function (self, name) local t = self._shared[name]; if t == nil then t = {}; self._shared[name] = t; end return t; end; } }, { __index = _ENV or _G }); muc_util = require "util.envload".envloadfile("plugins/muc/util.lib.lua", env)(); end describe("muc/util", function () describe("filter_muc_x()", function () it("correctly filters muc#user", function () local stanza = st.message({ to = "to", from = "from", id = "foo" }) :tag("x", { xmlns = "http://jabber.org/protocol/muc#user" }) :tag("invite", { to = "user@example.com" }); assert.equal(1, #stanza.tags); assert.equal(stanza, muc_util.filter_muc_x(stanza)); assert.equal(0, #stanza.tags); end); it("correctly filters muc#user on a cloned stanza", function () local stanza = st.message({ to = "to", from = "from", id = "foo" }) :tag("x", { xmlns = "http://jabber.org/protocol/muc#user" }) :tag("invite", { to = "user@example.com" }); assert.equal(1, #stanza.tags); local filtered = muc_util.filter_muc_x(st.clone(stanza)); assert.equal(1, #stanza.tags); assert.equal(0, #filtered.tags); end); end); end);
