feat(auth): open the OAuth URL in the default browser - #894
Conversation
gws auth login now attempts to open the authorization URL - $BROWSER first, otherwise the platform opener - while keeping the printed URL as the copy-paste fallback. Applies to both the proxy-aware flow and the yup-oauth2 flow delegate. Supersedes googleworkspace#875. Also unbreaks CI on current stable (clippy 1.97 rejects a nested if in helpers/script.rs on unmodified main) and fixes a 1-in-6 test flake (a bare set_var leaked GOOGLE_WORKSPACE_CLI_CONFIG_DIR into later tests; now uses the module's own EnvVarGuard).
🦋 Changeset detectedLatest commit: af57b34 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the user experience for the CLI authentication flow by automatically launching the system's default browser to navigate to the OAuth URL. It includes necessary security safeguards for URL handling, ensures cross-platform compatibility, and addresses minor test isolation and code quality issues. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces the ability to automatically open OAuth login URLs in the default browser across Linux, macOS, and Windows, with a fallback to copy-pasting the URL. It also resolves an environment variable leakage issue in tests by utilizing EnvVarGuard, and simplifies a match expression in the script helper. No review comments were provided, so there is no additional feedback.
|
This PR has been inactive for 72 hours. Closing to keep the queue clean. |
|
This PR was closed because it has been stalled for 72 hours. Feel free to magically reopen it if you want to continue working on it! |
Continues #888, which the staleness bot closed after 72 hours and which GitHub refuses to reopen (the API returns a validation error even though the head branch is intact at af57b34).
Everything from #888 carries over unchanged:
gws auth loginopens the OAuth URL via $BROWSER, then the platform opener (xdg-open / open / explorer), spawned detached; the URL is always printed as a fallback. The login flow currently has no opener at all and ignores $BROWSER; feat(auth): open OAuth URL in default browser automatically #875, which added one, was also closed by the staleness bot rather than reviewed.thread::Builder::spawnso a failed reaper-thread spawn cannot panic the CLI) was addressed in af57b34; the follow-up Gemini pass had no further feedback.Ready for human review.