fix(auth): avoid forcing userinfo profile scope#801
Conversation
|
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 updates the authentication flow to prevent the automatic request of the 'userinfo.profile' scope. By restricting mandatory identity scopes to 'openid' and 'userinfo.email', the application becomes more flexible for OAuth clients that lack permission to request profile information, while maintaining necessary user identification capabilities. 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 refactors the scope handling logic in auth_commands.rs by introducing the ensure_login_identity_scopes helper function. The change removes the mandatory inclusion of the userinfo.profile scope to accommodate OAuth clients that cannot request it, while ensuring openid and userinfo.email remain present. A new unit test verifies that the profile scope is no longer forced. I have no feedback to provide.
Fixes #770.
Summary
openidanduserinfo.emailas login identity scopesuserinfo.profileduring auth login so OAuth clients that cannot request it can still complete loginTests
cargo fmt --checkcargo test -p google-workspace-cli ensure_login_identity_scopes_does_not_force_profile_scope