mirror of https://gitee.com/bigwinds/arangodb
hiding .agency configuration from unauthorized access
This commit is contained in:
parent
43125c2a10
commit
2c7231a7d5
|
@ -171,7 +171,7 @@ class Agent : public arangodb::Thread {
|
||||||
/// @brief Activate this agent in single agent mode.
|
/// @brief Activate this agent in single agent mode.
|
||||||
bool activateAgency();
|
bool activateAgency();
|
||||||
|
|
||||||
/// @brief Activate new agent in pool to replace failed agent
|
/// @brief Activate new agent in pool to replace failed
|
||||||
bool activateStandbyAgent();
|
bool activateStandbyAgent();
|
||||||
|
|
||||||
/// @brief Assignment of persisted state
|
/// @brief Assignment of persisted state
|
||||||
|
|
|
@ -661,11 +661,14 @@ bool Node::applies(VPackSlice const& slice) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Node::toBuilder(Builder& builder) const {
|
void Node::toBuilder(Builder& builder, bool showHidden) const {
|
||||||
try {
|
try {
|
||||||
if (type() == NODE) {
|
if (type() == NODE) {
|
||||||
VPackObjectBuilder guard(&builder);
|
VPackObjectBuilder guard(&builder);
|
||||||
for (auto const& child : _children) {
|
for (auto const& child : _children) {
|
||||||
|
if (child.first[0] == '.' && !showHidden) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
builder.add(VPackValue(child.first));
|
builder.add(VPackValue(child.first));
|
||||||
child.second->toBuilder(builder);
|
child.second->toBuilder(builder);
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,7 +166,7 @@ class Node {
|
||||||
bool handle(arangodb::velocypack::Slice const&);
|
bool handle(arangodb::velocypack::Slice const&);
|
||||||
|
|
||||||
/// @brief Create Builder representing this store
|
/// @brief Create Builder representing this store
|
||||||
void toBuilder(Builder&) const;
|
void toBuilder(Builder&, bool showHidden = false) const;
|
||||||
|
|
||||||
/// @brief Access children
|
/// @brief Access children
|
||||||
Children& children();
|
Children& children();
|
||||||
|
|
|
@ -466,7 +466,7 @@ query_t Store::clearExpired() const {
|
||||||
/// Dump internal data to builder
|
/// Dump internal data to builder
|
||||||
void Store::dumpToBuilder(Builder& builder) const {
|
void Store::dumpToBuilder(Builder& builder) const {
|
||||||
MUTEX_LOCKER(storeLocker, _storeLock);
|
MUTEX_LOCKER(storeLocker, _storeLock);
|
||||||
toBuilder(builder);
|
toBuilder(builder, true);
|
||||||
{
|
{
|
||||||
VPackObjectBuilder guard(&builder);
|
VPackObjectBuilder guard(&builder);
|
||||||
for (auto const& i : _timeTable) {
|
for (auto const& i : _timeTable) {
|
||||||
|
@ -591,7 +591,8 @@ Store& Store::operator=(VPackSlice const& slice) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Put key value store in velocypack
|
/// 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
|
/// Get kv-store at path vector
|
||||||
Node Store::operator()(std::vector<std::string> const& pv) { return _node(pv); }
|
Node Store::operator()(std::vector<std::string> const& pv) { return _node(pv); }
|
||||||
|
|
|
@ -100,7 +100,7 @@ class Store : public arangodb::Thread {
|
||||||
bool applies(arangodb::velocypack::Slice const&);
|
bool applies(arangodb::velocypack::Slice const&);
|
||||||
|
|
||||||
/// @brief Create Builder representing this store
|
/// @brief Create Builder representing this store
|
||||||
void toBuilder(Builder&) const;
|
void toBuilder(Builder&, bool showHidden = false) const;
|
||||||
|
|
||||||
/// @brief Copy out a node
|
/// @brief Copy out a node
|
||||||
Node const get(std::string const& path) const;
|
Node const get(std::string const& path) const;
|
||||||
|
|
Loading…
Reference in New Issue