qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject qpid-proton git commit: PROTON-950: provide Container default for the allow_insecure_mechs property on transport
Date Tue, 04 Aug 2015 20:14:12 GMT
Repository: qpid-proton
Updated Branches:
  refs/heads/0.10.x 8e3231d0b -> 39b3dd56a


PROTON-950: provide Container default for the allow_insecure_mechs property on transport


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/39b3dd56
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/39b3dd56
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/39b3dd56

Branch: refs/heads/0.10.x
Commit: 39b3dd56a38a396791ebcdba30bf4097e74c90d7
Parents: 8e3231d
Author: Gordon Sim <gsim@redhat.com>
Authored: Tue Aug 4 17:42:55 2015 +0100
Committer: Gordon Sim <gsim@redhat.com>
Committed: Tue Aug 4 21:09:33 2015 +0100

----------------------------------------------------------------------
 proton-c/bindings/python/proton/reactor.py | 10 ++++++++++
 proton-j/src/main/resources/csasl.py       |  3 +++
 2 files changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/39b3dd56/proton-c/bindings/python/proton/reactor.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/proton/reactor.py b/proton-c/bindings/python/proton/reactor.py
index d019554..a1d8c62 100644
--- a/proton-c/bindings/python/proton/reactor.py
+++ b/proton-c/bindings/python/proton/reactor.py
@@ -495,6 +495,8 @@ class Connector(Handler):
         self.heartbeat = None
         self.reconnect = None
         self.ssl_domain = None
+        self.allow_insecure_mechs = True
+        self.allowed_mechs = None
 
     def _connect(self, connection):
         url = self.address.next()
@@ -507,6 +509,10 @@ class Connector(Handler):
         if url.password:
             connection.password = url.password
         transport = Transport()
+        sasl = transport.sasl()
+        sasl.allow_insecure_mechs = self.allow_insecure_mechs
+        if self.allowed_mechs:
+            sasl.allowed_mechs(self.allowed_mechs)
         transport.bind(connection)
         if self.heartbeat:
             transport.idle_timeout = self.heartbeat
@@ -612,6 +618,8 @@ class Container(Reactor):
             self.global_handler = GlobalOverrides(kwargs.get('global_handler', self.global_handler))
             self.trigger = None
             self.container_id = str(generate_uuid())
+            self.allow_insecure_mechs = True
+            self.allowed_mechs = None
             Wrapper.__setattr__(self, 'subclass', self.__class__)
 
     def connect(self, url=None, urls=None, address=None, handler=None, reconnect=None, heartbeat=None,
ssl_domain=None):
@@ -623,6 +631,8 @@ class Container(Reactor):
         conn.container = self.container_id or str(generate_uuid())
 
         connector = Connector(conn)
+        connector.allow_insecure_mechs = self.allow_insecure_mechs
+        connector.allowed_mechs = self.allowed_mechs
         conn._overrides = connector
         if url: connector.address = Urls([url])
         elif urls: connector.address = Urls(urls)

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/39b3dd56/proton-j/src/main/resources/csasl.py
----------------------------------------------------------------------
diff --git a/proton-j/src/main/resources/csasl.py b/proton-j/src/main/resources/csasl.py
index a5fe0a6..67bcd2e 100644
--- a/proton-j/src/main/resources/csasl.py
+++ b/proton-j/src/main/resources/csasl.py
@@ -81,6 +81,9 @@ def pn_connection_set_password(connection, password):
 def pn_sasl_allowed_mechs(sasl, mechs):
   sasl.setMechanisms(*mechs.split())
 
+def pn_sasl_set_allow_insecure_mechs(sasl, insecure):
+  raise Skipped('Not supported in Proton-J')
+
 def pn_sasl_done(sasl, outcome):
   sasl.done(SASL_OUTCOMES_P2J[outcome])
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message