mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
feat: allow port_grpc to be specified in [server] stanza (#4728)
Prior to this commit, `port_grpc` could not be added to the [server] stanza. Instead of validating gRPC IP/Port/Protocol information in ServerHandler, validate grpc port info in GRPCServer constructor. This should not break backwards compatibility. gRPC-related config info must be in a section (stanza) called [port_gprc]. * Close #4015 - That was an alternate solution. It was decided that with relaxed validation, it is not necessary to rename port_grpc. * Fix #4557
This commit is contained in:
committed by
GitHub
parent
1e96a1d6eb
commit
6d3c21e369
@@ -22,6 +22,7 @@
|
||||
#include <ripple/beast/unit_test.h>
|
||||
#include <ripple/rpc/impl/Tuning.h>
|
||||
|
||||
#include <ripple/core/ConfigSections.h>
|
||||
#include <test/jtx.h>
|
||||
#include <test/jtx/Env.h>
|
||||
#include <test/jtx/envconfig.h>
|
||||
@@ -56,7 +57,8 @@ class ReportingETL_test : public beast::unit_test::suite
|
||||
testcase("GetLedger");
|
||||
using namespace test::jtx;
|
||||
std::unique_ptr<Config> config = envconfig(addGrpcConfig);
|
||||
std::string grpcPort = *(*config)["port_grpc"].get<std::string>("port");
|
||||
std::string grpcPort =
|
||||
*(*config)[SECTION_PORT_GRPC].get<std::string>("port");
|
||||
Env env(*this, std::move(config));
|
||||
|
||||
env.close();
|
||||
@@ -498,7 +500,8 @@ class ReportingETL_test : public beast::unit_test::suite
|
||||
testcase("GetLedgerData");
|
||||
using namespace test::jtx;
|
||||
std::unique_ptr<Config> config = envconfig(addGrpcConfig);
|
||||
std::string grpcPort = *(*config)["port_grpc"].get<std::string>("port");
|
||||
std::string grpcPort =
|
||||
*(*config)[SECTION_PORT_GRPC].get<std::string>("port");
|
||||
Env env(*this, std::move(config));
|
||||
auto grpcLedgerData = [&grpcPort](
|
||||
auto sequence, std::string marker = "") {
|
||||
@@ -620,7 +623,8 @@ class ReportingETL_test : public beast::unit_test::suite
|
||||
testcase("GetLedgerDiff");
|
||||
using namespace test::jtx;
|
||||
std::unique_ptr<Config> config = envconfig(addGrpcConfig);
|
||||
std::string grpcPort = *(*config)["port_grpc"].get<std::string>("port");
|
||||
std::string grpcPort =
|
||||
*(*config)[SECTION_PORT_GRPC].get<std::string>("port");
|
||||
Env env(*this, std::move(config));
|
||||
|
||||
auto grpcLedgerDiff = [&grpcPort](
|
||||
@@ -735,7 +739,8 @@ class ReportingETL_test : public beast::unit_test::suite
|
||||
testcase("GetLedgerDiff");
|
||||
using namespace test::jtx;
|
||||
std::unique_ptr<Config> config = envconfig(addGrpcConfig);
|
||||
std::string grpcPort = *(*config)["port_grpc"].get<std::string>("port");
|
||||
std::string grpcPort =
|
||||
*(*config)[SECTION_PORT_GRPC].get<std::string>("port");
|
||||
Env env(*this, std::move(config));
|
||||
|
||||
auto grpcLedgerEntry = [&grpcPort](auto sequence, auto key) {
|
||||
@@ -895,7 +900,7 @@ class ReportingETL_test : public beast::unit_test::suite
|
||||
std::unique_ptr<Config> config = envconfig(
|
||||
addGrpcConfigWithSecureGateway, getEnvLocalhostAddr());
|
||||
std::string grpcPort =
|
||||
*(*config)["port_grpc"].get<std::string>("port");
|
||||
*(*config)[SECTION_PORT_GRPC].get<std::string>("port");
|
||||
Env env(*this, std::move(config));
|
||||
|
||||
env.close();
|
||||
@@ -955,7 +960,7 @@ class ReportingETL_test : public beast::unit_test::suite
|
||||
std::unique_ptr<Config> config =
|
||||
envconfig(addGrpcConfigWithSecureGateway, secureGatewayIp);
|
||||
std::string grpcPort =
|
||||
*(*config)["port_grpc"].get<std::string>("port");
|
||||
*(*config)[SECTION_PORT_GRPC].get<std::string>("port");
|
||||
Env env(*this, std::move(config));
|
||||
|
||||
env.close();
|
||||
@@ -1008,7 +1013,7 @@ class ReportingETL_test : public beast::unit_test::suite
|
||||
std::unique_ptr<Config> config = envconfig(
|
||||
addGrpcConfigWithSecureGateway, getEnvLocalhostAddr());
|
||||
std::string grpcPort =
|
||||
*(*config)["port_grpc"].get<std::string>("port");
|
||||
*(*config)[SECTION_PORT_GRPC].get<std::string>("port");
|
||||
Env env(*this, std::move(config));
|
||||
|
||||
env.close();
|
||||
@@ -1065,7 +1070,7 @@ class ReportingETL_test : public beast::unit_test::suite
|
||||
std::unique_ptr<Config> config =
|
||||
envconfig(addGrpcConfigWithSecureGateway, secureGatewayIp);
|
||||
std::string grpcPort =
|
||||
*(*config)["port_grpc"].get<std::string>("port");
|
||||
*(*config)[SECTION_PORT_GRPC].get<std::string>("port");
|
||||
Env env(*this, std::move(config));
|
||||
|
||||
env.close();
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <ripple/app/misc/NetworkOPs.h>
|
||||
#include <ripple/beast/unit_test.h>
|
||||
#include <ripple/core/ConfigSections.h>
|
||||
#include <ripple/protocol/jss.h>
|
||||
#include <test/jtx.h>
|
||||
|
||||
@@ -107,7 +108,7 @@ admin = 127.0.0.1
|
||||
auto const rpc_port =
|
||||
(*config)["port_rpc"].get<unsigned int>("port");
|
||||
auto const grpc_port =
|
||||
(*config)["port_grpc"].get<unsigned int>("port");
|
||||
(*config)[SECTION_PORT_GRPC].get<unsigned int>("port");
|
||||
auto const ws_port = (*config)["port_ws"].get<unsigned int>("port");
|
||||
BEAST_EXPECT(grpc_port);
|
||||
BEAST_EXPECT(rpc_port);
|
||||
|
||||
Reference in New Issue
Block a user