Conversation
… compliance - Use rundll32 instead of cmd /c start to prevent shell metacharacter injection in URLs on Windows - Replace panic with fmt.Fprintf + os.Exit(1) for consistent error handling in loadConfig - Write token save warning to stderr instead of stdout in refreshAccessToken - Add token_type_hint parameter to revocation requests per RFC 7009
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
This PR hardens browser launching on Windows to avoid shell-based command injection and improves OAuth token revocation compliance with RFC 7009.
Changes:
- Switch Windows browser launch from
cmd /c starttorundll32 url.dll,FileProtocolHandler. - Add
token_type_hintto token revocation requests (refresh vs access token). - Standardize CLI error/warning output by writing errors to stderr and avoiding
panic()inloadConfig.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| token_cmd.go | Adds token_type_hint to revocation requests and updates call sites accordingly. |
| config.go | Replaces a panic() with stderr output + os.Exit(1) for retry client creation failure. |
| browser.go | Uses rundll32 for Windows URL opening to avoid shell metacharacter injection. |
| auth.go | Writes token-save warnings to stderr instead of stdout. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Align error message wording to say "retry HTTP client" in loadConfig - Add token_type_hint assertions to revocation tests for RFC 7009 compliance
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Track revocation call count to ensure exactly one request is made when only an access token exists (no refresh token)
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Conditionally include token_type_hint only when non-empty for server compatibility - Extract browserCommand helper for testability and add unit tests covering darwin, windows, and linux command construction
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
rundll32 url.dll,FileProtocolHandlerinstead ofcmd /c starton Windows to prevent shell metacharacter injection in URLstoken_type_hintparameter to token revocation requests per RFC 7009panic()withfmt.Fprintf(os.Stderr, ...)+os.Exit(1)for consistent error handling inloadConfigrefreshAccessTokenTest plan
make test— all existing tests passmake lint— 0 issuesrundll32browser launch🤖 Generated with Claude Code