Skip to content

Commit 6e8bfee

Browse files
fix(auth): request gmail settings scopes
1 parent a1c394e commit 6e8bfee

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

internal/googleauth/service.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ var serviceOrder = []Service{
7171
var serviceInfoByService = map[Service]serviceInfo{
7272
ServiceGmail: {
7373
scopes: []string{
74-
"https://mail.google.com/",
74+
"https://www.googleapis.com/auth/gmail.modify",
7575
"https://www.googleapis.com/auth/gmail.settings.basic",
76+
"https://www.googleapis.com/auth/gmail.settings.sharing",
7677
},
7778
user: true,
7879
apis: []string{"Gmail API"},

internal/googleauth/service_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,9 @@ func TestScopesForServices_UnionSorted(t *testing.T) {
189189
}
190190
// Ensure expected scopes are included.
191191
want := []string{
192-
"https://mail.google.com/",
192+
"https://www.googleapis.com/auth/gmail.modify",
193+
"https://www.googleapis.com/auth/gmail.settings.basic",
194+
"https://www.googleapis.com/auth/gmail.settings.sharing",
193195
"https://www.googleapis.com/auth/contacts",
194196
"https://www.googleapis.com/auth/contacts.other.readonly",
195197
"https://www.googleapis.com/auth/directory.readonly",
@@ -241,7 +243,9 @@ func TestScopesForManageWithOptions_Readonly(t *testing.T) {
241243

242244
notWant := []string{
243245
"https://mail.google.com/",
246+
"https://www.googleapis.com/auth/gmail.modify",
244247
"https://www.googleapis.com/auth/gmail.settings.basic",
248+
"https://www.googleapis.com/auth/gmail.settings.sharing",
245249
"https://www.googleapis.com/auth/drive",
246250
"https://www.googleapis.com/auth/calendar",
247251
"https://www.googleapis.com/auth/contacts",

0 commit comments

Comments
 (0)