Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Cache requests to .well-known/openid_configuration/

Open Beginner friendly
#52 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
python

Research direction

Start at get_discovery_doc and the AuthClient construction path described in the issue, then inspect how the discovery document is currently requested and attached to the Session. Confirm that repeated AuthClient construction reuses cached discovery results without requiring a session, and verify the existing test suite covers the behavior.

Written by the indexing model from the issue text.

Description

(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?

Dominant language
Python
Stars
86
Forks
59
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from intuit/oauth-pythonclient

All issues in intuit/oauth-pythonclient

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.