-function new(realm, profile, forbidden)
- 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;
-end
-
--- get a fresh clone with the same realm, profiles and forbidden mechanisms
-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
-end
-
--- get a list of possible SASL mechanims to use
-function method:mechanisms()
- local mechanisms = self.mechs;
+function new(realm, profile)
+ local mechanisms = profile.mechanisms;