fix(auth): map meet service to meetings scope prefix#736
fix(auth): map meet service to meetings scope prefix#736jbasso-dev wants to merge 1 commit intogoogleworkspace:mainfrom
Conversation
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.
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 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
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 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 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
|
There was a problem hiding this comment.
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.
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 likegws meet conferenceRecords listfail with403 insufficient authentication scopes.The cause is a naming mismatch: the CLI service alias is
meet, but Google's Meet API scopes arehttps://www.googleapis.com/auth/meetings.*.map_service_to_scope_prefixesreturned"meet"via its catch-all arm, soscope_matches_servicefiltered every Meet scope out of both the picker andfind_unmatched_services.The fix is a one-liner in the same spot that already special-cases
sheets,slides,docs, andpeople:Once the filter correctly classifies
meetas unmatched, the existingaugment_with_dynamic_scopespath picks up all three Meet scopes from the Discovery document on its own. No changes toFULL_SCOPESorSCOPE_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:
AGENTS.mdguidelines (no generatedgoogle-*crates).cargo fmt --allto format the code perfectly.cargo clippy -- -D warningsand resolved all warnings. (13 pre-existing errors inmain.rsreproduce on cleanmain— out of scope.)