Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

AuthClient unconditionally makes http request on initialization

オープン
#18 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python

調査の方向性

intuitlib/client.py の get_discovery_doc と、issue に記載されている AuthClient の初期化パスから始めてください。参照されている PHP、Node、Ruby のクライアントを比較し、初期化リクエストなしで OAuth URL をどのように表現しているかを理解してください。AuthClient の初期化でネットワークレスポンスが不要になり、OAuth URL が引き続き呼び出し側から利用できれば完了です。オフライン初期化とリクエストのタイミングに関する関連テストを特定するか、追加してください。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
86
フォーク
59
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

intuit/oauth-pythonclient のほかの issue

intuit/oauth-pythonclient の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。