Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

httprpc.cpp File Reference
#include <httprpc.h>
#include <base58.h>
#include <chainparams.h>
#include <httpserver.h>
#include <rpc/protocol.h>
#include <rpc/server.h>
#include <random.h>
#include <sync.h>
#include <util.h>
#include <utilstrencodings.h>
#include <ui_interface.h>
#include <crypto/hmac_sha256.h>
#include <stdio.h>
#include <memory>
#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 (HTTPRequest *req, const std::string &)
 
static bool InitRPCAuthentication ()
 
bool StartHTTPRPC ()
 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
 

Function Documentation

◆ HTTPReq_JSONRPC()

◆ InitRPCAuthentication()

static bool InitRPCAuthentication ( )
static

◆ InterruptHTTPRPC()

void InterruptHTTPRPC ( )

Interrupt HTTP RPC subsystem.

Definition at line 248 of file httprpc.cpp.

References LogPrint, and BCLog::RPC.

Referenced by Interrupt().

◆ JSONErrorReply()

◆ multiUserAuthorized()

static bool multiUserAuthorized ( std::string  strUserPass)
static

Definition at line 88 of file httprpc.cpp.

References gArgs, ArgsManager::GetArgs(), HexStr(), and TimingResistantEqual().

Referenced by RPCAuthorized().

◆ RPCAuthorized()

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

◆ StartHTTPRPC()

bool StartHTTPRPC ( )

Start HTTP RPC subsystem.

Precondition; HTTP and RPC has been started.

Definition at line 231 of file httprpc.cpp.

References EventBase(), HTTPReq_JSONRPC(), httpRPCTimerInterface, InitRPCAuthentication(), LogPrint, RegisterHTTPHandler(), BCLog::RPC, and RPCSetTimerInterface().

Referenced by AppInitServers().

◆ StopHTTPRPC()

void StopHTTPRPC ( )

Stop HTTP RPC subsystem.

Precondition; HTTP and RPC has been stopped.

Definition at line 253 of file httprpc.cpp.

References httpRPCTimerInterface, LogPrint, BCLog::RPC, RPCUnsetTimerInterface(), and UnregisterHTTPHandler().

Referenced by PrepareShutdown().

Variable Documentation

◆ httpRPCTimerInterface

std::unique_ptr<HTTPRPCTimerInterface> httpRPCTimerInterface
static

Definition at line 67 of file httprpc.cpp.

Referenced by StartHTTPRPC(), and StopHTTPRPC().

◆ strRPCUserColonPass

std::string strRPCUserColonPass
static

Definition at line 65 of file httprpc.cpp.

Referenced by CallRPC(), InitRPCAuthentication(), and RPCAuthorized().

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

Referenced by HTTPReq_JSONRPC().

Released under the MIT license