fix(auth): add configurable HTTP timeout on OIDC discovery and JWKS fetches#246
Draft
remidebette wants to merge 1 commit into
Draft
fix(auth): add configurable HTTP timeout on OIDC discovery and JWKS fetches#246remidebette wants to merge 1 commit into
remidebette wants to merge 1 commit into
Conversation
…etches The bare requests.get calls in _get_oidc_jwks have no timeout, so a slow or hung IdP blocks request threads until the OS-level TCP timeout (~2 minutes), turning a brief upstream blip into a wave of authentication failures. Adds OIDC_HTTP_TIMEOUT_SECONDS (default: 10) so operators can tune the timeout per deployment — lower for faster failover when the IdP is unreachable, higher for slower providers. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Defensive fix — not observed in production. Surfaced while reviewing the auth path during a broader resilience audit (no related incident).
The bare
requests.getcalls in_get_oidc_jwkshave no timeout, so a slow or hung IdP would block request threads until the OS-level TCP timeout (~2 minutes), turning a brief upstream blip into a wave of authentication failures. This PR adds a bounded, configurable timeout so that failure mode is impossible regardless of IdP health.Changes
Test plan
Notes
This was originally bundled with #243 (auth-failure diagnostics) and split out per @kharkevich's review feedback there. Marked as draft since it's defensive — happy to close if maintainers prefer to skip it given there's no production signal.
🤖 Generated with Claude Code