Skip to content

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
merged 22 commits into from
Sep 10, 2021

Conversation

guillepb10
Copy link
Contributor

@guillepb10 guillepb10 commented Jun 8, 2021

Description

This change able the use of a secured corporate proxy to communicate with aws, into the netty async client.

Motivation and Context

So many corporations used a proxy to connect to internet. Besides this corporate usually needs a basic autentication to connect to the proxy. Until nowadays, it was impossible to used a secured coroporate proxy with netty client, couse it did not support to specify the user and password required to connect to proxy. This change makes it possible.

Testing

It has been compleated unit testing of the library to ensure the purpose of the change it is successfully met.
Besides, I have tested the change with a personal project, where I try to connect to CloudWatchLogs api behind a coporate proxy, and it succeeded.

As cloud bee shown this is a very little change, that only affect to netty-nio-client. So it must not break the current work of the client.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have read the README document
  • I have added tests to cover my changes
  • All new and existing tests passed
  • A short description of the change has been added to the CHANGELOG
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

@guillepb10 guillepb10 changed the title Feature/support proxy with auth Netty client support for authorized proxy Jun 8, 2021
@codecov-commenter
Copy link

codecov-commenter commented Jun 8, 2021

Codecov Report

Merging #2517 (b590b58) into master (ebee1aa) will increase coverage by 0.00%.
The diff coverage is 96.29%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #2517   +/-   ##
=========================================
  Coverage     77.74%   77.74%           
  Complexity      365      365           
=========================================
  Files          1248     1248           
  Lines         39543    39563   +20     
  Branches       3097     3098    +1     
=========================================
+ Hits          30741    30760   +19     
  Misses         7315     7315           
- Partials       1487     1488    +1     
Flag Coverage Δ
unittests 77.74% <96.29%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ttp/nio/netty/internal/ProxyTunnelInitHandler.java 91.93% <90.00%> (-0.66%) ⬇️
...azon/awssdk/http/nio/netty/ProxyConfiguration.java 82.45% <100.00%> (+2.86%) ⬆️
...p/nio/netty/internal/AwaitCloseChannelPoolMap.java 92.45% <100.00%> (ø)
.../nio/netty/internal/Http1TunnelConnectionPool.java 98.36% <100.00%> (+0.11%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c33ad01...b590b58. Read the comment docs.

@guillepb10
Copy link
Contributor Author

@dagnir First of all, sorry for disturb, but I have opened this pull request a week ago and I didn't have any feedback about it. Could you review it? Or give me any gap of time to be reviewed?

Copy link
Member

@debora-ito debora-ito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made some comments in an initial review.

@debora-ito debora-ito linked an issue Jul 7, 2021 that may be closed by this pull request
@guillepb10
Copy link
Contributor Author

Hi @debora-ito , I think I have already solved your comments

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 26, 2021

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

76.8% 76.8% Coverage
10.7% 10.7% Duplication

"category": "AWS SDK for Java v2",
"contributor": "guillepb10",
"type": "feature",
"description": "Add support for autheticated corporate proxies"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

autheticated -> authenticated

@@ -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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not against using this but this module should be consistent in its usage of class members and currently this isn't used widely, so let's remove it for readability.

@cenedhryn
Copy link
Contributor

@guillepb10 Thanks for submitting the PR, and sorry it took a while for us to fully review it. I only had some minor comments.

@guillepb10
Copy link
Contributor Author

guillepb10 commented Sep 6, 2021

Thank you for your feedback @cenedhryn. I've just updated the PR with your comments.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 9, 2021

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

76.8% 76.8% Coverage
10.7% 10.7% Duplication

@debora-ito debora-ito merged commit 95e3ad9 into aws:master Sep 10, 2021
@debora-ito
Copy link
Member

@all-contributors please add @guillepb10 for code.

@allcontributors
Copy link
Contributor

@debora-ito

I've put up a pull request to add @guillepb10! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Netty Client Does Not Support Proxy Authentication
5 participants