1
0
Fork 0

hiding .agency configuration from unauthorized access

This commit is contained in:
Kaveh Vahedipour 2016-09-07 14:18:10 +02:00
parent 43125c2a10
commit 2c7231a7d5
5 changed files with 10 additions and 6 deletions

View File

@ -171,7 +171,7 @@ class Agent : public arangodb::Thread {
/// @brief Activate this agent in single agent mode.
bool activateAgency();
/// @brief Activate new agent in pool to replace failed agent
/// @brief Activate new agent in pool to replace failed
bool activateStandbyAgent();
/// @brief Assignment of persisted state

View File

@ -661,11 +661,14 @@ bool Node::applies(VPackSlice const& slice) {
return true;
}
void Node::toBuilder(Builder& builder) const {
void Node::toBuilder(Builder& builder, bool showHidden) const {
try {
if (type() == NODE) {
VPackObjectBuilder guard(&builder);
for (auto const& child : _children) {
if (child.first[0] == '.' && !showHidden) {
continue;
}
builder.add(VPackValue(child.first));
child.second->toBuilder(builder);
}

View File

@ -166,7 +166,7 @@ class Node {
bool handle(arangodb::velocypack::Slice const&);
/// @brief Create Builder representing this store
void toBuilder(Builder&) const;
void toBuilder(Builder&, bool showHidden = false) const;
/// @brief Access children
Children& children();

View File

@ -466,7 +466,7 @@ query_t Store::clearExpired() const {
/// Dump internal data to builder
void Store::dumpToBuilder(Builder& builder) const {
MUTEX_LOCKER(storeLocker, _storeLock);
toBuilder(builder);
toBuilder(builder, true);
{
VPackObjectBuilder guard(&builder);
for (auto const& i : _timeTable) {
@ -591,7 +591,8 @@ Store& Store::operator=(VPackSlice const& slice) {
}
/// Put key value store in velocypack
void Store::toBuilder(Builder& b) const { _node.toBuilder(b); }
void Store::toBuilder(Builder& b, bool showHidden) const {
_node.toBuilder(b, showHidden); }
/// Get kv-store at path vector
Node Store::operator()(std::vector<std::string> const& pv) { return _node(pv); }

View File

@ -100,7 +100,7 @@ class Store : public arangodb::Thread {
bool applies(arangodb::velocypack::Slice const&);
/// @brief Create Builder representing this store
void toBuilder(Builder&) const;
void toBuilder(Builder&, bool showHidden = false) const;
/// @brief Copy out a node
Node const get(std::string const& path) const;