Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
httprpc.cpp File Reference
#include <httprpc.h>
#include <common/args.h>
#include <crypto/hmac_sha256.h>
#include <httpserver.h>
#include <logging.h>
#include <netaddress.h>
#include <rpc/protocol.h>
#include <rpc/server.h>
#include <util/fs.h>
#include <util/fs_helpers.h>
#include <util/strencodings.h>
#include <util/string.h>
#include <walletinitinterface.h>
#include <algorithm>
#include <iterator>
#include <map>
#include <memory>
#include <optional>
#include <set>
#include <string>
#include <vector>
Include dependency graph for httprpc.cpp:

Go to the source code of this file.

Functions

static void JSONErrorReply (HTTPRequest *req, UniValue objError, const JSONRPCRequest &jreq)
static bool CheckUserAuthorized (std::string_view user, std::string_view pass)
static bool RPCAuthorized (const std::string &strAuth, std::string &strAuthUsernameOut)
static bool HTTPReq_JSONRPC (const std::any &context, HTTPRequest *req)
static bool InitRPCAuthentication ()
bool StartHTTPRPC (const std::any &context)
 Start HTTP RPC subsystem.
void InterruptHTTPRPC ()
 Interrupt HTTP RPC subsystem.
void StopHTTPRPC ()
 Stop HTTP RPC subsystem.
std::vector< std::string > SplitString (std::string_view str, char sep)
std::string_view TrimStringView (std::string_view str, std::string_view pattern=" \f\n\r\t\v")

Variables

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

Function Documentation

◆ CheckUserAuthorized()

bool CheckUserAuthorized ( std::string_view user,
std::string_view pass )
static

Definition at line 63 of file httprpc.cpp.

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

◆ HTTPReq_JSONRPC()

bool HTTPReq_JSONRPC ( const std::any & context,
HTTPRequest * req )
static

Definition at line 104 of file httprpc.cpp.

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

◆ InitRPCAuthentication()

bool InitRPCAuthentication ( )
static

Definition at line 240 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 347 of file httprpc.cpp.

Here is the caller graph for this function:

◆ JSONErrorReply()

void JSONErrorReply ( HTTPRequest * req,
UniValue objError,
const JSONRPCRequest & jreq )
static

Definition at line 41 of file httprpc.cpp.

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

◆ RPCAuthorized()

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

Definition at line 84 of file httprpc.cpp.

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

◆ SplitString()

std::vector< std::string > util::SplitString ( std::string_view str,
char sep )
inlinenodiscard

Definition at line 149 of file string.h.

Here is the caller graph for this function:

◆ StartHTTPRPC()

bool StartHTTPRPC ( const std::any & context)

Start HTTP RPC subsystem.

Precondition; HTTP and RPC has been started.

Definition at line 331 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 352 of file httprpc.cpp.

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

◆ TrimStringView()

std::string_view util::TrimStringView ( std::string_view str,
std::string_view pattern = " \f\n\r\t\v" )
inlinenodiscard

Definition at line 159 of file string.h.

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 38 of file httprpc.cpp.

◆ g_rpc_whitelist_default

bool g_rpc_whitelist_default = false
static

Definition at line 39 of file httprpc.cpp.

◆ g_rpcauth

std::vector<std::vector<std::string> > g_rpcauth
static

Definition at line 36 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 33 of file httprpc.cpp.