aboutsummaryrefslogtreecommitdiffstats
path: root/util/sasl.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-02-21 10:36:37 +0100
committerKim Alvefur <zash@zash.se>2015-02-21 10:36:37 +0100
commiteaa823a5971bfd2e9cb38dd8f30fefee2da95c2e (patch)
treef7609b77dfead0a8d6994597c5799196676080bd /util/sasl.lua
parentb49513cdeb2bb123625fb87f53a04d42b7eb6fb2 (diff)
downloadprosody-eaa823a5971bfd2e9cb38dd8f30fefee2da95c2e.tar.gz
prosody-eaa823a5971bfd2e9cb38dd8f30fefee2da95c2e.zip
util.*: Remove use of module() function, make all module functions local and return them in a table at the end
Diffstat (limited to 'util/sasl.lua')
-rw-r--r--util/sasl.lua11
1 files changed, 7 insertions, 4 deletions
diff --git a/util/sasl.lua b/util/sasl.lua
index b91e29a6..5845f34a 100644
--- a/util/sasl.lua
+++ b/util/sasl.lua
@@ -19,7 +19,7 @@ local setmetatable = setmetatable;
local assert = assert;
local require = require;
-module "sasl"
+local _ENV = nil;
--[[
Authentication Backend Prototypes:
@@ -47,7 +47,7 @@ local backend_mechanism = {};
local mechanism_channelbindings = {};
-- register a new SASL mechanims
-function registerMechanism(name, backends, f, cb_backends)
+local function registerMechanism(name, backends, f, cb_backends)
assert(type(name) == "string", "Parameter name MUST be a string.");
assert(type(backends) == "string" or type(backends) == "table", "Parameter backends MUST be either a string or a table.");
assert(type(f) == "function", "Parameter f MUST be a function.");
@@ -66,7 +66,7 @@ function registerMechanism(name, backends, f, cb_backends)
end
-- create a new SASL object which can be used to authenticate clients
-function new(realm, profile)
+local function new(realm, profile)
local mechanisms = profile.mechanisms;
if not mechanisms then
mechanisms = {};
@@ -138,4 +138,7 @@ require "util.sasl.anonymous" .init(registerMechanism);
require "util.sasl.scram" .init(registerMechanism);
require "util.sasl.external" .init(registerMechanism);
-return _M;
+return {
+ registerMechanism = registerMechanism;
+ new = new;
+};