diff options
| author | Carl C. Trieloff <cctrieloff@apache.org> | 2008-08-01 13:40:56 +0000 |
|---|---|---|
| committer | Carl C. Trieloff <cctrieloff@apache.org> | 2008-08-01 13:40:56 +0000 |
| commit | 34ba8277044906749d400205f4f56fc24375ae22 (patch) | |
| tree | 6ec3bb69f16820ba734d35fb1457ffe524002f8a /cpp/src/qpid/acl/Acl.cpp | |
| parent | 76a64b149db18ce1a81b9f34b7a34dde1524a5e9 (diff) | |
| download | qpid-python-34ba8277044906749d400205f4f56fc24375ae22.tar.gz | |
- Add support for ACL on message transfer
- Performance optimizations for ACL on message transfer
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@681690 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/acl/Acl.cpp')
| -rw-r--r-- | cpp/src/qpid/acl/Acl.cpp | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/cpp/src/qpid/acl/Acl.cpp b/cpp/src/qpid/acl/Acl.cpp index 7fceba8b1a..9f6917a006 100644 --- a/cpp/src/qpid/acl/Acl.cpp +++ b/cpp/src/qpid/acl/Acl.cpp @@ -34,7 +34,7 @@ namespace acl { using namespace std; - Acl::Acl (AclValues& av, broker::Broker& b): aclValues(av), broker(&b) + Acl::Acl (AclValues& av, broker::Broker& b): aclValues(av), broker(&b), transferAcl(false) { if (!readAclFile()) throw Exception("Could not read ACL file"); QPID_LOG(info, "ACL Plugin loaded"); @@ -76,6 +76,24 @@ using namespace std; // add real ACL check here... AclResult aclreslt = ALLOWLOG; // hack to test, set based on real decision. + + return result(aclreslt, id, action, objType, name); + } + + bool Acl::authorise(std::string id, acl::Action action, acl::ObjectType objType, std::string ExchangeName, std::string /*RoutingKey*/) + { + if (aclValues.noEnforce) return true; + + // add real ACL check here... + AclResult aclreslt = ALLOWLOG; // hack to test, set based on real decision. + + + return result(aclreslt, id, action, objType, ExchangeName); + } + + + bool Acl::result(AclResult aclreslt, std::string id, acl::Action action, acl::ObjectType objType, std::string name) + { switch (aclreslt) { case ALLOWLOG: @@ -89,12 +107,13 @@ using namespace std; QPID_LOG(info, "ACL Deny id:" << id << " action:" << printAction(action) << " ObjectType:" << printObjType(objType) << " Name:" << name); return false; } - return false; } - + bool Acl::readAclFile() { + // only set transferAcl = true if a rule implies the use of ACL on transfer, else keep false for permormance reasons. + return true; } |
