annotate mod_s2soutinjection/mod_s2soutinjection.lua @ 6319:04c3273cb81f

mod_auth_cyrus: Add empty 'profile' table to SASL handler objects This is for compatibility with Prosody's built-in util.sasl objects. A SASL profile table usually includes methods supported by the backend, which can be used by SASL mechanism handlers to perform operations (such as testing the password). It also optionally contains a 'cb' field with channel binding method handlers. The Cyrus backend doesn't support channel binding, and doesn't have the same concept of auth backend methods (it handles all that internally, and Prosody has no insight or control over it). Thus, we create an empty profile which informs Prosody that the SASL handler does not support any of the auth or channel binding methods. Some features will not work, but they didn't work anyway. This just makes it explicit. This fixes a traceback in mod_sasl2_fast, which expected SASL handlers to always contain a 'profile' field.
author Matthew Wild <mwild1@gmail.com>
date Thu, 04 Sep 2025 10:14:46 +0100
parents 4cc3d3de74a7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6313
4cc3d3de74a7 mod_s2soutinjection: Update to override resolver for 13.0 compatibility
Kim Alvefur <zash@zash.se>
parents: 5103
diff changeset
1 --% requires: s2sout-pre-connect-event
4931
f4a9e804c457 mod_s2soutinjection: Rewrite based on mod_onions for 0.12 compat (thanks Zash)
moparisthebest <admin@moparisthebest.com>
parents: 4557
diff changeset
2
6313
4cc3d3de74a7 mod_s2soutinjection: Update to override resolver for 13.0 compatibility
Kim Alvefur <zash@zash.se>
parents: 5103
diff changeset
3 local basic_resolver = require "net.resolvers.basic";
1089
4057f176be7b mod_s2soutinjection: Initial commit, variant of mod_srvinjection using 0.9+ APIs
Kim Alvefur <zash@zash.se>
parents:
diff changeset
4
4057f176be7b mod_s2soutinjection: Initial commit, variant of mod_srvinjection using 0.9+ APIs
Kim Alvefur <zash@zash.se>
parents:
diff changeset
5 local injected = module:get_option("s2s_connect_overrides");
4057f176be7b mod_s2soutinjection: Initial commit, variant of mod_srvinjection using 0.9+ APIs
Kim Alvefur <zash@zash.se>
parents:
diff changeset
6
6313
4cc3d3de74a7 mod_s2soutinjection: Update to override resolver for 13.0 compatibility
Kim Alvefur <zash@zash.se>
parents: 5103
diff changeset
7 module:hook("s2sout-pre-connect", function (event)
4cc3d3de74a7 mod_s2soutinjection: Update to override resolver for 13.0 compatibility
Kim Alvefur <zash@zash.se>
parents: 5103
diff changeset
8 local session = event.session;
4cc3d3de74a7 mod_s2soutinjection: Update to override resolver for 13.0 compatibility
Kim Alvefur <zash@zash.se>
parents: 5103
diff changeset
9 local to_host = session.to_host;
1089
4057f176be7b mod_s2soutinjection: Initial commit, variant of mod_srvinjection using 0.9+ APIs
Kim Alvefur <zash@zash.se>
parents:
diff changeset
10 local inject = injected and injected[to_host];
4057f176be7b mod_s2soutinjection: Initial commit, variant of mod_srvinjection using 0.9+ APIs
Kim Alvefur <zash@zash.se>
parents:
diff changeset
11 if not inject then return end
4057f176be7b mod_s2soutinjection: Initial commit, variant of mod_srvinjection using 0.9+ APIs
Kim Alvefur <zash@zash.se>
parents:
diff changeset
12
4931
f4a9e804c457 mod_s2soutinjection: Rewrite based on mod_onions for 0.12 compat (thanks Zash)
moparisthebest <admin@moparisthebest.com>
parents: 4557
diff changeset
13 local host, port = inject[1] or inject, tonumber(inject[2]) or 5269;
6313
4cc3d3de74a7 mod_s2soutinjection: Update to override resolver for 13.0 compatibility
Kim Alvefur <zash@zash.se>
parents: 5103
diff changeset
14 event.resolver = basic_resolver.new(host, port, "tcp");
4cc3d3de74a7 mod_s2soutinjection: Update to override resolver for 13.0 compatibility
Kim Alvefur <zash@zash.se>
parents: 5103
diff changeset
15 end);