Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
#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>
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< HTTPRPCTimerInterface > | httpRPCTimerInterface |
Function Documentation
◆ HTTPReq_JSONRPC()
|
static |
Definition at line 147 of file httprpc.cpp.
References JSONRPCRequest::authUser, CRPCTable::execute(), UniValue::get_array(), HTTPRequest::GetHeader(), HTTPRequest::GetPeer(), HTTPRequest::GetRequestMethod(), HTTPRequest::GetURI(), HTTP_BAD_METHOD, HTTP_OK, HTTP_UNAUTHORIZED, JSONRPCRequest::id, UniValue::isArray(), UniValue::isObject(), JSONErrorReply(), JSONRPCError(), JSONRPCExecBatch(), JSONRPCReply(), LogPrintf, MilliSleep(), NullUniValue, JSONRPCRequest::parse(), HTTPRequest::POST, UniValue::read(), HTTPRequest::ReadBody(), RPC_PARSE_ERROR, RPCAuthorized(), tableRPC, CService::ToString(), JSONRPCRequest::URI, HTTPRequest::WriteHeader(), HTTPRequest::WriteReply(), and WWW_AUTH_HEADER_DATA.
Referenced by StartHTTPRPC().
◆ InitRPCAuthentication()
|
static |
Definition at line 213 of file httprpc.cpp.
References _(), gArgs, GenerateAuthCookie(), ArgsManager::GetArg(), LogPrintf, CClientUIInterface::MSG_ERROR, strRPCUserColonPass, CClientUIInterface::ThreadSafeMessageBox, and uiInterface.
Referenced by StartHTTPRPC().
◆ InterruptHTTPRPC()
void InterruptHTTPRPC | ( | ) |
Interrupt HTTP RPC subsystem.
Definition at line 248 of file httprpc.cpp.
References LogPrint, and BCLog::RPC.
Referenced by Interrupt().
◆ JSONErrorReply()
|
static |
Definition at line 69 of file httprpc.cpp.
References find_value(), UniValue::get_int(), HTTP_BAD_REQUEST, HTTP_INTERNAL_SERVER_ERROR, HTTP_NOT_FOUND, JSONRPCReply(), NullUniValue, RPC_INVALID_REQUEST, RPC_METHOD_NOT_FOUND, HTTPRequest::WriteHeader(), and HTTPRequest::WriteReply().
Referenced by HTTPReq_JSONRPC().
◆ multiUserAuthorized()
|
static |
Definition at line 88 of file httprpc.cpp.
References gArgs, ArgsManager::GetArgs(), HexStr(), and TimingResistantEqual().
Referenced by RPCAuthorized().
◆ RPCAuthorized()
|
static |
Definition at line 127 of file httprpc.cpp.
References DecodeBase64(), multiUserAuthorized(), strRPCUserColonPass, and TimingResistantEqual().
Referenced by HTTPReq_JSONRPC().
◆ 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
|
static |
Definition at line 67 of file httprpc.cpp.
Referenced by StartHTTPRPC(), and StopHTTPRPC().
◆ strRPCUserColonPass
|
static |
Definition at line 65 of file httprpc.cpp.
Referenced by CallRPC(), InitRPCAuthentication(), and RPCAuthorized().
◆ WWW_AUTH_HEADER_DATA
|
static |
WWW-Authenticate to present with 401 Unauthorized response.
Definition at line 25 of file httprpc.cpp.
Referenced by HTTPReq_JSONRPC().