Make DefaultHttpClient extensible
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 50/100
Research direction
Start at the DefaultHttpClient(OkHttpClient) constructor and review the Auth0HttpClient contract to understand how the existing implementation is exposed. Done means a subclass can reuse the constructor with an OkHttpClient without implementing the entire contract; verify the change with the repository's existing tests.
Written by the indexing model from the issue text.
Description
Checklist
- I have looked into the Readme and Examples, and have not found a suitable solution or answer.
- I have looked into the API documentation and have not found a suitable solution or answer.
- I have searched the issues and have not found a suitable solution or answer.
- I have searched the Auth0 Community forums and have not found a suitable solution or answer.
- I agree to the terms within the Auth0 Code of Conduct.
Describe the problem you'd like to have solved
We use OkHttp as our client across our codebase and share common default configuration. We would like to re-use this configuration in our use of the Auth0 client without having to implement the whole Auth0HttpClient contract.
Describe the ideal solution
Make the following constructor protected instead of package scoped.
DefaultHttpClient(OkHttpClient client) {
this.client = client;
}
Alternatives and current workarounds
For us to solve this, the only alternative we can see is to fully implement the Auth0HttpClient contract. This would basically be copy-pasting from the DefaultHttpClient implementation in the SDK.
An alternative to the attached PR solution would be to build out DefaultHttpClient.Builder with more-and-more of the configurations that the OkHttp library supports (dispatcher executor service, etc) to cover our use case. This seems unattractive as if you follow that approach fully you end up with a copy of what the OkHttp client builder exposes.
Additional context
No response
- Dominant language
- Java
- Stars
- 319
- Forks
- 155
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 12
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from auth0/auth0-java
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
auth0/auth0-java#887 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
auth0/auth0-java#842 · 2 comments ·
-
bug
Difficulty 5/5 Over a week Newbie friendliness 35/100
auth0/auth0-java#911 ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 25/100
auth0/auth0-java#897 ·
All issues in auth0/auth0-java
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100