diff --git a/src/cpp/ripple/Config.h b/src/cpp/ripple/Config.h index 849d18852..4d0edf0f9 100644 --- a/src/cpp/ripple/Config.h +++ b/src/cpp/ripple/Config.h @@ -9,6 +9,8 @@ #include #include +#define ENABLE_INSECURE 0 // 1, to enable unnecessary features. + #define SYSTEM_NAME "ripple" #define SYSTEM_CURRENCY_CODE "XRP" #define SYSTEM_CURRENCY_PRECISION 6 diff --git a/src/cpp/ripple/RPCHandler.cpp b/src/cpp/ripple/RPCHandler.cpp index cc64c1280..b73b1c88c 100644 --- a/src/cpp/ripple/RPCHandler.cpp +++ b/src/cpp/ripple/RPCHandler.cpp @@ -304,6 +304,7 @@ Json::Value RPCHandler::doConnect(Json::Value jvRequest) return "connecting"; } +#if ENABLE_INSECURE // { // key: // } @@ -327,7 +328,9 @@ Json::Value RPCHandler::doDataDelete(Json::Value jvRequest) return ret; } +#endif +#if ENABLE_INSECURE // { // key: // } @@ -347,7 +350,9 @@ Json::Value RPCHandler::doDataFetch(Json::Value jvRequest) return ret; } +#endif +#if ENABLE_INSECURE // { // key: // value: @@ -375,6 +380,7 @@ Json::Value RPCHandler::doDataStore(Json::Value jvRequest) return ret; } +#endif #if 0 // XXX Needs to be revised for new paradigm @@ -1569,6 +1575,7 @@ Json::Value RPCHandler::doWalletSeed(Json::Value jvRequest) } } +#if ENABLE_INSECURE // TODO: for now this simply checks if this is the admin account // TODO: need to prevent them hammering this over and over // TODO: maybe a better way is only allow admin from local host @@ -1592,6 +1599,7 @@ Json::Value RPCHandler::doLogin(Json::Value jvRequest) return "nope"; } } +#endif // { // min_count: // optional, defaults to 10 @@ -2456,11 +2464,13 @@ Json::Value RPCHandler::doCommand(Json::Value& jvRequest, int iRole) { "wallet_propose", &RPCHandler::doWalletPropose, false, optNone }, { "wallet_seed", &RPCHandler::doWalletSeed, false, 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 }, diff --git a/src/cpp/ripple/RPCHandler.h b/src/cpp/ripple/RPCHandler.h index a5650a214..bfd99ba1a 100644 --- a/src/cpp/ripple/RPCHandler.h +++ b/src/cpp/ripple/RPCHandler.h @@ -40,9 +40,11 @@ class RPCHandler Json::Value doAccountOffers(Json::Value params); Json::Value doAccountTransactions(Json::Value params); Json::Value doConnect(Json::Value params); +#if ENABLE_INSECURE Json::Value doDataDelete(Json::Value params); Json::Value doDataFetch(Json::Value params); Json::Value doDataStore(Json::Value params); +#endif Json::Value doGetCounts(Json::Value params); Json::Value doLedger(Json::Value params); Json::Value doLogLevel(Json::Value params); @@ -79,7 +81,9 @@ class RPCHandler Json::Value doWalletUnlock(Json::Value params); Json::Value doWalletVerify(Json::Value params); +#if ENABLE_INSECURE Json::Value doLogin(Json::Value params); +#endif Json::Value doLedgerAccept(Json::Value params); Json::Value doLedgerClosed(Json::Value params);