diff options
author | woodser <woodser@protonmail.com> | 2022-01-17 17:03:56 -0500 |
---|---|---|
committer | woodser <woodser@protonmail.com> | 2022-01-17 17:03:56 -0500 |
commit | fb5b2b352a97fbc3d784312b6e42da791cfe4b28 (patch) | |
tree | 67865b2b344dbe938f7b8aa4c3ad8af898823a7b /src/wallet/wallet_rpc_server.cpp | |
parent | Merge pull request #8103 (diff) | |
download | monero-fb5b2b352a97fbc3d784312b6e42da791cfe4b28.tar.xz |
support authentication in monero-wallet-rpc set_daemon
Diffstat (limited to 'src/wallet/wallet_rpc_server.cpp')
-rw-r--r-- | src/wallet/wallet_rpc_server.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index 4655e24cd..76b02b244 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -4426,7 +4426,11 @@ namespace tools 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.message = std::string("Unable to set daemon"); |