AuthClient unconditionally makes http request on initialization
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Refactoring
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- python
- Bereich
- api, authentication
Rechercherichtung
Beginne in intuitlib/client.py bei get_discovery_doc und beim im Issue beschriebenen AuthClient-Initialisierungspfad. Vergleiche die referenzierten PHP-, Node- und Ruby-Clients, um zu verstehen, wie OAuth-URLs ohne eine Initialisierungsanfrage dargestellt werden. Erledigt ist die Aufgabe, wenn die AuthClient-Initialisierung keine Netzwerkantwort mehr erfordert, während die OAuth-URLs für Aufrufer weiterhin verfügbar bleiben; identifiziere relevante Tests für die Offline-Initialisierung und das Timing von Anfragen oder füge sie hinzu.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Python
- Sterne
- 86
- Forks
- 60
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus intuit/oauth-pythonclient
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
intuit/oauth-pythonclient#56 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
intuit/oauth-pythonclient#52 ·
-
inputOffen
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 10/100
intuit/oauth-pythonclient#55 · 2 Kommentare ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
intuit/oauth-pythonclient#47 · 1 Kommentar · 1 Reaktion ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 20/100
intuit/oauth-pythonclient#38 · 3 Kommentare ·
Alle Issues in intuit/oauth-pythonclient
Ähnliche Issues
-
namespace operations
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
EclipseFdn/open-vsx.org#14043 ·
Maintainer antworten meist innerhalb von 1 Tag
-
netbox status: needs triage type: bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
netbox-community/netbox#23376 ·
Maintainer antworten meist innerhalb von 1 Tag
-
feedback simulation workshop
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 73/100
githubnext/gh-aw-workshop#4455 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Triage 🩺
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 1 Tag
-
[BUG] Container scenario crashes without expected_recovery_time, kube DNS example uses retry_waitOffenneeds-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
krkn-chaos/krkn#1627 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag