Make DefaultHttpClient extensible

Ouverte
#754 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
1/5
Temps estimé
Moins d'une heure
Accessibilité débutants
50/100
Type d'issue
Fonctionnalité
Clarté
Clairement spécifiée
Activité
À l'abandon
Stack technique
java
Domaine
api, backend

Piste de recherche

Commencez par le constructeur de DefaultHttpClient(OkHttpClient) et examinez le contrat de Auth0HttpClient pour comprendre comment l’implémentation existante est exposée. C’est terminé lorsqu’une sous-classe peut réutiliser le constructeur avec un OkHttpClient sans devoir implémenter l’intégralité du contrat ; vérifiez la modification avec les tests existants du dépôt.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

feature request
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

Langage dominant
Java
Étoiles
319
Forks
155
Merge moyen
1 j 1 h
PR mergées (30 j)
12

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de auth0/auth0-java

Toutes les issues de auth0/auth0-java

Issues similaires

Plus d'issues Java

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.