Comparison

plugins/mod_saslauth.lua @ 10111:0f335815244f

plugins: Remove tostring call from logging Taken care of by loggingmanager now Mass-rewrite using lua pattern like `tostring%b()`
author Kim Alvefur <zash@zash.se>
date Tue, 30 Jul 2019 02:29:36 +0200
parent 9993:02a41315d275
child 10333:780905981542
comparison
equal deleted inserted replaced
10110:3fa3872588a8 10111:0f335815244f
12 local sm_bind_resource = require "core.sessionmanager".bind_resource; 12 local sm_bind_resource = require "core.sessionmanager".bind_resource;
13 local sm_make_authenticated = require "core.sessionmanager".make_authenticated; 13 local sm_make_authenticated = require "core.sessionmanager".make_authenticated;
14 local base64 = require "util.encodings".base64; 14 local base64 = require "util.encodings".base64;
15 15
16 local usermanager_get_sasl_handler = require "core.usermanager".get_sasl_handler; 16 local usermanager_get_sasl_handler = require "core.usermanager".get_sasl_handler;
17 local tostring = tostring;
18 17
19 local secure_auth_only = module:get_option_boolean("c2s_require_encryption", module:get_option_boolean("require_encryption", false)); 18 local secure_auth_only = module:get_option_boolean("c2s_require_encryption", module:get_option_boolean("require_encryption", false));
20 local allow_unencrypted_plain_auth = module:get_option_boolean("allow_unencrypted_plain_auth", false) 19 local allow_unencrypted_plain_auth = module:get_option_boolean("allow_unencrypted_plain_auth", false)
21 local insecure_mechanisms = module:get_option_set("insecure_sasl_mechanisms", allow_unencrypted_plain_auth and {} or {"PLAIN", "LOGIN"}); 20 local insecure_mechanisms = module:get_option_set("insecure_sasl_mechanisms", allow_unencrypted_plain_auth and {} or {"PLAIN", "LOGIN"});
22 local disabled_mechanisms = module:get_option_set("disable_sasl_mechanisms", { "DIGEST-MD5" }); 21 local disabled_mechanisms = module:get_option_set("disable_sasl_mechanisms", { "DIGEST-MD5" });
75 end 74 end
76 end 75 end
77 local status, ret, err_msg = session.sasl_handler:process(text); 76 local status, ret, err_msg = session.sasl_handler:process(text);
78 status, ret, err_msg = handle_status(session, status, ret, err_msg); 77 status, ret, err_msg = handle_status(session, status, ret, err_msg);
79 local s = build_reply(status, ret, err_msg); 78 local s = build_reply(status, ret, err_msg);
80 log("debug", "sasl reply: %s", tostring(s)); 79 log("debug", "sasl reply: %s", s);
81 session.send(s); 80 session.send(s);
82 return true; 81 return true;
83 end 82 end
84 83
85 module:hook_tag(xmlns_sasl, "success", function (session) 84 module:hook_tag(xmlns_sasl, "success", function (session)