Skip to content

Commit

Permalink
Improved the secret regex expression and removed the secret regex par…
Browse files Browse the repository at this point in the history
…ameter
  • Loading branch information
cogutvalera committed Jun 13, 2019
1 parent c93175e commit b337247
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions programs/cli_wallet/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ namespace bpo = boost::program_options;
int main( int argc, char** argv )
{
try {

const char* regex_secret_name = "regex-secret";
const string regex_secret = "^\\s*(unlock|set_password)\\s*";

boost::program_options::options_description opts;
opts.add_options()
("help,h", "Print this help message and exit.")
Expand All @@ -89,7 +85,6 @@ int main( int argc, char** argv )
("wallet-file,w", bpo::value<string>()->implicit_value("wallet.json"), "wallet to load")
("chain-id", bpo::value<string>(), "chain ID to connect to")
("suggest-brain-key", "Suggest a safe brain key to use for creating your account")
(regex_secret_name, bpo::value<string>()->implicit_value(regex_secret), "Regex to hide secret information")
("version,v", "Display version information");


Expand Down Expand Up @@ -258,14 +253,12 @@ int main( int argc, char** argv )
_http_ws_server->start_accept();
}

if ( options.count(regex_secret_name) )
wallet_cli->set_regex_secret(options.at(regex_secret_name).as<std::string>());
else
wallet_cli->set_regex_secret(regex_secret);

if( !options.count( "daemon" ) )
{
auto wallet_cli = std::make_shared<fc::rpc::cli>( GRAPHENE_MAX_NESTED_OBJECTS );

wallet_cli->set_regex_secret("\\s*(unlock|set_password)\\s*$");

for( auto& name_formatter : wapiptr->get_result_formatters() )
wallet_cli->format_result( name_formatter.first, name_formatter.second );

Expand Down

0 comments on commit b337247

Please sign in to comment.