Software /
code /
prosody
Diff
util/sasl.lua @ 6791:e813e8cf6046
Merge 0.10->trunk
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 20 Aug 2015 13:05:22 +0200 |
parent | 6777:5de6b93d0190 |
child | 8382:e5d00bf4a4d5 |
line wrap: on
line diff
--- a/util/sasl.lua Mon Aug 17 01:58:53 2015 +0200 +++ b/util/sasl.lua Thu Aug 20 13:05:22 2015 +0200 @@ -19,7 +19,7 @@ local assert = assert; local require = require; -module "sasl" +local _ENV = nil; --[[ Authentication Backend Prototypes: @@ -47,7 +47,7 @@ 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 @@ 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.scram" .init(registerMechanism); require "util.sasl.external" .init(registerMechanism); -return _M; +return { + registerMechanism = registerMechanism; + new = new; +};