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

Cache requests to .well-known/openid_configuration/

オープン 初心者向け
#52 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
68/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python

調査の方向性

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_doc with a session arg -- it's a static resource that you can access without any auth.
  • Annotate get_discovery_doc with @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 はありません

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

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

はじめの一歩

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

intuit/oauth-pythonclient のほかの issue

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

似ている issue

Python の issue をもっと見る

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

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