Comparison

util/sasl/external.lua @ 6777:5de6b93d0190

util.*: Remove use of module() function, make all module functions local and return them in a table at the end
author Kim Alvefur <zash@zash.se>
date Sat, 21 Feb 2015 10:36:37 +0100
parent 5687:e879b53e9df8
child 8555:4f0f5b49bb03
comparison
equal deleted inserted replaced
6774:3965662ae091 6777:5de6b93d0190
1 local saslprep = require "util.encodings".stringprep.saslprep; 1 local saslprep = require "util.encodings".stringprep.saslprep;
2 2
3 module "sasl.external" 3 local _ENV = nil;
4 4
5 local function external(self, message) 5 local function external(self, message)
6 message = saslprep(message); 6 message = saslprep(message);
7 local state 7 local state
8 self.username, state = self.profile.external(message); 8 self.username, state = self.profile.external(message);
16 end 16 end
17 17
18 return "success"; 18 return "success";
19 end 19 end
20 20
21 function init(registerMechanism) 21 local function init(registerMechanism)
22 registerMechanism("EXTERNAL", {"external"}, external); 22 registerMechanism("EXTERNAL", {"external"}, external);
23 end 23 end
24 24
25 return _M; 25 return {
26 init = init;
27 }