Split into server_info (for humans) and server_state (for machines).

Allow either without admin privileges, filter information out from non-admins.
Cleanup and improve data in all cases.
This commit is contained in:
JoelKatz
2013-01-15 19:16:20 -08:00
parent 01b3e9e0ae
commit 8191153dce
5 changed files with 59 additions and 17 deletions

View File

@@ -1305,7 +1305,16 @@ Json::Value RPCHandler::doServerInfo(Json::Value)
{
Json::Value ret(Json::objectValue);
ret["info"] = theApp->getOPs().getServerInfo(mRole == ADMIN);
ret["info"] = theApp->getOPs().getServerInfo(true, mRole == ADMIN);
return ret;
}
Json::Value RPCHandler::doServerState(Json::Value)
{
Json::Value ret(Json::objectValue);
ret["info"] = theApp->getOPs().getServerInfo(false, mRole == ADMIN);
return ret;
}
@@ -2589,7 +2598,8 @@ Json::Value RPCHandler::doCommand(Json::Value& jvRequest, int iRole)
{ "ripple_path_find", &RPCHandler::doRipplePathFind, false, optCurrent },
{ "sign", &RPCHandler::doSign, false, optCurrent },
{ "submit", &RPCHandler::doSubmit, false, optCurrent },
{ "server_info", &RPCHandler::doServerInfo, true, optNone },
{ "server_info", &RPCHandler::doServerInfo, false, optNone },
{ "server_state", &RPCHandler::doServerState, false, optNone },
{ "stop", &RPCHandler::doStop, true, optNone },
{ "transaction_entry", &RPCHandler::doTransactionEntry, false, optCurrent },
{ "tx", &RPCHandler::doTx, false, optNetwork },