Skip to content
Open
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
12 changes: 12 additions & 0 deletions crates/google-workspace-cli/src/auth_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
];
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down
Loading