accept 127.0.0.1 as localhost for host whitelisting (#974)

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
pull/2/head
Chris Mckay 6 years ago committed by GitHub
parent 1352eefb6a
commit 7813290d43
  1. 3
      ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/JsonRpcConfiguration.java
  2. 3
      metrics/src/main/java/tech/pegasys/pantheon/metrics/prometheus/MetricsConfiguration.java
  3. 2
      pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java

@ -13,6 +13,7 @@
package tech.pegasys.pantheon.ethereum.jsonrpc;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
@ -29,7 +30,7 @@ public class JsonRpcConfiguration {
private String host;
private Collection<String> corsAllowedDomains = Collections.emptyList();
private Collection<RpcApi> rpcApis;
private Collection<String> hostsWhitelist = Collections.singletonList("localhost");
private Collection<String> hostsWhitelist = Arrays.asList("localhost", "127.0.0.1");;
private boolean authenticationEnabled = false;
private String authenticationCredentialsFile;

@ -14,6 +14,7 @@ package tech.pegasys.pantheon.metrics.prometheus;
import tech.pegasys.pantheon.metrics.MetricCategory;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.EnumSet;
@ -38,7 +39,7 @@ public class MetricsConfiguration {
private String pushHost;
private int pushInterval;
private String prometheusJob;
private Collection<String> hostsWhitelist = Collections.singletonList("localhost");
private Collection<String> hostsWhitelist = Arrays.asList("localhost", "127.0.0.1");
public static MetricsConfiguration createDefault() {
final MetricsConfiguration metricsConfiguration = new MetricsConfiguration();

@ -404,7 +404,7 @@ public class PantheonCommand implements DefaultCommandValues, Runnable {
paramLabel = "<hostname>[,<hostname>...]... or * or all",
description =
"Comma separated list of hostnames to whitelist for JSON-RPC access, or * or all to accept any host (default: ${DEFAULT-VALUE})",
defaultValue = "localhost")
defaultValue = "localhost,127.0.0.1")
private final JsonRPCWhitelistHostsProperty hostsWhitelist = new JsonRPCWhitelistHostsProperty();
@Option(

Loading…
Cancel
Save