You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ch...@apache.org on 2020/06/18 17:37:18 UTC
[qpid-dispatch] branch master updated: DISPATCH-1691: hostname
attribute must allow '#' symbol
This is an automated email from the ASF dual-hosted git repository.
chug pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git
The following commit(s) were added to refs/heads/master by this push:
new 94ee34c DISPATCH-1691: hostname attribute must allow '#' symbol
94ee34c is described below
commit 94ee34ceb8673f8fe4b9550ba514216dabc7e148
Author: Chuck Rolke <ch...@apache.org>
AuthorDate: Thu Jun 18 13:35:34 2020 -0400
DISPATCH-1691: hostname attribute must allow '#' symbol
This closes #763
---
python/qpid_dispatch_internal/management/config.py | 2 +-
tests/system_tests_policy.py | 43 ++++++++++++++++++++++
2 files changed, 44 insertions(+), 1 deletion(-)
diff --git a/python/qpid_dispatch_internal/management/config.py b/python/qpid_dispatch_internal/management/config.py
index 4c08360..6136cea 100644
--- a/python/qpid_dispatch_internal/management/config.py
+++ b/python/qpid_dispatch_internal/management/config.py
@@ -116,7 +116,7 @@ class Config(object):
# The 'pattern:' and 'bindingKey:' attributes in the schema are special
# snowflakes. They allow '#' characters in their value, so they cannot
# be treated as comment delimiters
- special_snowflakes = ['pattern', 'bindingKey']
+ special_snowflakes = ['pattern', 'bindingKey', 'hostname']
hash_ok = re.compile(r'([\w-]+)[ \t]*:[ \t]*([\S]+).*')
# the 'openProperties' and 'groups' attributes are also special
diff --git a/tests/system_tests_policy.py b/tests/system_tests_policy.py
index d3d14eb..df606c6 100644
--- a/tests/system_tests_policy.py
+++ b/tests/system_tests_policy.py
@@ -1815,5 +1815,48 @@ class ConnectorPolicyNSndrRcvr(TestCase):
self.assertFalse(res)
+class VhostPolicyConfigHashPattern(TestCase):
+ """
+ Verify that a vhost with a '#' symbol in the hostname does
+ not crash the router.
+ """
+ @classmethod
+ def setUpClass(cls):
+ """Start the router"""
+ super(VhostPolicyConfigHashPattern, cls).setUpClass()
+ config = Qdrouterd.Config([
+ ('router', {'mode': 'standalone', 'id': 'QDR.Policy'}),
+ ('listener', {'port': cls.tester.get_port()}),
+ ('policy', {'maxConnections': 100, 'enableVhostPolicy': 'true', 'enableVhostNamePatterns': 'true'}),
+ ('vhost', {
+ 'hostname': '#.example.com', 'maxConnections': 2,
+ 'allowUnknownUser': 'true',
+ 'groups': {
+ '$default': {
+ 'users': '*',
+ 'remoteHosts': '*',
+ 'sources': '*',
+ 'targets': '*',
+ 'allowDynamicSource': True
+ }
+ }
+ })
+ ])
+
+ cls.router = cls.tester.qdrouterd('vhost-policy-config-hash-pattern', config, wait=False)
+ cls.timed_out = False
+ try:
+ cls.router.wait_ready(timeout = 5)
+ except Exception:
+ cls.timed_out = True
+
+ def address(self):
+ return self.router.addresses[0]
+
+ def test_vhost_created(self):
+ # If the test fails then the router does not start
+ self.assertEqual(False, VhostPolicyConfigHashPattern.timed_out)
+
+
if __name__ == '__main__':
unittest.main(main_module())
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org