Skip to content

fix(auth): map meet service to meetings scope prefix#736

Open
jbasso-dev wants to merge 1 commit intogoogleworkspace:mainfrom
jbasso-dev:fix/auth-meet-scopes
Open

fix(auth): map meet service to meetings scope prefix#736
jbasso-dev wants to merge 1 commit intogoogleworkspace:mainfrom
jbasso-dev:fix/auth-meet-scopes

Conversation

@jbasso-dev
Copy link
Copy Markdown

Description

gws auth login -s meet (and multi-service filters like -s drive,gmail,calendar,sheets,docs,meet,tasks) silently requests zero Meet scopes, so subsequent calls like gws meet conferenceRecords list fail with 403 insufficient authentication scopes.

The cause is a naming mismatch: the CLI service alias is meet, but Google's Meet API scopes are https://www.googleapis.com/auth/meetings.*. map_service_to_scope_prefixes returned "meet" via its catch-all arm, so scope_matches_service filtered every Meet scope out of both the picker and find_unmatched_services.

The fix is a one-liner in the same spot that already special-cases sheets, slides, docs, and people:

"meet" => vec!["meetings"],

Once the filter correctly classifies meet as unmatched, the existing augment_with_dynamic_scopes path picks up all three Meet scopes from the Discovery document on its own. No changes to FULL_SCOPES or SCOPE_ENTRIES — those intentionally list only the core Workspace services, not every supported API.

Closes #556. Continuation of #565, which was auto-closed by the stale-bot. Credit to @anshul-garg27 for the original diagnosis; this PR is narrower (just the mapping change) and aligned with the convention set by #414.

Checklist:

  • My code follows the AGENTS.md guidelines (no generated google-* crates).
  • I have run cargo fmt --all to format the code perfectly.
  • I have run cargo clippy -- -D warnings and resolved all warnings. (13 pre-existing errors in main.rs reproduce on clean main — out of scope.)
  • I have added tests that prove my fix is effective or that my feature works.
  • I have provided a Changeset file (e.g. via `pnpx changeset`) to document my changes.

Add a `"meet" => vec!["meetings"]` entry to map_service_to_scope_prefixes
so `gws auth login -s meet` (alone or combined with other services)
correctly identifies Meet scopes. Google exposes the Meet API under
scope URLs prefixed with `meetings.*` (e.g. `meetings.space.readonly`)
even though the CLI's user-facing service alias is `meet`, so the
scope-picker filter matched nothing and silently dropped every Meet
scope — users ended up authenticating with zero Meet permissions.

The existing `augment_with_dynamic_scopes` path now picks up all Meet
scopes from the Discovery document once the filter correctly classifies
`meet` as unmatched, so no changes to `FULL_SCOPES` or `SCOPE_ENTRIES`
are needed.

Closes googleworkspace#556

Continuation of googleworkspace#565, which added only `meetings.space.created` and was
auto-closed by the stale-bot before landing.
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 addresses an issue where the CLI failed to request appropriate authentication scopes for the Google Meet API. By correcting the mapping between the service alias and the API scope prefix, the CLI can now correctly identify and include the necessary scopes during the authentication flow.

Highlights

  • Service Mapping Fix: Added a mapping for the 'meet' service to the 'meetings' scope prefix to resolve authentication scope issues.
  • Test Coverage: Added unit tests to verify that Meet API scopes are correctly matched when the 'meet' service is specified.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize 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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. 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

  1. Review the Generative AI Prohibited Use Policy, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request fixes an issue where the meet service alias failed to match Google Meet scopes, which use the meetings prefix. The changes map the meet service to the meetings scope prefix in the authentication logic and include unit tests to verify the fix. I have no feedback to provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auth login missing scopes for People and Meet APIs

2 participants