-
Notifications
You must be signed in to change notification settings - Fork 910
Use System Property Proxy Settings for Netty and Amazon CRT HTTP Clients #2771
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, found a couple of typos.
I see you kept the implementation consistent with the Apache client ProxyConfiguration.
Will ask for an additional review from the team.
...netty-nio-client/src/main/java/software/amazon/awssdk/http/nio/netty/ProxyConfiguration.java
Outdated
Show resolved
Hide resolved
...clients/aws-crt-client/src/main/java/software/amazon/awssdk/http/crt/ProxyConfiguration.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @erin889, thanks for the PR! Apologies for the slow turnaround time.
Please see my feedback below. I will be quicker to respond to any future updates.
...nts/aws-crt-client/src/test/java/software/amazon/awssdk/http/crt/ProxyConfigurationTest.java
Outdated
Show resolved
Hide resolved
...nts/aws-crt-client/src/test/java/software/amazon/awssdk/http/crt/ProxyConfigurationTest.java
Outdated
Show resolved
Hide resolved
...nts/aws-crt-client/src/test/java/software/amazon/awssdk/http/crt/ProxyConfigurationTest.java
Outdated
Show resolved
Hide resolved
...nts/aws-crt-client/src/test/java/software/amazon/awssdk/http/crt/ProxyConfigurationTest.java
Outdated
Show resolved
Hide resolved
...netty-nio-client/src/main/java/software/amazon/awssdk/http/nio/netty/ProxyConfiguration.java
Outdated
Show resolved
Hide resolved
...y-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/ProxyConfigurationTest.java
Show resolved
Hide resolved
066c93c
to
b5f71a0
Compare
@Bennett-Lynch @debora-ito Thanks for the review! I have made some updates regarding the review, feel free to take a look. |
this.scheme = proxyConfiguration.scheme; | ||
this.host = proxyConfiguration.host; | ||
this.port = proxyConfiguration.port; | ||
this.nonProxyHosts = new HashSet<>(proxyConfiguration.nonProxyHosts); | ||
this.nonProxyHosts = proxyConfiguration.nonProxyHosts; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to preserve this set-copy logic. Otherwise, if a user has a ProxyConfiguration
and calls toBuilder()
, any modifications on the builder's set will be reflected in the original, which should be immutable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, I have updated the constructor so NullPointerException
won't be thrown.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, @erin889!
I forgot to mention this earlier, but please run scripts/new-change
to add a change log entry and to have the change attributed to your name!
fe49909
to
c626239
Compare
SonarCloud Quality Gate failed. |
@all-contributors please add @erin889 for code. |
I've put up a pull request to add @erin889! 🎉 |
Motivation and Context
Description
We modify the
ProxyConfiguration
so it resolveshttp.proxyHost, http.proxyPort, http.nonProxyHosts, http.proxyUser, http.proxyPassword
from system property settings by default. If they are set explicitly like.builder().host(...)
, it will pick up the configuration specified, otherwise it will reads from system property.Testing
see
ProxyConfigurationTest
filesTypes of changes
Checklist
mvn install
succeedsLicense