Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to cache HTTP clients (useful for slow oauth2 probes) #1155

Open
nemobis opened this issue Nov 21, 2023 · 0 comments
Open

Allow to cache HTTP clients (useful for slow oauth2 probes) #1155

nemobis opened this issue Nov 21, 2023 · 0 comments

Comments

@nemobis
Copy link

nemobis commented Nov 21, 2023

The default oauth2 module works well, however http.go creates a new client (pconfig.NewClientFromConfig()) for every single probe.

We'd like to cache the client across probes, so that we can reuse authorization tokens and avoid overloading the oauth2 provider. This requires the introduction of some cache expiry method.

For our own internal purposes we're using a patched version which simply creates a new client whenever the probe fails with an HTTP 401 (http.StatusUnauthorized). Not sure whether that's good enough for everyone. We would like to upstream the patch but have little resources for any needed changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant