From 59ff9fb7b78e2c4b53dc985f472920077f68b730 Mon Sep 17 00:00:00 2001 From: Lubrsy706 Date: Fri, 15 May 2026 10:27:36 +0800 Subject: [PATCH] fix(auth): include contacts scope for people --- crates/google-workspace-cli/src/auth_commands.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates/google-workspace-cli/src/auth_commands.rs b/crates/google-workspace-cli/src/auth_commands.rs index d7571e74..0afc6444 100644 --- a/crates/google-workspace-cli/src/auth_commands.rs +++ b/crates/google-workspace-cli/src/auth_commands.rs @@ -293,6 +293,7 @@ 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/pubsub", "https://www.googleapis.com/auth/cloud-platform", ]; @@ -1565,6 +1566,10 @@ 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", + }, ScopeEntry { scope: "https://www.googleapis.com/auth/pubsub", label: "Cloud Pub/Sub", @@ -1789,6 +1794,7 @@ mod tests { fn resolve_scopes_full_returns_full_scopes() { let scopes = run_resolve_scopes(ScopeMode::Full, None); assert_eq!(scopes.len(), FULL_SCOPES.len()); + assert!(scopes.contains(&"https://www.googleapis.com/auth/contacts".to_string())); } #[test] @@ -2295,6 +2301,12 @@ mod tests { } } + #[test] + fn resolve_scopes_services_people_full_includes_contacts_write() { + let scopes = run_resolve_scopes_with_services(ScopeMode::Full, None, &["people"]); + assert!(scopes.contains(&"https://www.googleapis.com/auth/contacts".to_string())); + } + #[test] fn resolve_scopes_explicit_scopes_bypass_services_filter() { // Custom scopes take priority over services filter