You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gs...@apache.org on 2015/08/04 22:05:01 UTC
qpid-proton git commit: PROTON-950: provide Container default for the
allow_insecure_mechs property on transport
Repository: qpid-proton
Updated Branches:
refs/heads/master 864b47e09 -> 5a8c6e0b9
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/5a8c6e0b
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/5a8c6e0b
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/5a8c6e0b
Branch: refs/heads/master
Commit: 5a8c6e0b9091c1e43e585b322ea7b01d53eee288
Parents: 864b47e
Author: Gordon Sim <gs...@redhat.com>
Authored: Tue Aug 4 17:42:55 2015 +0100
Committer: Gordon Sim <gs...@redhat.com>
Committed: Tue Aug 4 21:06:55 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/5a8c6e0b/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/5a8c6e0b/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