Annotate

mod_alias/mod_alias.lua @ 6251:694f8fab07d4

: mod_sasl2*** : Update Compability for all of them diff --git a/mod_sasl2/README.md b/mod_sasl2/README.md --- a/mod_sasl2/README.md +++ b/mod_sasl2/README.md @@ -31,6 +31,7 @@ This module requires Prosody **trunk** a Prosody Version Status ----------------------- ---------------- - trunk as of 2024-11-24 Works + trunk as of 2025-05-25 Works + 0.13 Works 0.12 Does not work ----------------------- ---------------- diff --git a/mod_sasl2_bind2/README.md b/mod_sasl2_bind2/README.md --- a/mod_sasl2_bind2/README.md +++ b/mod_sasl2_bind2/README.md @@ -16,5 +16,6 @@ This module depends on [mod_sasl2]. It e Prosody-Version Status --------------- ---------------------- - trunk Works as of 2024-12-21 + trunk Works as of 2025-05-25 + 0.13 Works 0.12 Does not work diff --git a/mod_sasl2_fast/README.md b/mod_sasl2_fast/README.md --- a/mod_sasl2_fast/README.md +++ b/mod_sasl2_fast/README.md @@ -33,5 +33,6 @@ clients being logged out unexpectedly. Prosody-Version Status --------------- ---------------------- - trunk Works as of 2024-12-21 + trunk Works as of 2025-05-25 + 0.13 Work 0.12 Does not work diff --git a/mod_sasl2_sm/README.md b/mod_sasl2_sm/README.md --- a/mod_sasl2_sm/README.md +++ b/mod_sasl2_sm/README.md @@ -17,5 +17,6 @@ configuration options. Prosody-Version Status --------------- ---------------------- - trunk Works as of 2024-12-21 + trunk Works as of 2025-05-25 + 0.13 Work 0.12 Does not work diff --git a/mod_sasl_ssdp/README.md b/mod_sasl_ssdp/README.md --- a/mod_sasl_ssdp/README.md +++ b/mod_sasl_ssdp/README.md @@ -18,8 +18,8 @@ There are no configuration options for t # Compatibility -For SASL2 (XEP-0388) clients, it is compatible with the mod_sasl2 community module. - -For clients using RFC 6120 SASL, it requires Prosody trunk 33e5edbd6a4a or -later. It is not compatible with Prosody 0.12 (it will load, but simply -won't do anything) for "legacy SASL". + Prosody-Version Status + --------------- ---------------------- + trunk Works as of 2025-05-25 + 0.13 Works + 0.12 Does not work
author Menel <menel@snikket.de>
date Mon, 12 May 2025 11:07:45 +0200
parent 2887:65082d91950e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1953
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
1 -- Copyright (C) 2015 Travis Burtrum
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
2 -- This file is MIT/X11 licensed.
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
3
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
4 -- set like so in prosody config, works on full or bare jids, or hosts:
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
5 --aliases = {
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
6 -- ["old@example.net"] = "new@example.net";
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
7 -- ["you@example.com"] = "you@example.net";
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
8 -- ["conference.example.com"] = "conference.example.net";
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
9 --}
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
10
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
11 local aliases = module:get_option("aliases", {});
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
12 local alias_response = module:get_option("alias_response", "User $alias can be contacted at $target");
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
13
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
14 local st = require "util.stanza";
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
15
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
16 function handle_alias(event)
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
17
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
18 if event.stanza.attr.type ~= "error" then
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
19 local alias = event.stanza.attr.to;
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
20 local target = aliases[alias];
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
21 if target then
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
22 local replacements = {
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
23 alias = alias,
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
24 target = target
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
25 };
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
26 local error_message = alias_response:gsub("%$([%w_]+)", function (v)
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
27 return replacements[v] or nil;
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
28 end);
2887
65082d91950e Many modules: Simplify st.message(…):tag("body"):text(…):up() into st.message(…, …)
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 1953
diff changeset
29 local message = st.message({ type = "chat", from = alias, to = event.stanza.attr.from }, error_message);
1953
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
30 module:send(message);
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
31 return event.origin.send(st.error_reply(event.stanza, "cancel", "gone", error_message));
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
32 end
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
33 end
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
34
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
35 end
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
36
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
37 module:hook("message/bare", handle_alias, 300);
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
38 module:hook("message/full", handle_alias, 300);
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
39 module:hook("message/host", handle_alias, 300);
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
40
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
41 module:hook("presence/bare", handle_alias, 300);
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
42 module:hook("presence/full", handle_alias, 300);
0c3ba5ff7a3b mod_alias: New alias module
moparisthebest <admin@moparisthebest.com>
parents:
diff changeset
43 module:hook("presence/host", handle_alias, 300);