Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NOT Approved]Disable useEnvironmentVariableValues by default because of regression issue #4728 #4732

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/next-release/bugfix-AWSSDKforJavav2-34a2686.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "bugfix",
"category": "AWS SDK for Java v2\"",
"contributor": "",
"description": "Disabling the useEnvironmentVariableValues by default for all Http clients since it caused regression issues as Issue [#4728](https://github.com/aws/aws-sdk-java-v2/issues/4728)"
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.Objects;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.utils.ProxyConfigProvider;
import software.amazon.awssdk.utils.ProxyEnvironmentSetting;
import software.amazon.awssdk.utils.ProxySystemSetting;
import software.amazon.awssdk.utils.StringUtils;

Expand Down Expand Up @@ -240,10 +241,11 @@ public interface Builder {
Builder useSystemPropertyValues(Boolean useSystemPropertyValues);

/**
* The option whether to use environment variable values from {@link ProxySystemSetting} if any of the config options are
* missing. The value is set to "true" by default which means SDK will automatically use environment variable values if
* options are not provided during building the {@link CrtProxyConfiguration} object. To disable this behavior, set this
* value to false.It is important to note that when this property is set to "true," all proxy settings will exclusively
* The option whether to use environment variable values from {@link ProxyEnvironmentSetting} if any of the config options
* are missing.
* The value is set to "false" by default which means SDK will not automatically use environment variable values if
* options are not provided during building the {@link CrtProxyConfiguration} object. To enable this behavior, set this
* value to true. It is important to note that when this property is set to "true," all proxy settings will exclusively
* originate from environment variableValues, and no partial settings will be obtained from SystemPropertyValues.
*
* @param useEnvironmentVariableValues The option whether to use environment variable values
Expand All @@ -263,7 +265,7 @@ protected abstract static class DefaultBuilder<B extends Builder> implements Bui
private String username;
private String password;
private Boolean useSystemPropertyValues = Boolean.TRUE;
private Boolean useEnvironmentVariableValues = Boolean.TRUE;
private Boolean useEnvironmentVariableValues = Boolean.FALSE;

protected DefaultBuilder() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.Set;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.utils.ProxyConfigProvider;
import software.amazon.awssdk.utils.ProxyEnvironmentSetting;
import software.amazon.awssdk.utils.ProxySystemSetting;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.Validate;
Expand Down Expand Up @@ -285,13 +286,12 @@ public interface Builder extends CopyableBuilder<Builder, ProxyConfiguration> {
Builder useSystemPropertyValues(Boolean useSystemPropertyValues);

/**
* Option whether to use environment variable values for proxy configuration if any of the config options are missing.
* <p>
* This value is set to "true" by default, which means the SDK will automatically use environment variable values for
* proxy configuration options that are not provided during the building of the {@link ProxyConfiguration} object. To
* disable this behavior, set this value to "false". It is important to note that when this property is set to "true," all
* proxy settings will exclusively originate from environment variableValues, and no partial settings will be obtained
* from SystemPropertyValues.
* Option whether to use environment variable values from {@link ProxyEnvironmentSetting} if any of the config options are
* missing. This value is set to "false" by default, which means SDK will not automatically use environment variable
* values for options that are not provided during building of {@link ProxyConfiguration} object. To enable this
* behavior, set this value to "true".It is important to note that when this property is set to "true," all proxy
* settings will exclusively originate from environment variableValues, and no partial settings will be obtained from
* SystemPropertyValues.
*
* @param useEnvironmentVariableValues The option whether to use environment variable values.
* @return This object for method chaining.
Expand Down Expand Up @@ -323,7 +323,7 @@ private static final class DefaultClientProxyConfigurationBuilder implements Bui
private Set<String> nonProxyHosts;
private Boolean preemptiveBasicAuthenticationEnabled;
private Boolean useSystemPropertyValues = Boolean.TRUE;
private Boolean useEnvironmentVariableValues = Boolean.TRUE;
private Boolean useEnvironmentVariableValues = Boolean.FALSE;
private String scheme = "http";

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,12 @@ public interface Builder extends CopyableBuilder<Builder, ProxyConfiguration> {


/**
* Set the option whether to use environment variable values for {@link ProxyEnvironmentSetting} if any of the config
* options are missing. The value is set to "true" by default, enabling the SDK to automatically use environment variable
* values for proxy configuration options that are not provided during building the {@link ProxyConfiguration} object. To
* disable this behavior, set this value to "false".It is important to note that when this property is set to "true," all
* proxy settings will exclusively originate from Environment Variable Values, and no partial settings will be obtained
* from System Property Values.
* Option whether to use environment variable values from {@link ProxyEnvironmentSetting} if any of the config options are
* missing. This value is set to "false" by default, which means SDK will not automatically use environment variable
* values for options that are not provided during building of {@link ProxyConfiguration} object. To enable this
* behavior, set this value to "true".It is important to note that when this property is set to "true," all proxy
* settings will exclusively originate from environment variableValues, and no partial settings will be obtained from
* SystemPropertyValues.
*
* @param useEnvironmentVariablesValues The option whether to use environment variable values
* @return This object for method chaining.
Expand All @@ -295,7 +295,7 @@ private static final class BuilderImpl implements Builder {
private String password;
private Set<String> nonProxyHosts;
private Boolean useSystemPropertyValues = Boolean.TRUE;
private Boolean useEnvironmentVariablesValues = Boolean.TRUE;
private Boolean useEnvironmentVariablesValues = Boolean.FALSE;

private BuilderImpl() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,11 @@ public interface Builder extends CopyableBuilder<Builder, ProxyConfiguration> {

/**
* Option whether to use environment variable values from {@link ProxyEnvironmentSetting} if any of the config options are
* missing. This value is set to "true" by default, which means SDK will automatically use environment variable values for
* options that are not provided during building the {@link ProxyConfiguration} object. To disable this behavior, set this
* value to "false".It is important to note that when this property is set to "true," all proxy settings will exclusively
* originate from environment variableValues, and no partial settings will be obtained from SystemPropertyValues.
* missing. This value is set to "false" by default, which means SDK will not automatically use environment variable
* values for options that are not provided during building of {@link ProxyConfiguration} object. To enable this
* behavior, set this value to "true".It is important to note that when this property is set to "true," all proxy
* settings will exclusively originate from environment variableValues, and no partial settings will be obtained from
* SystemPropertyValues.
*
* @param useEnvironmentVariablesValues The option whether to use environment variable values
* @return This object for method chaining.
Expand Down Expand Up @@ -273,7 +274,7 @@ private static final class DefaultClientProxyConfigurationBuilder implements Bui
private String password;
private Set<String> nonProxyHosts;
private Boolean useSystemPropertyValues = Boolean.TRUE;
private Boolean useEnvironmentVariablesValues = Boolean.TRUE;
private Boolean useEnvironmentVariablesValues = Boolean.FALSE;

@Override
public Builder endpoint(URI endpoint) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public static Stream<Arguments> proxyConfigurationSetting() {
+ "when using the default proxy builder, the proxy configuration is resolved to use environment variables.",
Collections.singletonList(Pair.of("", "")),
environmentSettings(),
new TestProxySetting(), null, null, getEnvironmentVariableProxySettings()),
new TestProxySetting(), null, null, new TestProxySetting()),

Arguments.of(
"Provided with no system property and valid environment variables, when using the host,"
Expand Down Expand Up @@ -119,7 +119,7 @@ public static Stream<Arguments> proxyConfigurationSetting() {
+ "then proxy resolved to environment",
Collections.singletonList(Pair.of("", "")),
environmentSettings(),
null, true, null, getEnvironmentVariableProxySettings()),
null, true, null, new TestProxySetting()),

Arguments.of(
"Provided only environment variable when useEnvironmentVariable set to false then proxy resolved "
Expand Down
Loading