From 28366ec6b6ccdd4451f115a64ed18c0863546055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Basso?= Date: Mon, 20 Apr 2026 07:45:16 -0400 Subject: [PATCH] fix(auth): map meet service to meetings scope prefix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 #556 Continuation of #565, which added only `meetings.space.created` and was auto-closed by the stale-bot before landing. --- .changeset/auth-meet-scopes.md | 5 +++++ .../google-workspace-cli/src/auth_commands.rs | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 .changeset/auth-meet-scopes.md diff --git a/.changeset/auth-meet-scopes.md b/.changeset/auth-meet-scopes.md new file mode 100644 index 00000000..6bc0470c --- /dev/null +++ b/.changeset/auth-meet-scopes.md @@ -0,0 +1,5 @@ +--- +"@googleworkspace/cli": patch +--- + +Fix `gws auth login -s meet` not granting any Meet scopes. The Meet API exposes scopes under the `meetings.*` prefix (e.g. `meetings.space.readonly`), but the CLI's service alias is `meet`, so the scope-picker filter matched nothing and silently dropped every Meet scope. Map the `meet` service to the `meetings` scope prefix so the existing dynamic-augmentation path pulls all Meet scopes from the Discovery document when `-s meet` is supplied. diff --git a/crates/google-workspace-cli/src/auth_commands.rs b/crates/google-workspace-cli/src/auth_commands.rs index d7571e74..2ddc8d1e 100644 --- a/crates/google-workspace-cli/src/auth_commands.rs +++ b/crates/google-workspace-cli/src/auth_commands.rs @@ -841,6 +841,7 @@ fn map_service_to_scope_prefixes(service: &str) -> Vec<&str> { "slides" => vec!["presentations"], "docs" => vec!["documents"], "people" => vec!["contacts", "directory"], + "meet" => vec!["meetings"], s => vec![s], } } @@ -2236,6 +2237,23 @@ mod tests { )); } + #[test] + fn scope_matches_service_meet() { + let services: HashSet = ["meet"].iter().map(|s| s.to_string()).collect(); + assert!(scope_matches_service( + "https://www.googleapis.com/auth/meetings.space.created", + &services + )); + assert!(scope_matches_service( + "https://www.googleapis.com/auth/meetings.space.readonly", + &services + )); + assert!(scope_matches_service( + "https://www.googleapis.com/auth/meetings.space.settings", + &services + )); + } + // ── services filter integration tests ──────────────────────────────── #[test]