summaryrefslogtreecommitdiff
path: root/sleekxmpp/features/feature_mechanisms
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-07-27 10:45:52 -0700
committerLance Stout <lancestout@gmail.com>2012-07-27 10:45:52 -0700
commitc2189b4ecd6b022ed9900a6f411bd7e9d57c47ce (patch)
tree88b7dabe06edbbfeb45403c06628230c18301458 /sleekxmpp/features/feature_mechanisms
parentc9b2cf60431f415584c1d12a7855e0d2ac148ec4 (diff)
parente3fab66dfb27abdd8aa28a8d15367a490d4b42dd (diff)
downloadslixmpp-c2189b4ecd6b022ed9900a6f411bd7e9d57c47ce.tar.gz
slixmpp-c2189b4ecd6b022ed9900a6f411bd7e9d57c47ce.tar.bz2
slixmpp-c2189b4ecd6b022ed9900a6f411bd7e9d57c47ce.tar.xz
slixmpp-c2189b4ecd6b022ed9900a6f411bd7e9d57c47ce.zip
Merge branch 'master' into develop
Diffstat (limited to 'sleekxmpp/features/feature_mechanisms')
-rw-r--r--sleekxmpp/features/feature_mechanisms/mechanisms.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/sleekxmpp/features/feature_mechanisms/mechanisms.py b/sleekxmpp/features/feature_mechanisms/mechanisms.py
index 930aa8fe..2ab7b0a4 100644
--- a/sleekxmpp/features/feature_mechanisms/mechanisms.py
+++ b/sleekxmpp/features/feature_mechanisms/mechanisms.py
@@ -29,10 +29,13 @@ class FeatureMechanisms(BasePlugin):
description = 'RFC 6120: Stream Feature: SASL'
dependencies = set()
stanza = stanza
+ default_config = {
+ 'use_mech': None,
+ 'sasl_callback': None,
+ 'order': 100
+ }
def plugin_init(self):
- self.use_mech = self.config.get('use_mech', None)
-
if not self.use_mech and not self.xmpp.boundjid.user:
self.use_mech = 'ANONYMOUS'
@@ -53,15 +56,14 @@ class FeatureMechanisms(BasePlugin):
values[value] = creds[value]
mech.fulfill(values)
- sasl_callback = self.config.get('sasl_callback', None)
- if sasl_callback is None:
- sasl_callback = basic_callback
+ if self.sasl_callback is None:
+ self.sasl_callback = basic_callback
self.mech = None
self.sasl = suelta.SASL(self.xmpp.boundjid.domain, 'xmpp',
username=self.xmpp.boundjid.user,
sec_query=suelta.sec_query_allow,
- request_values=sasl_callback,
+ request_values=self.sasl_callback,
tls_active=tls_active,
mech=self.use_mech)
@@ -95,7 +97,7 @@ class FeatureMechanisms(BasePlugin):
self.xmpp.register_feature('mechanisms',
self._handle_sasl_auth,
restart=True,
- order=self.config.get('order', 100))
+ order=self.order)
def _handle_sasl_auth(self, features):
"""