diff options
author | Alan Conway <aconway@apache.org> | 2011-12-06 15:56:40 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2011-12-06 15:56:40 +0000 |
commit | 50083a9b6553d832856bc7d402dd186f74d80254 (patch) | |
tree | b6b0c097cd643e51b7c1615e6b2f8c2aca850efa /cpp/src/qpid/cluster/InitialStatusMap.cpp | |
parent | efd035d01dd87dd146f3fc6aacabc8c28b10316d (diff) | |
download | qpid-python-50083a9b6553d832856bc7d402dd186f74d80254.tar.gz |
QPID-3652: Fix cluster authentication.
Only allow brokers that authenticate as the cluster-username to join a cluster.
New broker first connects to a cluster broker authenticates as the cluster-username
and sends its CPG member ID to the qpid.cluster-credentials exchange.
The cluster broker that subsequently acts as updater verifies that the credentials are
valid before connecting to give the update.
NOTE 1: If you are using an ACL, the cluster-username must be allowed to
publish to the qpid.cluster-credentials exchange. E.g. in your ACL file:
acl allow foo@QPID publish exchange name=qpid.cluster-credentials
NOTE 2: This changes the cluster initialization protocol, you will
need to restart the cluster with all new version brokers.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1210989 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/InitialStatusMap.cpp')
-rw-r--r-- | cpp/src/qpid/cluster/InitialStatusMap.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/cpp/src/qpid/cluster/InitialStatusMap.cpp b/cpp/src/qpid/cluster/InitialStatusMap.cpp index c8ecc13f2c..eb65005a9e 100644 --- a/cpp/src/qpid/cluster/InitialStatusMap.cpp +++ b/cpp/src/qpid/cluster/InitialStatusMap.cpp @@ -21,6 +21,7 @@ #include "InitialStatusMap.h" #include "StoreStatus.h" #include "qpid/log/Statement.h" +#include "qpid/UrlArray.h" #include <algorithm> #include <vector> #include <boost/bind.hpp> @@ -218,6 +219,17 @@ void InitialStatusMap::checkConsistent() { } } +std::vector<Url> InitialStatusMap::getUrls() const { + std::vector<Url> urls; + for (Map::const_iterator i = map.begin(); i != map.end(); ++i) { + if (i->second) { + std::vector<Url> urls = urlArrayToVector(i->second->getUrls()); + if (!urls.empty()) return urls; + } + } + return std::vector<Url>(); +} + std::string InitialStatusMap::getFirstConfigStr() const { assert(!firstConfig.empty()); return encodeMemberSet(firstConfig); |