Bind to localhost when finding available ports#1280
Open
joeljons wants to merge 6 commits intodatabricks:mainfrom
Open
Bind to localhost when finding available ports#1280joeljons wants to merge 6 commits intodatabricks:mainfrom
joeljons wants to merge 6 commits intodatabricks:mainfrom
Conversation
Signed-off-by: joeljons <joel@dbvis.com>
Signed-off-by: joeljons <joel@dbvis.com>
# Conflicts: # NEXT_CHANGELOG.md
# Conflicts: # NEXT_CHANGELOG.md
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Change so that checking for available ports checks by binding to localhost.
When connecting with OAuth Browser flow (
AuthMech=11;Auth_Flow=2) a local webserver is started to catch the redirect from the OAuth flow.If port 8020 (or the port(s) configured by
OAuth2RedirectUrlPort) was occupied and bound to localhost the port availability check though it was free because it checked using the wildcard adress.This led to the jdbc connect failed with
DatabricksDriverException: ExternalHeaderFactory not initialized. Call configure() first.Testing
Additional Notes to the Reviewer
Multiple servers can be started on the same port if bound to different hosts or the wildcard address. The HttpServer started in
Consent.getOAuthCallbackParametersbinds to localhost, soClientConfigurator.isPortAvailableshould also bind to localhost when checking. AlthoughredirectUrlinConsentcan be configured it is always localhost set byClientConfigurator.setupU2MConfig.