Software /
code /
prosody
Comparison
util/sasl.lua @ 2203:812130099ab2
Cleaning up.
author | Tobias Markmann <tm@ayena.de> |
---|---|
date | Wed, 18 Nov 2009 23:25:27 +0100 |
parent | 2202:c320517d6b47 |
child | 2212:7cb6460b18d8 |
comparison
equal
deleted
inserted
replaced
2202:c320517d6b47 | 2203:812130099ab2 |
---|---|
89 s:forbidden(sasl_i, forbidden) | 89 s:forbidden(sasl_i, forbidden) |
90 return s; | 90 return s; |
91 end | 91 end |
92 | 92 |
93 -- set the forbidden mechanisms | 93 -- set the forbidden mechanisms |
94 function method:forbidden( forbidden ) | 94 function method:forbidden( restrict ) |
95 if forbidden then | 95 if restrict then |
96 -- set forbidden | 96 -- set forbidden |
97 self.forbidden = set.new(forbidden); | 97 self.restrict = set.new(restrict); |
98 else | 98 else |
99 -- get forbidden | 99 -- get forbidden |
100 return array.collect(self.forbidden:items()); | 100 return array.collect(self.restrict:items()); |
101 end | 101 end |
102 end | 102 end |
103 | 103 |
104 -- get a list of possible SASL mechanims to use | 104 -- get a list of possible SASL mechanims to use |
105 function method:mechanisms() | 105 function method:mechanisms() |
106 local mechanisms = {} | 106 local mechanisms = {} |
107 for backend, f in pairs(self.profile) do | 107 for backend, f in pairs(self.profile) do |
108 if backend_mechanism[backend] then | 108 if backend_mechanism[backend] then |
109 for _, mechanism in ipairs(backend_mechanism[backend]) do | 109 for _, mechanism in ipairs(backend_mechanism[backend]) do |
110 if not sasl_i.forbidden:contains(mechanism) then | 110 if not sasl_i.restrict:contains(mechanism) then |
111 mechanisms[mechanism] = true; | 111 mechanisms[mechanism] = true; |
112 end | 112 end |
113 end | 113 end |
114 end | 114 end |
115 end | 115 end |