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/fix-auth-people-meet-scopes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@googleworkspace/cli": patch
---

Add People and Meet scopes to auth login picker and full preset
24 changes: 24 additions & 0 deletions src/auth_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
];
Expand Down Expand Up @@ -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],
}
}
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -1965,6 +1976,19 @@ mod tests {
));
}

#[test]
fn scope_matches_service_meet_meetings() {
let services: HashSet<String> = ["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<String> = ["chat"].iter().map(|s| s.to_string()).collect();
Expand Down
Loading