Commit 7626c077 authored by Daniel Edgecumbe's avatar Daniel Edgecumbe

backend: Add unused auth_level to whitelist.rs

parent a8e3d8d2
......@@ -379,7 +379,7 @@ pub fn server_get(x: &str, pool: &PgPool, rpc_auth: &str, rpc_addr: &str) -> Box
// done with weird custom methods now
let (cache_secs, argument_cap) = match WHITELIST.get(method) {
let (cache_secs, argument_cap, _) = match WHITELIST.get(method) {
Some(x) => x,
None => {
log(&format!("FORBIDDEN: {}", x));
......
......@@ -18,44 +18,44 @@
use std::collections::HashMap;
lazy_static! {
pub static ref WHITELIST: HashMap<&'static str, (usize, usize)> =
pub static ref WHITELIST: HashMap<&'static str, (usize, usize, usize)> =
[
// COMMAND CACHE_S ARGS
("logging", (1, 2)), // "include", "exclude"
("getblockchaininfo", (1, 0)),
("getchaintxstats", (1, 2)), // "nblocks", "blockhash"
("getblockstats", (1, 2)), // "hash_or_height", "stats"
("getbestblockhash", (1, 0)),
("getblockcount", (1, 0)),
("getblock", (1, 2)), // "blockhash","verbosity|verbose"
("getblockhash", (1, 1)), // "height"
("getblockheader", (1, 2)), // "blockhash","verbose"
("getchaintips", (1, 0)),
("getdifficulty", (1, 0)),
("getmempoolancestors", (1, 2)), // "txid","verbose"
("getmempooldescendants", (1, 2)), // "txid","verbose"
("getmempoolentry", (1, 1)), // "txid"
("getmempoolinfo", (1, 0)),
("getrawmempool", (1, 1)), // "verbose"
("gettxout", (1, 3)), // "txid","n","include_mempool"
("gettxoutsetinfo", (1, 0)),
("getconnectioncount", (1, 0)),
("ping", (1, 0)),
("getpeerinfo", (1, 0)),
("getnettotals", (1, 0)),
("getnetworkinfo", (1, 0)),
("getnetworkhashps", (1, 2)), // "nblocks","height"
("getmininginfo", (1, 0)),
("getblocktemplate", (1, 1)), // "template_request"
("estimatesmartfee", (1, 2)), // "conf_target", "estimate_mode"
("estimaterawfee", (1, 2)), // "conf_target", "threshold"
("uptime", (1, 0)),
("help", (1, 1)), // "command"
("getwalletinfo", (1, 0)),
("getaddressesbylabel", (1, 1)), // "label"
("getnewaddress", (1, 2)), // "label", "address_type"
("listreceivedbyaddress", (1, 4)), // "minconf", "include_empty", "include_watchonly", "address_filter"
("listtransactions", (1, 4)), // "dummy", "count", "skip", "include_watchonly",
// COMMAND CACHE_S ARGS AUTH
("logging", (1, 2, 0)), // "include", "exclude"
("getblockchaininfo", (1, 0, 0)),
("getchaintxstats", (1, 2, 0)), // "nblocks", "blockhash"
("getblockstats", (1, 2, 0)), // "hash_or_height", "stats"
("getbestblockhash", (1, 0, 0)),
("getblockcount", (1, 0, 0)),
("getblock", (1, 2, 0)), // "blockhash","verbosity|verbose"
("getblockhash", (1, 1, 0)), // "height"
("getblockheader", (1, 2, 0)), // "blockhash","verbose"
("getchaintips", (1, 0, 0)),
("getdifficulty", (1, 0, 0)),
("getmempoolancestors", (1, 2, 0)), // "txid","verbose"
("getmempooldescendants", (1, 2, 0)), // "txid","verbose"
("getmempoolentry", (1, 1, 0)), // "txid"
("getmempoolinfo", (1, 0, 0)),
("getrawmempool", (1, 1, 0)), // "verbose"
("gettxout", (1, 3, 0)), // "txid","n","include_mempool"
("gettxoutsetinfo", (1, 0, 0)),
("getconnectioncount", (1, 0, 0)),
("ping", (1, 0, 0)),
("getpeerinfo", (1, 0, 0)),
("getnettotals", (1, 0, 0)),
("getnetworkinfo", (1, 0, 0)),
("getnetworkhashps", (1, 2, 0)), // "nblocks","height"
("getmininginfo", (1, 0, 0)),
("getblocktemplate", (1, 1, 0)), // "template_request"
("estimatesmartfee", (1, 2, 0)), // "conf_target", "estimate_mode"
("estimaterawfee", (1, 2, 0)), // "conf_target", "threshold"
("uptime", (1, 0, 0)),
("help", (1, 1, 0)), // "command"
("getwalletinfo", (1, 0, 1)),
("getaddressesbylabel", (1, 1, 1)), // "label"
("getnewaddress", (1, 2, 1)), // "label", "address_type"
("listreceivedbyaddress", (1, 4, 1)), // "minconf", "include_empty", "include_watchonly", "address_filter"
("listtransactions", (1, 4, 1)), // "dummy", "count", "skip", "include_watchonly",
]
.iter().cloned().collect();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment