Enable forcing a specififc SASL mech:

xmpp = ClientXMPP(jid, password, {
    'feature_mechanisms': {'use_mech':'PLAIN'}})
This commit is contained in:
Lance Stout 2011-08-09 00:51:49 -07:00
parent 75f23d1130
commit 572becad44

View file

@ -29,6 +29,8 @@ class feature_mechanisms(base_plugin):
self.description = "SASL Stream Feature" self.description = "SASL Stream Feature"
self.stanza = stanza self.stanza = stanza
self.use_mech = self.config.get('use_mech', None)
def tls_active(): def tls_active():
return 'starttls' in self.xmpp.features return 'starttls' in self.xmpp.features
@ -48,7 +50,8 @@ class feature_mechanisms(base_plugin):
username=self.xmpp.boundjid.user, username=self.xmpp.boundjid.user,
sec_query=suelta.sec_query_allow, sec_query=suelta.sec_query_allow,
request_values=sasl_callback, request_values=sasl_callback,
tls_active=tls_active) tls_active=tls_active,
mech=self.use_mech)
register_stanza_plugin(StreamFeatures, stanza.Mechanisms) register_stanza_plugin(StreamFeatures, stanza.Mechanisms)