Add support for java Proxy with basic auth#266
Merged
lbalmaceda merged 5 commits intomasterfrom Jun 4, 2020
Merged
Conversation
jimmyjames
requested changes
Jun 3, 2020
Contributor
jimmyjames
left a comment
There was a problem hiding this comment.
Just some minor feedback, mostly around JavaDocs. Otherwise this looks good.
Regarding the names, I think ClientOptions and ProxyOptions are appropriate. Were there other names you were considering that you want to raise for discussion?
One other question I have is if/how you tested the proxy support (aside from the unit tests that rely on mocks)?
5 tasks
jimmyjames
approved these changes
Jun 4, 2020
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.
Changes
This PR adds a new constructor for both
AuthAPIandManagementAPIclasses that accepts a set ofClientOptions(final name can still change).The idea is that from now on, every new property that we want to configure in the OkHttpClient comes through this options object. This way, we reduce the exposure of third-party classes in our public API.
For now, this Options object accepts a
ProxyOptionsobject (final name also subject to change), that will hold the Proxy instance and any basic authentication, if required.Usage
Local environment setup
In order to test the SDK with a Proxy, I've followed these steps to set up a local proxy:
Create a class or test to try the code snippet in the section above. Requests made by classes, like tests, should now come through.
References
The feature was originally requested here #91
Testing
Checklist