Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/auth-scope-picker-contacts-gmail-settings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@googleworkspace/cli": patch
---

Include Google Contacts and Gmail settings scopes in full login scopes and fallback scope picker entries.
19 changes: 19 additions & 0 deletions crates/google-workspace-cli/src/auth_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,11 @@ pub const FULL_SCOPES: &[&str] = &[
"https://www.googleapis.com/auth/drive",
"https://www.googleapis.com/auth/spreadsheets",
"https://www.googleapis.com/auth/gmail.modify",
"https://www.googleapis.com/auth/gmail.settings.basic",
"https://www.googleapis.com/auth/calendar",
"https://www.googleapis.com/auth/documents",
"https://www.googleapis.com/auth/presentations",
"https://www.googleapis.com/auth/contacts",
"https://www.googleapis.com/auth/tasks",
"https://www.googleapis.com/auth/pubsub",
"https://www.googleapis.com/auth/cloud-platform",
Expand Down Expand Up @@ -1549,6 +1551,14 @@ const SCOPE_ENTRIES: &[ScopeEntry] = &[
scope: "https://www.googleapis.com/auth/gmail.modify",
label: "Gmail",
},
ScopeEntry {
scope: "https://www.googleapis.com/auth/gmail.settings.basic",
label: "Gmail Settings",
},
ScopeEntry {
scope: "https://www.googleapis.com/auth/contacts",
label: "Google Contacts",
},
ScopeEntry {
scope: "https://www.googleapis.com/auth/calendar",
label: "Google Calendar",
Expand Down Expand Up @@ -1789,6 +1799,15 @@ 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/gmail.settings.basic".to_string()));
assert!(scopes.contains(&"https://www.googleapis.com/auth/contacts".to_string()));
}

#[test]
fn scope_entries_include_contacts_and_gmail_settings_basic() {
let scope_entries: Vec<&str> = SCOPE_ENTRIES.iter().map(|entry| entry.scope).collect();
assert!(scope_entries.contains(&"https://www.googleapis.com/auth/gmail.settings.basic"));
assert!(scope_entries.contains(&"https://www.googleapis.com/auth/contacts"));
}

#[test]
Expand Down
Loading