summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2010-06-30 14:25:03 +0000
committerRafael H. Schloming <rhs@apache.org>2010-06-30 14:25:03 +0000
commit929f6ff2138e848c8d906fb623959bde464d9bb3 (patch)
tree917d4c2575c8e27e62efef736b317d6f55a2b8f0 /python
parenta6c6bb1a65eef1c758442aae721efdcc463c6cf1 (diff)
downloadqpid-python-929f6ff2138e848c8d906fb623959bde464d9bb3.tar.gz
added accessor for auth_username
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@959326 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python')
-rw-r--r--python/qpid/messaging/driver.py1
-rw-r--r--python/qpid/messaging/endpoints.py1
-rw-r--r--python/qpid/sasl.py6
3 files changed, 8 insertions, 0 deletions
diff --git a/python/qpid/messaging/driver.py b/python/qpid/messaging/driver.py
index a732a60a9f..2175715c77 100644
--- a/python/qpid/messaging/driver.py
+++ b/python/qpid/messaging/driver.py
@@ -674,6 +674,7 @@ class Engine:
self._sasl_encode = True
def do_connection_open_ok(self, open_ok):
+ self.connection.auth_username = self._sasl.auth_username()
self._connected = True
self._sasl_decode = True
self.connection._transport_connected = True
diff --git a/python/qpid/messaging/endpoints.py b/python/qpid/messaging/endpoints.py
index f7afc66d46..f989d6c918 100644
--- a/python/qpid/messaging/endpoints.py
+++ b/python/qpid/messaging/endpoints.py
@@ -137,6 +137,7 @@ class Connection(Endpoint):
self.heartbeat = options.get("heartbeat")
self.username = default(url.user, options.get("username", None))
self.password = default(url.password, options.get("password", None))
+ self.auth_username = None
self.sasl_mechanisms = options.get("sasl_mechanisms")
self.sasl_service = options.get("sasl_service", "qpidd")
diff --git a/python/qpid/sasl.py b/python/qpid/sasl.py
index 6b00ddaa99..6645903382 100644
--- a/python/qpid/sasl.py
+++ b/python/qpid/sasl.py
@@ -65,6 +65,9 @@ class WrapperClient:
else:
raise SASLError(self._cli.getError())
+ def auth_username(self):
+ return self._cli.getUserId()
+
class PlainClient:
def __init__(self):
@@ -92,6 +95,9 @@ class PlainClient:
def decode(self, bytes):
return bytes
+ def auth_username(self):
+ return self.attrs.get("username")
+
try:
from saslwrapper import Client as _Client
Client = WrapperClient