mirror of https://github.com/grpc/grpc-java.git
xds: enable PSM security by default (#8478)
This commit is contained in:
parent
a91cc85dfd
commit
4828698bec
|
|
@ -69,7 +69,8 @@ final class ClusterImplLoadBalancer extends LoadBalancer {
|
||||||
|| Boolean.parseBoolean(System.getenv("GRPC_XDS_EXPERIMENTAL_CIRCUIT_BREAKING"));
|
|| Boolean.parseBoolean(System.getenv("GRPC_XDS_EXPERIMENTAL_CIRCUIT_BREAKING"));
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
static boolean enableSecurity =
|
static boolean enableSecurity =
|
||||||
Boolean.parseBoolean(System.getenv("GRPC_XDS_EXPERIMENTAL_SECURITY_SUPPORT"));
|
Strings.isNullOrEmpty(System.getenv("GRPC_XDS_EXPERIMENTAL_SECURITY_SUPPORT"))
|
||||||
|
|| Boolean.parseBoolean(System.getenv("GRPC_XDS_EXPERIMENTAL_SECURITY_SUPPORT"));
|
||||||
private static final Attributes.Key<ClusterLocalityStats> ATTR_CLUSTER_LOCALITY_STATS =
|
private static final Attributes.Key<ClusterLocalityStats> ATTR_CLUSTER_LOCALITY_STATS =
|
||||||
Attributes.Key.create("io.grpc.xds.ClusterImplLoadBalancer.clusterLocalityStats");
|
Attributes.Key.create("io.grpc.xds.ClusterImplLoadBalancer.clusterLocalityStats");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -480,16 +480,16 @@ public class ClusterImplLoadBalancerTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void endpointAddressesAttachedWithTlsConfig_enableSecurity() {
|
public void endpointAddressesAttachedWithTlsConfig_disableSecurity() {
|
||||||
boolean originalEnableSecurity = ClusterImplLoadBalancer.enableSecurity;
|
boolean originalEnableSecurity = ClusterImplLoadBalancer.enableSecurity;
|
||||||
ClusterImplLoadBalancer.enableSecurity = true;
|
ClusterImplLoadBalancer.enableSecurity = false;
|
||||||
subtest_endpointAddressesAttachedWithTlsConfig(true);
|
subtest_endpointAddressesAttachedWithTlsConfig(false);
|
||||||
ClusterImplLoadBalancer.enableSecurity = originalEnableSecurity;
|
ClusterImplLoadBalancer.enableSecurity = originalEnableSecurity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void endpointAddressesAttachedWithTlsConfig_securityDisabledByDefault() {
|
public void endpointAddressesAttachedWithTlsConfig_securityEnabledByDefault() {
|
||||||
subtest_endpointAddressesAttachedWithTlsConfig(false);
|
subtest_endpointAddressesAttachedWithTlsConfig(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void subtest_endpointAddressesAttachedWithTlsConfig(boolean enableSecurity) {
|
private void subtest_endpointAddressesAttachedWithTlsConfig(boolean enableSecurity) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue