Cache requests to .well-known/openid_configuration/
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 68/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- python
- 領域
- api, authentication
調査の方向性
get_discovery_doc と issue に記載されている AuthClient の構築パスから始め、現在 discovery document がどのようにリクエストされ、Session にアタッチされているかを確認します。AuthClient の構築を繰り返した場合に、Session を必要とせずにキャッシュされた discovery 結果が再利用されることを確認し、既存のテストスイートがこの動作をカバーしていることを検証します。
索引モデルが issue の本文から書いたものです。
説明
(related to https://github.com/intuit/oauth-pythonclient/issues/18)
Summary
.well-known/openid_configuration/ is a stable resource that is not expected to change between requests. If a caller constructs an AuthClient on every request (which I presume is quite common), then they will hit this endpoint, incurring latency costs and potential for failure. Given the latency on this endpoint, I would imagine these duplicate requests are not cheap to Intuit either.
This redundancy exacerbates issues like https://github.com/intuit/oauth-pythonclient/issues/47,
Solution
Currently get_discovery_doc is called each time an AuthClient is constructed, and attached to the Session extended by AuthClient
I would propose instead:
- Do not call
get_discovery_docwith asessionarg -- it's a static resource that you can access without any auth. - Annotate
get_discovery_docwith@lru_cache(docs) to cache results in-memory for each set of arguments. This is a python builtin.
Happy to contribute a PR for this if interested. I imagine this will provide pretty major cost savings to both Intuit (due to dramatic reduction in duplicate requests) and callers (due to saved compute and less network congestion)
@robert-mings If contributed, would you be open to something like this?
- 主要言語
- Python
- スター
- 86
- フォーク
- 59
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
intuit/oauth-pythonclient のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
intuit/oauth-pythonclient#56 ·
-
input オープン
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
intuit/oauth-pythonclient#55 · コメント 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
intuit/oauth-pythonclient#47 · コメント 1 件 · リアクション 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 20/100
intuit/oauth-pythonclient#38 · コメント 3 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
intuit/oauth-pythonclient#37 · コメント 1 件 ·
intuit/oauth-pythonclient の issue をすべて見る
似ている issue
-
essnmx good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
-
[Feature] 奇物选择添加优先级 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
syfoud/Simulated_Scepter#174 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Giskard-AI/giskard-oss#2840 · コメント 1 件 ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success オープンarea: repo bug perceived difficulty: 2
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
yeti-platform/yeti#1380 ·