From 1fa1bd0c1372650f17a12d5fc770865ae7276ba6 Mon Sep 17 00:00:00 2001 From: Anshul Garg Date: Thu, 19 Mar 2026 11:46:12 +0530 Subject: [PATCH] fix(auth): add People and Meet scopes to login picker The interactive scope selector and --full preset were missing scopes for People API (contacts) and Meet API (meetings.space.created), causing insufficient-scope errors when calling those services. - Add contacts and meetings.space.created to SCOPE_ENTRIES for the TUI picker - Add both to FULL_SCOPES so --full covers them - Map "meet" service to "meetings" scope prefix so -s meet works Closes #556 --- .changeset/fix-auth-people-meet-scopes.md | 5 +++++ src/auth_commands.rs | 24 +++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 .changeset/fix-auth-people-meet-scopes.md diff --git a/.changeset/fix-auth-people-meet-scopes.md b/.changeset/fix-auth-people-meet-scopes.md new file mode 100644 index 00000000..f8eda2dd --- /dev/null +++ b/.changeset/fix-auth-people-meet-scopes.md @@ -0,0 +1,5 @@ +--- +"@googleworkspace/cli": patch +--- + +Add People and Meet scopes to auth login picker and full preset diff --git a/src/auth_commands.rs b/src/auth_commands.rs index 6d0ffb7d..d715c318 100644 --- a/src/auth_commands.rs +++ b/src/auth_commands.rs @@ -76,6 +76,8 @@ pub const FULL_SCOPES: &[&str] = &[ "https://www.googleapis.com/auth/documents", "https://www.googleapis.com/auth/presentations", "https://www.googleapis.com/auth/tasks", + "https://www.googleapis.com/auth/contacts", + "https://www.googleapis.com/auth/meetings.space.created", "https://www.googleapis.com/auth/pubsub", "https://www.googleapis.com/auth/cloud-platform", ]; @@ -571,6 +573,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], } } @@ -1292,6 +1295,14 @@ const SCOPE_ENTRIES: &[ScopeEntry] = &[ scope: "https://www.googleapis.com/auth/tasks", label: "Google Tasks", }, + ScopeEntry { + scope: "https://www.googleapis.com/auth/contacts", + label: "Google Contacts (People API)", + }, + ScopeEntry { + scope: "https://www.googleapis.com/auth/meetings.space.created", + label: "Google Meet", + }, ScopeEntry { scope: "https://www.googleapis.com/auth/pubsub", label: "Cloud Pub/Sub", @@ -1965,6 +1976,19 @@ mod tests { )); } + #[test] + fn scope_matches_service_meet_meetings() { + 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 + )); + } + #[test] fn scope_matches_service_chat() { let services: HashSet = ["chat"].iter().map(|s| s.to_string()).collect();