Skip to content

Commit e2bd137

Browse files
pr9tmacfarla
andauthoredDec 11, 2024··
Chore!: Removed Deprecated --host-whitelist option (#8012)
* Chore:Removed Deprecated --host-whitelist option * chore: Update everything_config.toml and Updated upcoming Breaking Change in CHANGELOG.md file Signed-off-by: Preeti <35308865+pr9t@users.noreply.github.com> --------- Signed-off-by: Preeti <35308865+pr9t@users.noreply.github.com> Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
1 parent 7e58f58 commit e2bd137

File tree

5 files changed

+5
-55
lines changed

5 files changed

+5
-55
lines changed
 

‎CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Unreleased
44

55
### Breaking Changes
6+
- `--host-whitelist` has been deprecated since 2020 and its related option will be removed in a future release.
67

78
### Upcoming Breaking Changes
89
- Plugin API will be deprecating the BesuContext interface to be replaced with the ServiceManager interface.
@@ -15,6 +16,8 @@
1516
- Proof of Work consensus
1617
- Fast Sync
1718

19+
20+
1821
### Additions and Improvements
1922
- Retrieve all transaction receipts for a block in one request [#6646](https://github.com/hyperledger/besu/pull/6646)
2023

‎benchmark/docker-compose.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ services:
6666
- --rpc-ws-enabled
6767
- --rpc-ws-apis=admin,eth,miner,web3,net,priv,eea
6868
- --rpc-ws-host=0.0.0.0
69-
- --host-whitelist=*
69+
- --host-allowlist=*
7070
- --graphql-http-enabled
7171
- --discovery-enabled=false
7272
- --privacy-enabled=true
@@ -84,7 +84,7 @@ services:
8484
- --rpc-ws-enabled
8585
- --rpc-ws-apis=admin,eth,miner,web3,net,priv,eea
8686
- --rpc-ws-host=0.0.0.0
87-
- --host-whitelist=*
87+
- --host-allowlist=*
8888
- --graphql-http-enabled
8989
- --discovery-enabled=false
9090
- --privacy-enabled=true

‎besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java

-17
Original file line numberDiff line numberDiff line change
@@ -610,14 +610,6 @@ static class PrivacyOptionGroup {
610610
defaultValue = "localhost,127.0.0.1")
611611
private final JsonRPCAllowlistHostsProperty hostsAllowlist = new JsonRPCAllowlistHostsProperty();
612612

613-
@Option(
614-
names = {"--host-whitelist"},
615-
hidden = true,
616-
paramLabel = "<hostname>[,<hostname>...]... or * or all",
617-
description =
618-
"Deprecated in favor of --host-allowlist. Comma separated list of hostnames to allow for RPC access, or * to accept any host (default: ${DEFAULT-VALUE})")
619-
private final JsonRPCAllowlistHostsProperty hostsWhitelist = new JsonRPCAllowlistHostsProperty();
620-
621613
@SuppressWarnings({"FieldCanBeFinal", "FieldMayBeFinal"})
622614
@Option(
623615
names = {"--color-enabled"},
@@ -1701,15 +1693,6 @@ private void configure() throws Exception {
17011693
unstableIpcOptions.getRpcIpcApis());
17021694
inProcessRpcConfiguration = inProcessRpcOptions.toDomainObject();
17031695
dataStorageConfiguration = getDataStorageConfiguration();
1704-
// hostsWhitelist is a hidden option. If it is specified, add the list to hostAllowlist
1705-
if (!hostsWhitelist.isEmpty()) {
1706-
// if allowlist == default values, remove the default values
1707-
if (hostsAllowlist.size() == 2
1708-
&& hostsAllowlist.containsAll(List.of("localhost", "127.0.0.1"))) {
1709-
hostsAllowlist.removeAll(List.of("localhost", "127.0.0.1"));
1710-
}
1711-
hostsAllowlist.addAll(hostsWhitelist);
1712-
}
17131696

17141697
permissioningConfiguration = permissioningConfiguration();
17151698
staticNodes = loadStaticNodes();

‎besu/src/test/java/org/hyperledger/besu/cli/HostAllowlistOptionsTest.java

-35
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,6 @@
2323

2424
public class HostAllowlistOptionsTest extends CommandTestAbstract {
2525

26-
/** test deprecated CLI option * */
27-
@Deprecated
28-
@Test
29-
public void rpcHttpHostWhitelistAcceptsSingleArgument() {
30-
parseCommand("--host-whitelist", "a");
31-
32-
verify(mockRunnerBuilder).jsonRpcConfiguration(jsonRpcConfigArgumentCaptor.capture());
33-
verify(mockRunnerBuilder).build();
34-
35-
assertThat(jsonRpcConfigArgumentCaptor.getValue().getHostsAllowlist().size()).isEqualTo(1);
36-
assertThat(jsonRpcConfigArgumentCaptor.getValue().getHostsAllowlist()).contains("a");
37-
assertThat(jsonRpcConfigArgumentCaptor.getValue().getHostsAllowlist())
38-
.doesNotContain("localhost");
39-
40-
assertThat(commandOutput.toString(UTF_8)).isEmpty();
41-
assertThat(commandErrorOutput.toString(UTF_8)).isEmpty();
42-
}
43-
4426
@Test
4527
public void rpcHttpHostAllowlistAcceptsSingleArgument() {
4628
parseCommand("--host-allowlist", "a");
@@ -89,23 +71,6 @@ public void rpcHttpHostAllowlistAcceptsDoubleComma() {
8971
assertThat(commandErrorOutput.toString(UTF_8)).isEmpty();
9072
}
9173

92-
@Deprecated
93-
@Test
94-
public void rpcHttpHostWhitelistAllowlistAcceptsMultipleFlags() {
95-
parseCommand("--host-whitelist=a", "--host-allowlist=b");
96-
97-
verify(mockRunnerBuilder).jsonRpcConfiguration(jsonRpcConfigArgumentCaptor.capture());
98-
verify(mockRunnerBuilder).build();
99-
100-
assertThat(jsonRpcConfigArgumentCaptor.getValue().getHostsAllowlist().size()).isEqualTo(2);
101-
assertThat(jsonRpcConfigArgumentCaptor.getValue().getHostsAllowlist()).contains("a", "b");
102-
assertThat(jsonRpcConfigArgumentCaptor.getValue().getHostsAllowlist())
103-
.doesNotContain("*", "localhost");
104-
105-
assertThat(commandOutput.toString(UTF_8)).isEmpty();
106-
assertThat(commandErrorOutput.toString(UTF_8)).isEmpty();
107-
}
108-
10974
@Test
11075
public void rpcHttpHostAllowlistAcceptsMultipleFlags() {
11176
parseCommand("--host-allowlist=a", "--host-allowlist=b");

‎besu/src/test/resources/everything_config.toml

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ max-peers=42
4444
remote-connections-limit-enabled=true
4545
remote-connections-max-percentage=60
4646
random-peer-priority-enabled=false
47-
host-whitelist=["all"]
4847
host-allowlist=["all"]
4948
engine-host-allowlist=["all"]
5049
engine-rpc-enabled=true

0 commit comments

Comments
 (0)
Please sign in to comment.