summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests/Acl.cpp
diff options
context:
space:
mode:
authorCharles E. Rolke <chug@apache.org>2014-07-23 17:01:40 +0000
committerCharles E. Rolke <chug@apache.org>2014-07-23 17:01:40 +0000
commit9df7c3257a81f6c124089cca3be2ceeee20ae1d2 (patch)
tree039a8bfc79c25499bee4e5a4b08b7b66f883f42d /qpid/cpp/src/tests/Acl.cpp
parentca9f0b69230ff6cafdcfe7881d05cbbcd13ec629 (diff)
downloadqpid-python-9df7c3257a81f6c124089cca3be2ceeee20ae1d2.tar.gz
QPID-4123: C++ Broker ACL creates too many rules
Recent changes have added new tables to define what are ACL lookups and their properties. This commit finishes that work by not propagating rules that will never match. Also, it completes the scaffolding for allowed and denied host lists to be fully integrated. This commit: * Adds startup logging of ACL validation tables with cross references to possible rule matches. * Hooks the ACL host allow/deny connection lists into self test. * Fixes self tests that get broken by proper rule table handling. * Introduces a 'create connection' decision mode similar to ACL rule decision mode. * Describes it all in doc book. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1612874 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/Acl.cpp')
-rw-r--r--qpid/cpp/src/tests/Acl.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/qpid/cpp/src/tests/Acl.cpp b/qpid/cpp/src/tests/Acl.cpp
index 75a52c8ca1..9c3de0de62 100644
--- a/qpid/cpp/src/tests/Acl.cpp
+++ b/qpid/cpp/src/tests/Acl.cpp
@@ -45,6 +45,13 @@ QPID_AUTO_TEST_CASE(TestLexerObjectEnums) {
OBJ_ENUMS(OBJ_METHOD, "method");
OBJ_ENUMS(OBJ_QUERY, "query");
OBJ_ENUMS(OBJ_CONNECTION, "connection");
+ int maxLen = 0;
+ for (int i=0; i<acl::OBJECTSIZE; i++) {
+ int thisLen = AclHelper::getObjectTypeStr( ObjectType(i) ).length();
+ if (thisLen > maxLen)
+ maxLen = thisLen;
+ }
+ BOOST_CHECK_EQUAL(maxLen, acl::OBJECTTYPE_STR_WIDTH);
}
#define ACT_ENUMS(e, s) \
@@ -65,6 +72,13 @@ QPID_AUTO_TEST_CASE(TestLexerActionEnums) {
ACT_ENUMS(ACT_MOVE, "move");
ACT_ENUMS(ACT_REDIRECT, "redirect");
ACT_ENUMS(ACT_REROUTE, "reroute");
+ int maxLen = 0;
+ for (int i=0; i<acl::ACTIONSIZE; i++) {
+ int thisLen = AclHelper::getActionStr( Action(i) ).length();
+ if (thisLen > maxLen)
+ maxLen = thisLen;
+ }
+ BOOST_CHECK_EQUAL(maxLen, acl::ACTION_STR_WIDTH);
}
#define PROP_ENUMS(e, s) \