fix(config): timeout OAuth subprocesses#1694
Open
kawacukennedy wants to merge 2 commits into
Open
Conversation
Both exec.Command calls in config/oauth.go suppressed the noctx linter and could hang indefinitely if the Python helper script stalls (e.g. waiting for network, user input, or a broken process). - GetOAuth2Token: add 30-second timeout via exec.CommandContext; capture stderr into a buffer so error messages are included in the returned error instead of leaking to the application's stderr. - RunOAuth2Flow: add 5-minute timeout (user needs time for browser-based consent); capture stderr for richer error reporting on failure. This also fixes the previous behavior where the Python subprocess's stderr was piped directly to os.Stderr, which could leak sensitive information (tokens, error traces) to logs or terminal output.
Member
Benchmark report — no significant changeMetrics worse: 0 · better: 0 (threshold: ±3%). benchstat outputauto-generated by benchmarks.yml |
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.
What?
Add context timeouts to both OAuth subprocess calls (30s for token retrieval, 5 min for browser flow). Capture stderr into a buffer instead of leaking it to
os.Stderr.Why?
Both
exec.Commandcalls suppressed thenoctxlinter and could hang indefinitely if the Python helper script stalled. Stderr was piped directly toos.Stderr, which could leak sensitive information (tokens, error traces) to logs.