summaryrefslogtreecommitdiff
path: root/sleekxmpp/clientxmpp.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-01-20 01:08:25 -0800
committerLance Stout <lancestout@gmail.com>2012-01-20 01:08:25 -0800
commit0d2125e737d28c8cf8aad0fd80b72179b8e7b914 (patch)
treee5eb0ec70adc71c8a0a1f79cf56437f2322d47a8 /sleekxmpp/clientxmpp.py
parent02f400615334806fc531c149d85fe6f9a06d3e1e (diff)
downloadslixmpp-0d2125e737d28c8cf8aad0fd80b72179b8e7b914.tar.gz
slixmpp-0d2125e737d28c8cf8aad0fd80b72179b8e7b914.tar.bz2
slixmpp-0d2125e737d28c8cf8aad0fd80b72179b8e7b914.tar.xz
slixmpp-0d2125e737d28c8cf8aad0fd80b72179b8e7b914.zip
Add an extra config dict to store SASL credentials.
We'll need extra things beyond just a password, such as api_key.
Diffstat (limited to 'sleekxmpp/clientxmpp.py')
-rw-r--r--sleekxmpp/clientxmpp.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/sleekxmpp/clientxmpp.py b/sleekxmpp/clientxmpp.py
index 69e7db6c..a836cbd9 100644
--- a/sleekxmpp/clientxmpp.py
+++ b/sleekxmpp/clientxmpp.py
@@ -74,12 +74,15 @@ class ClientXMPP(BaseXMPP):
BaseXMPP.__init__(self, jid, 'jabber:client')
self.set_jid(jid)
- self.password = password
self.escape_quotes = escape_quotes
self.plugin_config = plugin_config
self.plugin_whitelist = plugin_whitelist
self.default_port = 5222
+ self.credentials = {}
+
+ self.password = password
+
self.stream_header = "<stream:stream to='%s' %s %s version='1.0'>" % (
self.boundjid.host,
"xmlns:stream='%s'" % self.stream_ns,
@@ -119,6 +122,14 @@ class ClientXMPP(BaseXMPP):
self.register_plugin('feature_mechanisms',
pconfig={'use_mech': sasl_mech} if sasl_mech else None)
+ @property
+ def password(self):
+ return self.credentials.get('password', '')
+
+ @password.setter
+ def password(self, value):
+ self.credentials['password'] = value
+
def connect(self, address=tuple(), reattempt=True,
use_tls=True, use_ssl=False):
"""Connect to the XMPP server.