rpc: hide ZMQ request contents in restricted mode

This commit is contained in:
selsta
2026-07-25 14:16:12 +02:00
parent 8472d8c503
commit 4ee81cfb73
5 changed files with 11 additions and 6 deletions
+6 -2
View File
@@ -99,8 +99,9 @@ namespace
namespace rpc
{
ZmqServer::ZmqServer(RpcHandler& h) :
ZmqServer::ZmqServer(RpcHandler& h, const bool restricted) :
handler(h),
restricted(restricted),
context(zmq_init(num_zmq_threads)),
rep_socket(nullptr),
pub_socket(nullptr),
@@ -174,7 +175,10 @@ void ZmqServer::serve()
}
else // no errors
{
MDEBUG("Received RPC request: \"" << *message << "\"");
if (restricted)
MDEBUG("Received RPC request");
else
MDEBUG("Received RPC request: \"" << *message << "\"");
epee::byte_slice response = handler.handle(std::move(*message));
const boost::string_ref response_view{reinterpret_cast<const char*>(response.data()), response.size()};
+2 -1
View File
@@ -51,7 +51,7 @@ class ZmqServer final
{
public:
ZmqServer(RpcHandler& h);
ZmqServer(RpcHandler& h, bool restricted);
~ZmqServer();
@@ -68,6 +68,7 @@ class ZmqServer final
private:
RpcHandler& handler;
const bool restricted;
net::zmq::context context;