Bitcoin Core  0.20.99
P2P Digital Currency
Classes | Functions | Variables
httprpc.cpp File Reference
#include <httprpc.h>
#include <chainparams.h>
#include <crypto/hmac_sha256.h>
#include <httpserver.h>
#include <rpc/protocol.h>
#include <rpc/server.h>
#include <util/strencodings.h>
#include <util/system.h>
#include <util/translation.h>
#include <walletinitinterface.h>
#include <algorithm>
#include <iterator>
#include <map>
#include <memory>
#include <stdio.h>
#include <set>
#include <string>
#include <boost/algorithm/string.hpp>
Include dependency graph for httprpc.cpp:

Go to the source code of this file.

Classes

class  HTTPRPCTimer
 Simple one-shot callback timer to be used by the RPC mechanism to e.g. More...
 
class  HTTPRPCTimerInterface
 

Functions

static void JSONErrorReply (HTTPRequest *req, const UniValue &objError, const UniValue &id)
 
static bool multiUserAuthorized (std::string strUserPass)
 
static bool RPCAuthorized (const std::string &strAuth, std::string &strAuthUsernameOut)
 
static bool HTTPReq_JSONRPC (const util::Ref &context, HTTPRequest *req)
 
static bool InitRPCAuthentication ()
 
bool StartHTTPRPC (const util::Ref &context)
 Start HTTP RPC subsystem. More...
 
void InterruptHTTPRPC ()
 Interrupt HTTP RPC subsystem. More...
 
void StopHTTPRPC ()
 Stop HTTP RPC subsystem. More...
 

Variables

static const char * WWW_AUTH_HEADER_DATA = "Basic realm=\"jsonrpc\""
 WWW-Authenticate to present with 401 Unauthorized response. More...
 
static std::string strRPCUserColonPass
 
static std::unique_ptr< HTTPRPCTimerInterfacehttpRPCTimerInterface
 
static std::map< std::string, std::set< std::string > > g_rpc_whitelist
 
static bool g_rpc_whitelist_default = false
 

Function Documentation

◆ HTTPReq_JSONRPC()

static bool HTTPReq_JSONRPC ( const util::Ref context,
HTTPRequest req 
)
static

Definition at line 153 of file httprpc.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitRPCAuthentication()

static bool InitRPCAuthentication ( )
static

Definition at line 247 of file httprpc.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InterruptHTTPRPC()

void InterruptHTTPRPC ( )

Interrupt HTTP RPC subsystem.

Definition at line 305 of file httprpc.cpp.

Here is the caller graph for this function:

◆ JSONErrorReply()

static void JSONErrorReply ( HTTPRequest req,
const UniValue objError,
const UniValue id 
)
static

Definition at line 75 of file httprpc.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ multiUserAuthorized()

static bool multiUserAuthorized ( std::string  strUserPass)
static

Definition at line 94 of file httprpc.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RPCAuthorized()

static bool RPCAuthorized ( const std::string &  strAuth,
std::string &  strAuthUsernameOut 
)
static

Definition at line 133 of file httprpc.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StartHTTPRPC()

bool StartHTTPRPC ( const util::Ref context)

Start HTTP RPC subsystem.

Precondition; HTTP and RPC has been started.

Definition at line 287 of file httprpc.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StopHTTPRPC()

void StopHTTPRPC ( )

Stop HTTP RPC subsystem.

Precondition; HTTP and RPC has been stopped.

Definition at line 310 of file httprpc.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ g_rpc_whitelist

std::map<std::string, std::set<std::string> > g_rpc_whitelist
static

Definition at line 72 of file httprpc.cpp.

◆ g_rpc_whitelist_default

bool g_rpc_whitelist_default = false
static

Definition at line 73 of file httprpc.cpp.

◆ httpRPCTimerInterface

std::unique_ptr<HTTPRPCTimerInterface> httpRPCTimerInterface
static

Definition at line 70 of file httprpc.cpp.

◆ strRPCUserColonPass

std::string strRPCUserColonPass
static

Definition at line 68 of file httprpc.cpp.

◆ WWW_AUTH_HEADER_DATA

const char* WWW_AUTH_HEADER_DATA = "Basic realm=\"jsonrpc\""
static

WWW-Authenticate to present with 401 Unauthorized response.

Definition at line 28 of file httprpc.cpp.