aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_auth_cyrus.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2011-02-23 01:22:04 +0500
committerWaqas Hussain <waqas20@gmail.com>2011-02-23 01:22:04 +0500
commit6f067417f20eb8b21c782d68932d78ab7cdf56ad (patch)
treee497c57312ef688abf47534a549e704a9fc47aad /plugins/mod_auth_cyrus.lua
parent731c29b5ac9ec0d3ff3e920863f60e05675dd62f (diff)
downloadprosody-6f067417f20eb8b21c782d68932d78ab7cdf56ad.tar.gz
prosody-6f067417f20eb8b21c782d68932d78ab7cdf56ad.zip
mod_auth_cyrus: Print some diagnostic log messages about the available mechanisms.
Diffstat (limited to 'plugins/mod_auth_cyrus.lua')
-rw-r--r--plugins/mod_auth_cyrus.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/mod_auth_cyrus.lua b/plugins/mod_auth_cyrus.lua
index ed3d5408..2a52c8b5 100644
--- a/plugins/mod_auth_cyrus.lua
+++ b/plugins/mod_auth_cyrus.lua
@@ -27,6 +27,19 @@ local new_sasl = function(realm)
);
end
+do -- diagnostic
+ local realm = module:get_option("sasl_realm") or module.host;
+ local list;
+ for mechanism in pairs(new_sasl(realm):mechanisms()) do
+ list = (not(list) and mechanism) or (list..", "..mechanism);
+ end
+ if not list then
+ module:log("error", "No Cyrus SASL mechanisms available");
+ else
+ module:log("debug", "Available Cyrus SASL mechanisms: %s", list);
+ end
+end
+
function new_default_provider(host)
local provider = { name = "cyrus" };
log("debug", "initializing default authentication provider for host '%s'", host);