-
Notifications
You must be signed in to change notification settings - Fork 910
Netty client support for authorized proxy #2517
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
Merged
debora-ito
merged 22 commits into
aws:master
from
guillepb10:feature/support-proxy-with-auth
Sep 10, 2021
Merged
Changes from 17 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
157f838
feat(client): support proxy with auth into netty client
next-guillermopriego cf0b939
test: test with proxy auth
next-guillermopriego 21bb134
doc: add javadoc to public interface and update changelog
next-guillermopriego 63857b6
Merge branch 'master' into feature/support-proxy-with-auth
guillepb10 2852185
Merge branch 'master' into feature/support-proxy-with-auth
guillepb10 b590b58
doc: more javadoc
next-guillermopriego 76c0422
Merge branch 'master' into feature/support-proxy-with-auth
guillepb10 dee2bb4
fix: fix pr comments
next-guillermopriego 5d35750
apply codestyle
next-guillermopriego d9d3490
Merge branch 'feature/support-proxy-with-auth' of https://github.com/…
next-guillermopriego e977e01
Merge branch 'master' into feature/support-proxy-with-auth
guillepb10 7cae7f5
Merge branch 'master' into feature/support-proxy-with-auth
guillepb10 ab976fb
fix: fix doc and equals into dto and codestyle
next-guillermopriego a0a3b8a
Merge branch 'feature/support-proxy-with-auth' of https://github.com/…
next-guillermopriego 216bbf9
Merge branch 'master' into feature/support-proxy-with-auth
guillepb10 ffd82d7
Merge branch 'master' into feature/support-proxy-with-auth
guillepb10 a2732c1
Merge branch 'master' into feature/support-proxy-with-auth
guillepb10 17df7a4
fix: fix typo and remove use of this into field access
next-guillermopriego 623e019
Merge remote-tracking branch 'guille/feature/support-proxy-with-auth'…
next-guillermopriego 3dde332
Merge branch 'master' into feature/support-proxy-with-auth
guillepb10 194ec44
Merge branch 'master' into feature/support-proxy-with-auth
cenedhryn b50d0f3
Merge branch 'master' into feature/support-proxy-with-auth
cenedhryn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"category": "AWS SDK for Java v2", | ||
"contributor": "guillepb10", | ||
"type": "feature", | ||
"description": "Add support for autheticated corporate proxies" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,24 +49,38 @@ public class Http1TunnelConnectionPool implements ChannelPool { | |
private final ChannelPool delegate; | ||
private final SslContext sslContext; | ||
private final URI proxyAddress; | ||
private final String proxyUser; | ||
private final String proxyPassword; | ||
private final URI remoteAddress; | ||
private final ChannelPoolHandler handler; | ||
private final InitHandlerSupplier initHandlerSupplier; | ||
|
||
public Http1TunnelConnectionPool(EventLoop eventLoop, ChannelPool delegate, SslContext sslContext, | ||
URI proxyAddress, String proxyUsername, String proxyPassword, | ||
URI remoteAddress, ChannelPoolHandler handler) { | ||
this(eventLoop, delegate, sslContext, | ||
proxyAddress, proxyUsername, proxyPassword, remoteAddress, handler, | ||
ProxyTunnelInitHandler::new); | ||
} | ||
|
||
public Http1TunnelConnectionPool(EventLoop eventLoop, ChannelPool delegate, SslContext sslContext, | ||
URI proxyAddress, URI remoteAddress, ChannelPoolHandler handler) { | ||
this(eventLoop, delegate, sslContext, proxyAddress, remoteAddress, handler, ProxyTunnelInitHandler::new); | ||
this(eventLoop, delegate, sslContext, | ||
proxyAddress, null, null, remoteAddress, handler, | ||
ProxyTunnelInitHandler::new); | ||
|
||
} | ||
|
||
@SdkTestInternalApi | ||
Http1TunnelConnectionPool(EventLoop eventLoop, ChannelPool delegate, SslContext sslContext, | ||
URI proxyAddress, URI remoteAddress, ChannelPoolHandler handler, | ||
InitHandlerSupplier initHandlerSupplier) { | ||
URI proxyAddress, String proxyUser, String proxyPassword, URI remoteAddress, | ||
ChannelPoolHandler handler, InitHandlerSupplier initHandlerSupplier) { | ||
this.eventLoop = eventLoop; | ||
this.delegate = delegate; | ||
this.sslContext = sslContext; | ||
this.proxyAddress = proxyAddress; | ||
this.proxyUser = proxyUser; | ||
this.proxyPassword = proxyPassword; | ||
this.remoteAddress = remoteAddress; | ||
this.handler = handler; | ||
this.initHandlerSupplier = initHandlerSupplier; | ||
|
@@ -120,7 +134,8 @@ private void setupChannel(Channel ch, Promise<Channel> acquirePromise) { | |
if (sslHandler != null) { | ||
ch.pipeline().addLast(sslHandler); | ||
} | ||
ch.pipeline().addLast(initHandlerSupplier.newInitHandler(delegate, remoteAddress, tunnelEstablishedPromise)); | ||
ch.pipeline().addLast(initHandlerSupplier.newInitHandler(delegate, this.proxyUser, this.proxyPassword, remoteAddress, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not against using |
||
tunnelEstablishedPromise)); | ||
tunnelEstablishedPromise.addListener((Future<Channel> f) -> { | ||
if (f.isSuccess()) { | ||
Channel tunnel = f.getNow(); | ||
|
@@ -160,6 +175,7 @@ private static boolean isTunnelEstablished(Channel ch) { | |
@SdkTestInternalApi | ||
@FunctionalInterface | ||
interface InitHandlerSupplier { | ||
ChannelHandler newInitHandler(ChannelPool sourcePool, URI remoteAddress, Promise<Channel> tunnelInitFuture); | ||
ChannelHandler newInitHandler(ChannelPool sourcePool, String proxyUsername, String proxyPassword, URI remoteAddress, | ||
Promise<Channel> tunnelInitFuture); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
autheticated
->authenticated