support authentication in monero-wallet-rpc set_daemon
This commit is contained in:
parent
319b831e65
commit
fb5b2b352a
|
@ -4426,7 +4426,11 @@ namespace tools
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_wallet->set_daemon(req.address, boost::none, req.trusted, std::move(ssl_options)))
|
boost::optional<epee::net_utils::http::login> daemon_login{};
|
||||||
|
if (!req.username.empty() || !req.password.empty())
|
||||||
|
daemon_login.emplace(req.username, req.password);
|
||||||
|
|
||||||
|
if (!m_wallet->set_daemon(req.address, daemon_login, req.trusted, std::move(ssl_options)))
|
||||||
{
|
{
|
||||||
er.code = WALLET_RPC_ERROR_CODE_NO_DAEMON_CONNECTION;
|
er.code = WALLET_RPC_ERROR_CODE_NO_DAEMON_CONNECTION;
|
||||||
er.message = std::string("Unable to set daemon");
|
er.message = std::string("Unable to set daemon");
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
// advance which version they will stop working with
|
// advance which version they will stop working with
|
||||||
// Don't go over 32767 for any of these
|
// Don't go over 32767 for any of these
|
||||||
#define WALLET_RPC_VERSION_MAJOR 1
|
#define WALLET_RPC_VERSION_MAJOR 1
|
||||||
#define WALLET_RPC_VERSION_MINOR 23
|
#define WALLET_RPC_VERSION_MINOR 24
|
||||||
#define MAKE_WALLET_RPC_VERSION(major,minor) (((major)<<16)|(minor))
|
#define MAKE_WALLET_RPC_VERSION(major,minor) (((major)<<16)|(minor))
|
||||||
#define WALLET_RPC_VERSION MAKE_WALLET_RPC_VERSION(WALLET_RPC_VERSION_MAJOR, WALLET_RPC_VERSION_MINOR)
|
#define WALLET_RPC_VERSION MAKE_WALLET_RPC_VERSION(WALLET_RPC_VERSION_MAJOR, WALLET_RPC_VERSION_MINOR)
|
||||||
namespace tools
|
namespace tools
|
||||||
|
@ -2664,6 +2664,8 @@ namespace wallet_rpc
|
||||||
struct request_t
|
struct request_t
|
||||||
{
|
{
|
||||||
std::string address;
|
std::string address;
|
||||||
|
std::string username;
|
||||||
|
std::string password;
|
||||||
bool trusted;
|
bool trusted;
|
||||||
std::string ssl_support; // disabled, enabled, autodetect
|
std::string ssl_support; // disabled, enabled, autodetect
|
||||||
std::string ssl_private_key_path;
|
std::string ssl_private_key_path;
|
||||||
|
@ -2674,6 +2676,8 @@ namespace wallet_rpc
|
||||||
|
|
||||||
BEGIN_KV_SERIALIZE_MAP()
|
BEGIN_KV_SERIALIZE_MAP()
|
||||||
KV_SERIALIZE(address)
|
KV_SERIALIZE(address)
|
||||||
|
KV_SERIALIZE(username)
|
||||||
|
KV_SERIALIZE(password)
|
||||||
KV_SERIALIZE_OPT(trusted, false)
|
KV_SERIALIZE_OPT(trusted, false)
|
||||||
KV_SERIALIZE_OPT(ssl_support, (std::string)"autodetect")
|
KV_SERIALIZE_OPT(ssl_support, (std::string)"autodetect")
|
||||||
KV_SERIALIZE(ssl_private_key_path)
|
KV_SERIALIZE(ssl_private_key_path)
|
||||||
|
|
Loading…
Reference in New Issue