diff --git a/doc/todo/VFALCO_TODO.txt b/doc/todo/VFALCO_TODO.txt index 16dffd223..90fa6e9ed 100644 --- a/doc/todo/VFALCO_TODO.txt +++ b/doc/todo/VFALCO_TODO.txt @@ -121,8 +121,6 @@ David Features: - Replace C11X with BEAST_COMPILER_SUPPORTS_MOVE_SEMANTICS -- Remove "ENABLE_INSECURE" when the time is right. - - Go searching through VFALCO notes and fix everything - Deal with function-level statics used for SqliteDatabase (like in diff --git a/src/ripple_app/main/Main.cpp b/src/ripple_app/main/Main.cpp index d8f5d29ba..c4dcca4f5 100644 --- a/src/ripple_app/main/Main.cpp +++ b/src/ripple_app/main/Main.cpp @@ -84,11 +84,6 @@ void printHelp (const po::options_description& desc) cerr << " book_offers [ [ [ []]]]]" << endl; cerr << " connect []" << endl; cerr << " consensus_info" << endl; -#if ENABLE_INSECURE - cerr << " data_delete " << endl; - cerr << " data_fetch " << endl; - cerr << " data_store " << endl; -#endif cerr << " get_counts" << endl; cerr << " json " << endl; cerr << " ledger [|current|closed|validated] [full]" << endl; @@ -174,7 +169,7 @@ int run (int argc, char** argv) setCallingThreadName ("main"); int iResult = 0; - po::variables_map vm; // Map of options. + po::variables_map vm; beast::String importDescription; { diff --git a/src/ripple_app/rpc/RPCHandler.cpp b/src/ripple_app/rpc/RPCHandler.cpp index 505eb271f..1f34ae0b3 100644 --- a/src/ripple_app/rpc/RPCHandler.cpp +++ b/src/ripple_app/rpc/RPCHandler.cpp @@ -868,85 +868,6 @@ Json::Value RPCHandler::doConnect (Json::Value params, return "connecting"; } -#if ENABLE_INSECURE -// { -// key: -// } -Json::Value RPCHandler::doDataDelete (Json::Value params, Resource::Charge& loadType, Application::ScopedLockType& masterLockHolder) -{ - if (!params.isMember ("key")) - return RPC::missing_field_error ("key"); - - std::string strKey = params["key"].asString (); - - Json::Value ret = Json::Value (Json::objectValue); - - if (getApp().getLocalCredentials ().dataDelete (strKey)) - { - ret["key"] = strKey; - } - else - { - ret = rpcError (rpcINTERNAL); - } - - return ret; -} -#endif - -#if ENABLE_INSECURE -// { -// key: -// } -Json::Value RPCHandler::doDataFetch (Json::Value params, Resource::Charge& loadType, Application::ScopedLockType& masterLockHolder) -{ - if (!params.isMember ("key")) - return RPC::missing_field_error ("key"); - - std::string strKey = params["key"].asString (); - std::string strValue; - - Json::Value ret = Json::Value (Json::objectValue); - - ret["key"] = strKey; - - if (getApp().getLocalCredentials ().dataFetch (strKey, strValue)) - ret["value"] = strValue; - - return ret; -} -#endif - -#if ENABLE_INSECURE -// { -// key: -// value: -// } -Json::Value RPCHandler::doDataStore (Json::Value params, Resource::Charge& loadType, Application::ScopedLockType& masterLockHolder) -{ - if (!params.isMember ("key") - return RPC::missing_field_error ("key"); - if (!params.isMember ("value") - return RPC::missing_field_error ("value"); - - std::string strKey = params["key"].asString (); - std::string strValue = params["value"].asString (); - - Json::Value ret = Json::Value (Json::objectValue); - - if (getApp().getLocalCredentials ().dataStore (strKey, strValue)) - { - ret["key"] = strKey; - ret["value"] = strValue; - } - else - { - ret = rpcError (rpcINTERNAL); - } - - return ret; -} -#endif #if 0 // XXX Needs to be revised for new paradigm @@ -2956,32 +2877,6 @@ Json::Value RPCHandler::doWalletSeed (Json::Value params, Resource::Charge& load } } -#if ENABLE_INSECURE -// TODO: for now this simply checks if this is the Config::ADMIN account -// TODO: need to prevent them hammering this over and over -// TODO: maybe a better way is only allow Config::ADMIN from local host -// { -// username: , -// password: -// } -Json::Value RPCHandler::doLogin (Json::Value params, Resource::Charge& loadType, Application::ScopedLockType& masterLockHolder) -{ - if (!params.isMember ("username") - || !params.isMember ("password")) - return rpcError (rpcINVALID_PARAMS); - - if (params["username"].asString () == getConfig ().RPC_USER && params["password"].asString () == getConfig ().RPC_PASSWORD) - { - //mRole=ADMIN; - return "logged in"; - } - else - { - return "nope"; - } -} -#endif - static void textTime (std::string& text, int& seconds, const char* unitName, int unitVal) { int i = seconds / unitVal; @@ -4371,14 +4266,6 @@ Json::Value RPCHandler::doCommand (const Json::Value& params, int iRole, Resourc { "wallet_propose", &RPCHandler::doWalletPropose, true, optNone }, { "wallet_seed", &RPCHandler::doWalletSeed, true, optNone }, -#if ENABLE_INSECURE - // XXX Unnecessary commands which should be removed. - { "login", &RPCHandler::doLogin, true, optNone }, - { "data_delete", &RPCHandler::doDataDelete, true, optNone }, - { "data_fetch", &RPCHandler::doDataFetch, true, optNone }, - { "data_store", &RPCHandler::doDataStore, true, optNone }, -#endif - // Evented methods { "subscribe", &RPCHandler::doSubscribe, false, optNone }, { "unsubscribe", &RPCHandler::doUnsubscribe, false, optNone }, diff --git a/src/ripple_app/rpc/RPCHandler.h b/src/ripple_app/rpc/RPCHandler.h index c343271ee..257f18765 100644 --- a/src/ripple_app/rpc/RPCHandler.h +++ b/src/ripple_app/rpc/RPCHandler.h @@ -165,13 +165,6 @@ private: Json::Value doWalletUnlock (Json::Value params, Resource::Charge& loadType, Application::ScopedLockType& mlh); Json::Value doWalletVerify (Json::Value params, Resource::Charge& loadType, Application::ScopedLockType& mlh); -#if ENABLE_INSECURE - Json::Value doDataDelete (Json::Value params, Resource::Charge& loadType, Application::ScopedLockType& mlh); - Json::Value doDataFetch (Json::Value params, Resource::Charge& loadType, Application::ScopedLockType& mlh); - Json::Value doDataStore (Json::Value params, Resource::Charge& loadType, Application::ScopedLockType& mlh); - Json::Value doLogin (Json::Value params, Resource::Charge& loadType, Application::ScopedLockType& mlh); -#endif - private: NetworkOPs* mNetOps; InfoSub::pointer mInfoSub; diff --git a/src/ripple_core/functional/Config.h b/src/ripple_core/functional/Config.h index b8f1e578d..31964ebf5 100644 --- a/src/ripple_core/functional/Config.h +++ b/src/ripple_core/functional/Config.h @@ -33,9 +33,6 @@ namespace ripple { #define SYSTEM_CURRENCY_PARTS 1000000ull // 10^SYSTEM_CURRENCY_PRECISION #define SYSTEM_CURRENCY_START (SYSTEM_CURRENCY_GIFT*SYSTEM_CURRENCY_USERS*SYSTEM_CURRENCY_PARTS) -// VFALCO NOTE Set this to 1 to enable code which is unnecessary -#define ENABLE_INSECURE 0 - const int DOMAIN_BYTES_MAX = 256; const int PUBLIC_BYTES_MAX = 33; // Maximum bytes for an account public key. diff --git a/src/ripple_net/rpc/RPCCall.cpp b/src/ripple_net/rpc/RPCCall.cpp index 5bc17da59..d2ebd501c 100644 --- a/src/ripple_net/rpc/RPCCall.cpp +++ b/src/ripple_net/rpc/RPCCall.cpp @@ -332,43 +332,6 @@ private: return jvRequest; } - #if ENABLE_INSECURE - // data_delete - Json::Value parseDataDelete (const Json::Value& jvParams) - { - Json::Value jvRequest (Json::objectValue); - - jvRequest["key"] = jvParams[0u].asString (); - - return jvRequest; - } - #endif - - #if ENABLE_INSECURE - // data_fetch - Json::Value parseDataFetch (const Json::Value& jvParams) - { - Json::Value jvRequest (Json::objectValue); - - jvRequest["key"] = jvParams[0u].asString (); - - return jvRequest; - } - #endif - - #if ENABLE_INSECURE - // data_store - Json::Value parseDataStore (const Json::Value& jvParams) - { - Json::Value jvRequest (Json::objectValue); - - jvRequest["key"] = jvParams[0u].asString (); - jvRequest["value"] = jvParams[1u].asString (); - - return jvRequest; - } - #endif - // Return an error for attemping to subscribe/unsubscribe via RPC. Json::Value parseEvented (const Json::Value& jvParams) { @@ -461,19 +424,6 @@ private: return jvRequest; } - #if ENABLE_INSECURE - // login - Json::Value parseLogin (const Json::Value& jvParams) - { - Json::Value jvRequest (Json::objectValue); - - jvRequest["username"] = jvParams[0u].asString (); - jvRequest["password"] = jvParams[1u].asString (); - - return jvRequest; - } - #endif - // log_level: Get log levels // log_level : Set master log level to the specified severity // log_level : Set specified partition to specified severity @@ -901,14 +851,6 @@ public: { "wallet_seed", &RPCParser::parseWalletSeed, 0, 1 }, { "internal", &RPCParser::parseInternal, 1, -1 }, - #if ENABLE_INSECURE - // XXX Unnecessary commands which should be removed. - { "login", &RPCParser::parseLogin, 2, 2 }, - { "data_delete", &RPCParser::parseDataDelete, 1, 1 }, - { "data_fetch", &RPCParser::parseDataFetch, 1, 1 }, - { "data_store", &RPCParser::parseDataStore, 2, 2 }, - #endif - // Evented methods { "path_find", &RPCParser::parseEvented, -1, -1 }, { "subscribe", &RPCParser::parseEvented, -1, -1 },