Add option to set X-User header value for forwarded requests (#1425)

Fixes #1422.
This commit is contained in:
Sergey Kuznetsov
2024-06-11 17:59:10 +01:00
committed by GitHub
parent 9d3b4f0313
commit 56ab943be5
20 changed files with 205 additions and 62 deletions

View File

@@ -93,7 +93,7 @@ public:
auto toForward = ctx.params;
toForward["command"] = ctx.method;
auto res = balancer_->forwardToRippled(toForward, ctx.clientIp, ctx.yield);
auto res = balancer_->forwardToRippled(toForward, ctx.clientIp, ctx.isAdmin, ctx.yield);
if (not res) {
notifyFailedToForward(ctx.method);
return Result{Status{RippledError::rpcFAILED_TO_FORWARD}};

View File

@@ -222,7 +222,7 @@ public:
}
auto const serverInfoRippled =
balancer_->forwardToRippled({{"command", "server_info"}}, ctx.clientIp, ctx.yield);
balancer_->forwardToRippled({{"command", "server_info"}}, ctx.clientIp, ctx.isAdmin, ctx.yield);
if (serverInfoRippled && !serverInfoRippled->contains(JS(error))) {
if (serverInfoRippled->contains(JS(result)) &&