From 2b7f3eb6e9fce24a2efe5c86f2829d0561b2b0e4 Mon Sep 17 00:00:00 2001 From: Marlene Marz Date: Sun, 17 Nov 2024 11:26:23 +0100 Subject: [PATCH 1/2] remove host whitelist in docker compose Signed-off-by: Marlene Marz --- benchmark/docker-compose.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/benchmark/docker-compose.yml b/benchmark/docker-compose.yml index a62afa7b151..c4054e1a21c 100644 --- a/benchmark/docker-compose.yml +++ b/benchmark/docker-compose.yml @@ -66,7 +66,6 @@ services: - --rpc-ws-enabled - --rpc-ws-apis=admin,eth,miner,web3,net,priv,eea - --rpc-ws-host=0.0.0.0 - - --host-whitelist=* - --graphql-http-enabled - --discovery-enabled=false - --privacy-enabled=true @@ -84,7 +83,6 @@ services: - --rpc-ws-enabled - --rpc-ws-apis=admin,eth,miner,web3,net,priv,eea - --rpc-ws-host=0.0.0.0 - - --host-whitelist=* - --graphql-http-enabled - --discovery-enabled=false - --privacy-enabled=true From d6a44203ae297692a770016ad8080b5157fe869d Mon Sep 17 00:00:00 2001 From: Marlene Marz Date: Sun, 17 Nov 2024 11:26:58 +0100 Subject: [PATCH 2/2] remove host whitelist tests Signed-off-by: Marlene Marz --- .../org/hyperledger/besu/cli/BesuCommand.java | 8 ----- .../besu/cli/HostAllowlistOptionsTest.java | 35 ------------------- 2 files changed, 43 deletions(-) diff --git a/besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java b/besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java index 8f4a1472fb3..6ecc22cecdb 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java @@ -592,14 +592,6 @@ static class PrivacyOptionGroup { defaultValue = "localhost,127.0.0.1") private final JsonRPCAllowlistHostsProperty hostsAllowlist = new JsonRPCAllowlistHostsProperty(); - @Option( - names = {"--host-whitelist"}, - hidden = true, - paramLabel = "[,...]... or * or all", - description = - "Deprecated in favor of --host-allowlist. Comma separated list of hostnames to allow for RPC access, or * to accept any host (default: ${DEFAULT-VALUE})") - private final JsonRPCAllowlistHostsProperty hostsWhitelist = new JsonRPCAllowlistHostsProperty(); - @SuppressWarnings({"FieldCanBeFinal", "FieldMayBeFinal"}) @Option( names = {"--color-enabled"}, diff --git a/besu/src/test/java/org/hyperledger/besu/cli/HostAllowlistOptionsTest.java b/besu/src/test/java/org/hyperledger/besu/cli/HostAllowlistOptionsTest.java index c1f867f4892..21dd587ce7f 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/HostAllowlistOptionsTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/HostAllowlistOptionsTest.java @@ -23,24 +23,6 @@ public class HostAllowlistOptionsTest extends CommandTestAbstract { - /** test deprecated CLI option * */ - @Deprecated - @Test - public void rpcHttpHostWhitelistAcceptsSingleArgument() { - parseCommand("--host-whitelist", "a"); - - verify(mockRunnerBuilder).jsonRpcConfiguration(jsonRpcConfigArgumentCaptor.capture()); - verify(mockRunnerBuilder).build(); - - assertThat(jsonRpcConfigArgumentCaptor.getValue().getHostsAllowlist().size()).isEqualTo(1); - assertThat(jsonRpcConfigArgumentCaptor.getValue().getHostsAllowlist()).contains("a"); - assertThat(jsonRpcConfigArgumentCaptor.getValue().getHostsAllowlist()) - .doesNotContain("localhost"); - - assertThat(commandOutput.toString(UTF_8)).isEmpty(); - assertThat(commandErrorOutput.toString(UTF_8)).isEmpty(); - } - @Test public void rpcHttpHostAllowlistAcceptsSingleArgument() { parseCommand("--host-allowlist", "a"); @@ -89,23 +71,6 @@ public void rpcHttpHostAllowlistAcceptsDoubleComma() { assertThat(commandErrorOutput.toString(UTF_8)).isEmpty(); } - @Deprecated - @Test - public void rpcHttpHostWhitelistAllowlistAcceptsMultipleFlags() { - parseCommand("--host-whitelist=a", "--host-allowlist=b"); - - verify(mockRunnerBuilder).jsonRpcConfiguration(jsonRpcConfigArgumentCaptor.capture()); - verify(mockRunnerBuilder).build(); - - assertThat(jsonRpcConfigArgumentCaptor.getValue().getHostsAllowlist().size()).isEqualTo(2); - assertThat(jsonRpcConfigArgumentCaptor.getValue().getHostsAllowlist()).contains("a", "b"); - assertThat(jsonRpcConfigArgumentCaptor.getValue().getHostsAllowlist()) - .doesNotContain("*", "localhost"); - - assertThat(commandOutput.toString(UTF_8)).isEmpty(); - assertThat(commandErrorOutput.toString(UTF_8)).isEmpty(); - } - @Test public void rpcHttpHostAllowlistAcceptsMultipleFlags() { parseCommand("--host-allowlist=a", "--host-allowlist=b");