AuthClient unconditionally makes http request on initialization
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 35/100
- Type d'issue
- Refactorisation
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- python
- Domaine
- api, authentication
Piste de recherche
Commencez dans intuitlib/client.py, au niveau de get_discovery_doc et du chemin d’initialisation de AuthClient décrit dans l’issue. Comparez les clients PHP, Node et Ruby référencés afin de comprendre comment les URL OAuth sont représentées sans requête d’initialisation. La tâche est terminée lorsque l’initialisation de AuthClient ne nécessite plus de réponse réseau, tout en laissant les URL OAuth disponibles pour les appelants ; identifiez ou ajoutez les tests pertinents pour l’initialisation hors ligne et le moment des requêtes.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Whenever you initialize an instance of AuthClient it calls get_discovery_doc which will issue a request to the intuit site.
This is inconvenient when running tests if the AuthClient is initialized at any point, even if it is not directly used:
- Drastically slows down each test due to waiting on a response for the discovery document.
- Adds an implicit dependency on one's internet connection as the affected tests will fail without one
If you want to avoid this performance penalty then you must mock the AuthClient in any test that might incidentally initialize an instance of it. In my case I was testing out an integration with quickbooks using the community python sdk and this caused my test suite to go from taking ~15s to about 1m17s.
This also means that if you have a view that redirects a user to the OAuth authorization url then your response timing will be dependent on the time for the discovery document to be retrieved.
Looking at the other intuit oauth client library, it looks like there is a split on retrieving the urls from the discovery document and storing the urls as constants in the library. The .NET and Java libraries both require you to make a request to the discovery document to get the OAuth urls whereas the PHP, Node, and Ruby libraries have them stored as constants.
From my perspective, it seems strictly better to store the urls as constants in the library as it removes any performance penalty that occurs from having to wait for a http response to retrieve the discovery doc when initializing the client.
- Langage dominant
- Python
- Étoiles
- 86
- Forks
- 60
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de intuit/oauth-pythonclient
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
intuit/oauth-pythonclient#56 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
intuit/oauth-pythonclient#52 ·
-
inputOuverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 10/100
intuit/oauth-pythonclient#55 · 2 commentaires ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 25/100
intuit/oauth-pythonclient#47 · 1 commentaire · 1 réaction ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 20/100
intuit/oauth-pythonclient#38 · 3 commentaires ·
Toutes les issues de intuit/oauth-pythonclient
Issues similaires
-
Claiming namespace `jft63`Ouvertenamespace operations
Difficulté 1/5 Moins d'une heure Accessibilité débutants 72/100
EclipseFdn/open-vsx.org#14043 ·
Les mainteneurs répondent en général sous 1 jour
-
feedback simulation workshop
Difficulté 2/5 1-3 heures Accessibilité débutants 73/100
githubnext/gh-aw-workshop#4455 ·
Les mainteneurs répondent en général sous 1 jour
-
Triage 🩺
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
Les mainteneurs répondent en général sous 1 jour
-
[BUG] Container scenario crashes without expected_recovery_time, kube DNS example uses retry_waitOuverteneeds-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
krkn-chaos/krkn#1627 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
NousResearch/hermes-agent#136483 ·
Les mainteneurs répondent en général sous 1 jour