Repository navigation
GH-1384: [JDBC] Add proxy connection properties to the Flight SQL JDBC driver #1538
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
Open
scruz-denodo
wants to merge
3
commits into
apache:main
Choose a base branch
from
scruz-denodo:jdbc-proxy-properties
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
ce57b7a
GH-1384: [JDBC] Add proxy connection properties to the Flight SQL JDB…
scruz-denodo aa82b27
GH-1384: [JDBC] Add proxy connection properties to the Flight SQL JDB…
scruz-denodo 08d0c7c
GH-1384: [JDBC] Add proxy authentication to the OAuth token requests
scruz-denodo 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
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
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.
The proxy detector is only installed on the gRPC channel. OAuth token requests don't go through it:
AbstractOAuthTokenProvider.fetchNewTokensends them withrequest.toHTTPRequest().send(), which usesHttpURLConnectionand therefore the JVM-wideProxySelector.Take
useProxy=true&proxyHost=proxy.example.com&proxyPort=3128&oauth.flow=client_credentials&oauth.tokenUri=https://idp.example.com/tokenon a network where only the proxy can reach the Internet. The Flight connection goes through the proxy, but the token request tries to connect directly and fails with "Failed to send OAuth token request". The reverse also happens: withnonProxyHosts=*, token requests still go through a JVM-configured proxy.Could the token request use the same settings? Nimbus
HTTPRequesthassetProxy(java.net.Proxy), so the token provider could build aProxyfromproxyHost/proxyPort, skipping it when the token endpoint matchesnonProxyHosts. Proxy authentication is the tricky part:HttpURLConnectiongets proxy credentials from anAuthenticator, and the JDK disables Basic auth for HTTPS tunneling by default (jdk.http.auth.tunneling.disabledSchemes).If you would rather leave this for a follow-up, please say in the docs that OAuth token requests still use the JVM proxy settings, and open an issue for it.
Uh oh!
There was an error while loading. Please reload this page.
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 will take a look. It makes sense to add it also with this change.
In an scenario where the proxy is required and you configure it with the connection properties, it does not sound very good that the OAUTH request fails because the proxy is ignored for them.
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 have being doing test with a local squid instance and I decided to push two commits on the branch.
first one aa82b27 adds the proxy using the
setProxymethod you suggested. This change has a limitation with the authenticated proxies. ThesetProxydoes not have support for setting theproxyUser/proxyPasswordvalues.second one 08d0c7c adds the support for specifying the proxy credentials. It uses this class for making the proxy connection
ProxyHttpRequestSender. There are more changes than the commit using thesetProxyfrom nimbus, so I split the change on two commits in case you prefer to stay only with the first one assuming the mentioned limitation.