aboutsummaryrefslogtreecommitdiffstats
path: root/util/sasl.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-08-02 18:47:33 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-08-02 18:47:33 +0500
commitf502e55ef5b4d44ea5ca8c6f8d6d483a67cdfbcb (patch)
tree87f61e8ab45167e4701895370831b4b0575518ff /util/sasl.lua
parent714eb9da1b5b5018aa31274d4e65e03a61d40cdc (diff)
downloadprosody-f502e55ef5b4d44ea5ca8c6f8d6d483a67cdfbcb.tar.gz
prosody-f502e55ef5b4d44ea5ca8c6f8d6d483a67cdfbcb.zip
util.sasl: Removed method:forbidden() and its side effects.
Diffstat (limited to 'util/sasl.lua')
-rw-r--r--util/sasl.lua26
1 files changed, 5 insertions, 21 deletions
diff --git a/util/sasl.lua b/util/sasl.lua
index 5d1b9f17..aeb77113 100644
--- a/util/sasl.lua
+++ b/util/sasl.lua
@@ -61,29 +61,15 @@ local function registerMechanism(name, backends, f)
end
-- create a new SASL object which can be used to authenticate clients
-function new(realm, profile, forbidden)
+function new(realm, profile)
local sasl_i = {profile = profile};
sasl_i.realm = realm;
- local s = setmetatable(sasl_i, method);
- if forbidden == nil then forbidden = {} end
- s:forbidden(forbidden)
- return s;
+ return setmetatable(sasl_i, method);
end
--- get a fresh clone with the same realm, profiles and forbidden mechanisms
+-- get a fresh clone with the same realm and profile
function method:clean_clone()
- return new(self.realm, self.profile, self:forbidden())
-end
-
--- set the forbidden mechanisms
-function method:forbidden( restrict )
- if restrict then
- -- set forbidden
- self.restrict = set.new(restrict);
- else
- -- get forbidden
- return array.collect(self.restrict:items());
- end
+ return new(self.realm, self.profile)
end
-- get a list of possible SASL mechanims to use
@@ -94,9 +80,7 @@ function method:mechanisms()
for backend, f in pairs(self.profile) do
if backend_mechanism[backend] then
for _, mechanism in ipairs(backend_mechanism[backend]) do
- if not self.restrict:contains(mechanism) then
- mechanisms[mechanism] = true;
- end
+ mechanisms[mechanism] = true;
end
end
end