You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rh...@apache.org on 2010/06/30 16:25:03 UTC

svn commit: r959326 - in /qpid/trunk/qpid/python/qpid: messaging/driver.py messaging/endpoints.py sasl.py

Author: rhs
Date: Wed Jun 30 14:25:03 2010
New Revision: 959326

URL: http://svn.apache.org/viewvc?rev=959326&view=rev
Log:
added accessor for auth_username

Modified:
    qpid/trunk/qpid/python/qpid/messaging/driver.py
    qpid/trunk/qpid/python/qpid/messaging/endpoints.py
    qpid/trunk/qpid/python/qpid/sasl.py

Modified: qpid/trunk/qpid/python/qpid/messaging/driver.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/python/qpid/messaging/driver.py?rev=959326&r1=959325&r2=959326&view=diff
==============================================================================
--- qpid/trunk/qpid/python/qpid/messaging/driver.py (original)
+++ qpid/trunk/qpid/python/qpid/messaging/driver.py Wed Jun 30 14:25:03 2010
@@ -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

Modified: qpid/trunk/qpid/python/qpid/messaging/endpoints.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/python/qpid/messaging/endpoints.py?rev=959326&r1=959325&r2=959326&view=diff
==============================================================================
--- qpid/trunk/qpid/python/qpid/messaging/endpoints.py (original)
+++ qpid/trunk/qpid/python/qpid/messaging/endpoints.py Wed Jun 30 14:25:03 2010
@@ -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")

Modified: qpid/trunk/qpid/python/qpid/sasl.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/python/qpid/sasl.py?rev=959326&r1=959325&r2=959326&view=diff
==============================================================================
--- qpid/trunk/qpid/python/qpid/sasl.py (original)
+++ qpid/trunk/qpid/python/qpid/sasl.py Wed Jun 30 14:25:03 2010
@@ -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



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org