Add new settings to disable individual public apis
-All coind + extended public api calls can now be enabled/disabled individually via settings.json; Disabled apis still work internally when disabled; The only noteworthy exception is the extended /ext/getlasttxs endpoint which is the only extended api consumed by the explorer itself, although it works to prevent outside access by default, it is controlled by http headers which can be manipulated and it's extremely likely that a savvy user could enable usage of /ext/getlasttxs for their own needs even if the site has specifically disabled that public api. More thought may be needed to properly resolve that problem, but it may also not be a big deal since it's data that is available to the explorer and in no way hidden or secret -Disabled apis do not show up on the /info page and will return a "This method is disabled" msg if the endpoint is called -Applied some code formatting to the /lib/nodeapi.js file
This commit is contained in:
@@ -189,6 +189,40 @@ exports.corsorigin = "*";
|
||||
exports.labels = {};
|
||||
exports.burned_coins = [];
|
||||
|
||||
// Enable/disable the use of specific public apis
|
||||
exports.public_api = {
|
||||
"rpc": {
|
||||
"getdifficulty": true,
|
||||
"getconnectioncount": true,
|
||||
"getblockcount": true,
|
||||
"getblockhash": true,
|
||||
"getblock": true,
|
||||
"getrawtransaction": true,
|
||||
"getnetworkhashps": true,
|
||||
"getvotelist": true,
|
||||
"getmasternodecount": true,
|
||||
"getmasternodelist": true,
|
||||
"getmaxmoney": true,
|
||||
"getmaxvote": true,
|
||||
"getvote": true,
|
||||
"getphase": true,
|
||||
"getreward": true,
|
||||
"getsupply": true,
|
||||
"getnextrewardestimate": true,
|
||||
"getnextrewardwhenstr": true
|
||||
},
|
||||
"ext": {
|
||||
"getmoneysupply": true,
|
||||
"getdistribution": true,
|
||||
"getaddress": true,
|
||||
"gettx": true,
|
||||
"getbalance": true,
|
||||
"getlasttxs": true,
|
||||
"getcurrentprice": true,
|
||||
"getbasicstats": true
|
||||
}
|
||||
};
|
||||
|
||||
// Customized API commands
|
||||
exports.api_cmds = {
|
||||
"getnetworkhashps": "getnetworkhashps",
|
||||
|
||||
Reference in New Issue
Block a user