Add support for java Proxy with basic auth #266
Merged
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
AuthAPI
andManagementAPI
classes 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
ProxyOptions
object (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