Refactor RPC validation_seed.

This commit is contained in:
Arthur Britto
2012-12-03 18:00:59 -08:00
parent 9435dbee18
commit ecf8c69763
3 changed files with 25 additions and 9 deletions

View File

@@ -243,6 +243,20 @@ Json::Value RPCParser::parseValidationCreate(const Json::Value& jvParams)
return jvRequest;
}
// validation_seed [<pass_phrase>|<seed>|<seed_key>]
//
// NOTE: It is poor security to specify secret information on the command line. This information might be saved in the command
// shell history file (e.g. .bash_history) and it may be leaked via the process status command (i.e. ps).
Json::Value RPCParser::parseValidationSeed(const Json::Value& jvParams)
{
Json::Value jvRequest;
if (jvParams.size())
jvRequest["secret"] = jvParams[0u].asString();
return jvRequest;
}
// wallet_accounts <seed>
Json::Value RPCParser::parseWalletAccounts(const Json::Value& jvParams)
{
@@ -334,7 +348,7 @@ Json::Value RPCParser::parseCommand(std::string strMethod, Json::Value jvParams)
{ "unl_score", &RPCParser::parseAsIs, 0, 0 },
{ "validation_create", &RPCParser::parseValidationCreate, 0, 1 },
// { "validation_seed", &RPCParser::doValidationSeed, 0, 1, false, false, optNone },
{ "validation_seed", &RPCParser::parseValidationSeed, 0, 1 },
{ "wallet_accounts", &RPCParser::parseWalletAccounts, 1, 1 },
{ "wallet_propose", &RPCParser::parseWalletPropose, 0, 1 },