diff options
| author | Charles E. Rolke <chug@apache.org> | 2013-04-08 18:40:34 +0000 |
|---|---|---|
| committer | Charles E. Rolke <chug@apache.org> | 2013-04-08 18:40:34 +0000 |
| commit | 9fc739879cb7cb5ccb990775cbacc185ad02a892 (patch) | |
| tree | 66c4a335aa48738ce8e6c2f758e1981d897a91d8 /cpp/src/qpid/acl | |
| parent | 942c5e433ea855aa6c8b590e301497ca4654fd08 (diff) | |
| download | qpid-python-9fc739879cb7cb5ccb990775cbacc185ad02a892.tar.gz | |
QPID-4727:C++ Broker ACL keyword to reference default exchange.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1465719 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/acl')
| -rw-r--r-- | cpp/src/qpid/acl/AclData.cpp | 10 | ||||
| -rw-r--r-- | cpp/src/qpid/acl/AclData.h | 6 | ||||
| -rw-r--r-- | cpp/src/qpid/acl/AclReader.cpp | 2 |
3 files changed, 15 insertions, 3 deletions
diff --git a/cpp/src/qpid/acl/AclData.cpp b/cpp/src/qpid/acl/AclData.cpp index 922f65ba69..847b67cb58 100644 --- a/cpp/src/qpid/acl/AclData.cpp +++ b/cpp/src/qpid/acl/AclData.cpp @@ -39,6 +39,7 @@ namespace acl { const char AclData::ACL_SYMBOL_WILDCARD = '*'; const std::string AclData::ACL_KEYWORD_WILDCARD = "*"; const char AclData::ACL_SYMBOL_LINE_CONTINUATION = '\\'; + const std::string AclData::ACL_KEYWORD_DEFAULT_EXCHANGE = "amq.default"; // // constructor @@ -432,7 +433,13 @@ namespace acl { std::string sName(rsItr->pubExchName); substituteUserId(sName, id); result = matchProp(sName, name); - } else { + } + else if (rsItr->pubExchNameMatchesBlank) + { + result = name.empty(); + } + else + { result = matchProp(rsItr->pubExchName, name); } @@ -441,7 +448,6 @@ namespace acl { QPID_LOG(debug, "ACL: Rule: " << rsItr->rawRuleNum << " lookup exchange name '" << name << "' matched with rule name '" << rsItr->pubExchName << "'"); - } else { diff --git a/cpp/src/qpid/acl/AclData.h b/cpp/src/qpid/acl/AclData.h index c561b95e09..cd41e6d315 100644 --- a/cpp/src/qpid/acl/AclData.h +++ b/cpp/src/qpid/acl/AclData.h @@ -56,11 +56,13 @@ public: int rawRuleNum; // rule number in ACL file qpid::acl::AclResult ruleMode; // combined allow/deny log/nolog - specPropertyMap props; // + specPropertyMap props; // properties to be matched + // pubXxx for publish exchange fastpath bool pubRoutingKeyInRule; std::string pubRoutingKey; boost::shared_ptr<topicTester> pTTest; bool pubExchNameInRule; + bool pubExchNameMatchesBlank; std::string pubExchName; std::vector<bool> ruleHasUserSub; @@ -72,6 +74,7 @@ public: pubRoutingKey(), pTTest(boost::shared_ptr<topicTester>(new topicTester())), pubExchNameInRule(false), + pubExchNameMatchesBlank(false), pubExchName(), ruleHasUserSub(PROPERTYSIZE, false) {} @@ -148,6 +151,7 @@ public: static const char ACL_SYMBOL_WILDCARD; static const std::string ACL_KEYWORD_WILDCARD; static const char ACL_SYMBOL_LINE_CONTINUATION; + static const std::string ACL_KEYWORD_DEFAULT_EXCHANGE; void substituteString(std::string& targetString, const std::string& placeholder, diff --git a/cpp/src/qpid/acl/AclReader.cpp b/cpp/src/qpid/acl/AclReader.cpp index 1fd5445b52..8f2e6f1fad 100644 --- a/cpp/src/qpid/acl/AclReader.cpp +++ b/cpp/src/qpid/acl/AclReader.cpp @@ -17,6 +17,7 @@ */ #include "qpid/acl/AclReader.h" +#include "qpid/acl/AclData.h" #include <cctype> #include <cstring> @@ -141,6 +142,7 @@ namespace acl { { rule.pubExchNameInRule = true; rule.pubExchName = pItr->second; + rule.pubExchNameMatchesBlank = rule.pubExchName.compare(AclData::ACL_KEYWORD_DEFAULT_EXCHANGE) == 0; } } } |
