Skip to content

Commit e9e2c6f

Browse files
Adam GoughAdam Gough
authored andcommitted
added google forms scope and google drive scope
1 parent 1513862 commit e9e2c6f

File tree

12 files changed

+20
-19
lines changed

12 files changed

+20
-19
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/components/sub-block/components/credential-selector/components/oauth-required-modal.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@ const SCOPE_DESCRIPTIONS: Record<string, string> = {
3838
'https://www.googleapis.com/auth/gmail.modify': 'View and manage your email messages',
3939
// 'https://www.googleapis.com/auth/gmail.readonly': 'View and read your email messages',
4040
// 'https://www.googleapis.com/auth/drive': 'View and manage your Google Drive files',
41-
'https://www.googleapis.com/auth/drive.file': 'View and manage your Google Drive files',
41+
'https://www.googleapis.com/auth/drive.readonly': 'View and read your Google Drive files',
4242
// 'https://www.googleapis.com/auth/documents': 'View and manage your Google Docs',
4343
'https://www.googleapis.com/auth/calendar': 'View and manage your calendar',
4444
'https://www.googleapis.com/auth/userinfo.email': 'View your email address',
4545
'https://www.googleapis.com/auth/userinfo.profile': 'View your basic profile info',
46+
'https://www.googleapis.com/auth/forms.responses.readonly': 'View responses to your Google Forms',
4647
'read:page:confluence': 'Read Confluence pages',
4748
'write:page:confluence': 'Write Confluence pages',
4849
'read:me': 'Read your profile information',

apps/sim/blocks/blocks/google_docs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const GoogleDocsBlock: BlockConfig<GoogleDocsResponse> = {
3737
required: true,
3838
provider: 'google-docs',
3939
serviceId: 'google-docs',
40-
requiredScopes: ['https://www.googleapis.com/auth/drive.file'],
40+
requiredScopes: ['https://www.googleapis.com/auth/drive.readonly'],
4141
placeholder: 'Select Google account',
4242
},
4343
// Document selector (basic mode)

apps/sim/blocks/blocks/google_drive.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const GoogleDriveBlock: BlockConfig<GoogleDriveResponse> = {
3636
required: true,
3737
provider: 'google-drive',
3838
serviceId: 'google-drive',
39-
requiredScopes: ['https://www.googleapis.com/auth/drive.file'],
39+
requiredScopes: ['https://www.googleapis.com/auth/drive.readonly'],
4040
placeholder: 'Select Google Drive account',
4141
},
4242
// Upload Fields
@@ -80,7 +80,7 @@ export const GoogleDriveBlock: BlockConfig<GoogleDriveResponse> = {
8080
canonicalParamId: 'folderId',
8181
provider: 'google-drive',
8282
serviceId: 'google-drive',
83-
requiredScopes: ['https://www.googleapis.com/auth/drive.file'],
83+
requiredScopes: ['https://www.googleapis.com/auth/drive.readonly'],
8484
mimeType: 'application/vnd.google-apps.folder',
8585
placeholder: 'Select a parent folder',
8686
mode: 'basic',
@@ -156,7 +156,7 @@ export const GoogleDriveBlock: BlockConfig<GoogleDriveResponse> = {
156156
canonicalParamId: 'folderId',
157157
provider: 'google-drive',
158158
serviceId: 'google-drive',
159-
requiredScopes: ['https://www.googleapis.com/auth/drive.file'],
159+
requiredScopes: ['https://www.googleapis.com/auth/drive.readonly'],
160160
mimeType: 'application/vnd.google-apps.folder',
161161
placeholder: 'Select a parent folder',
162162
mode: 'basic',
@@ -183,7 +183,7 @@ export const GoogleDriveBlock: BlockConfig<GoogleDriveResponse> = {
183183
canonicalParamId: 'folderId',
184184
provider: 'google-drive',
185185
serviceId: 'google-drive',
186-
requiredScopes: ['https://www.googleapis.com/auth/drive.file'],
186+
requiredScopes: ['https://www.googleapis.com/auth/drive.readonly'],
187187
mimeType: 'application/vnd.google-apps.folder',
188188
placeholder: 'Select a folder to list files from',
189189
mode: 'basic',

apps/sim/lib/auth.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ export const auth = betterAuth({
425425
scopes: [
426426
'https://www.googleapis.com/auth/userinfo.email',
427427
'https://www.googleapis.com/auth/userinfo.profile',
428-
'https://www.googleapis.com/auth/drive.file',
428+
'https://www.googleapis.com/auth/drive.readonly',
429429
],
430430
prompt: 'consent',
431431
redirectURI: `${env.NEXT_PUBLIC_APP_URL}/api/auth/oauth2/callback/google-drive`,
@@ -439,7 +439,7 @@ export const auth = betterAuth({
439439
scopes: [
440440
'https://www.googleapis.com/auth/userinfo.email',
441441
'https://www.googleapis.com/auth/userinfo.profile',
442-
'https://www.googleapis.com/auth/drive.file',
442+
'https://www.googleapis.com/auth/drive.readonly',
443443
],
444444
prompt: 'consent',
445445
redirectURI: `${env.NEXT_PUBLIC_APP_URL}/api/auth/oauth2/callback/google-docs`,
@@ -453,7 +453,7 @@ export const auth = betterAuth({
453453
scopes: [
454454
'https://www.googleapis.com/auth/userinfo.email',
455455
'https://www.googleapis.com/auth/userinfo.profile',
456-
'https://www.googleapis.com/auth/drive.file',
456+
'https://www.googleapis.com/auth/drive.readonly',
457457
],
458458
prompt: 'consent',
459459
redirectURI: `${env.NEXT_PUBLIC_APP_URL}/api/auth/oauth2/callback/google-sheets`,

apps/sim/lib/oauth/oauth.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export const OAUTH_PROVIDERS: Record<string, OAuthProviderConfig> = {
121121
providerId: 'google-drive',
122122
icon: (props) => GoogleDriveIcon(props),
123123
baseProviderIcon: (props) => GoogleIcon(props),
124-
scopes: ['https://www.googleapis.com/auth/drive.file'],
124+
scopes: ['https://www.googleapis.com/auth/drive.readonly'],
125125
},
126126
'google-docs': {
127127
id: 'google-docs',
@@ -130,7 +130,7 @@ export const OAUTH_PROVIDERS: Record<string, OAuthProviderConfig> = {
130130
providerId: 'google-docs',
131131
icon: (props) => GoogleDocsIcon(props),
132132
baseProviderIcon: (props) => GoogleIcon(props),
133-
scopes: ['https://www.googleapis.com/auth/drive.file'],
133+
scopes: ['https://www.googleapis.com/auth/drive.readonly'],
134134
},
135135
'google-sheets': {
136136
id: 'google-sheets',
@@ -139,7 +139,7 @@ export const OAUTH_PROVIDERS: Record<string, OAuthProviderConfig> = {
139139
providerId: 'google-sheets',
140140
icon: (props) => GoogleSheetsIcon(props),
141141
baseProviderIcon: (props) => GoogleIcon(props),
142-
scopes: ['https://www.googleapis.com/auth/drive.file'],
142+
scopes: ['https://www.googleapis.com/auth/drive.readonly'],
143143
},
144144
'google-forms': {
145145
id: 'google-forms',

apps/sim/tools/google_docs/create.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const createTool: ToolConfig<GoogleDocsToolParams, GoogleDocsCreateRespon
1313
oauth: {
1414
required: true,
1515
provider: 'google-docs',
16-
additionalScopes: ['https://www.googleapis.com/auth/drive.file'],
16+
additionalScopes: ['https://www.googleapis.com/auth/drive.readonly'],
1717
},
1818

1919
params: {

apps/sim/tools/google_docs/read.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const readTool: ToolConfig<GoogleDocsToolParams, GoogleDocsReadResponse>
1111
oauth: {
1212
required: true,
1313
provider: 'google-docs',
14-
additionalScopes: ['https://www.googleapis.com/auth/drive.file'],
14+
additionalScopes: ['https://www.googleapis.com/auth/drive.readonly'],
1515
},
1616

1717
params: {

apps/sim/tools/google_docs/write.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const writeTool: ToolConfig<GoogleDocsToolParams, GoogleDocsWriteResponse
99
oauth: {
1010
required: true,
1111
provider: 'google-docs',
12-
additionalScopes: ['https://www.googleapis.com/auth/drive.file'],
12+
additionalScopes: ['https://www.googleapis.com/auth/drive.readonly'],
1313
},
1414
params: {
1515
accessToken: {

apps/sim/tools/google_drive/create_folder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const createFolderTool: ToolConfig<GoogleDriveToolParams, GoogleDriveUplo
1010
oauth: {
1111
required: true,
1212
provider: 'google-drive',
13-
additionalScopes: ['https://www.googleapis.com/auth/drive.file'],
13+
additionalScopes: ['https://www.googleapis.com/auth/drive.readonly'],
1414
},
1515

1616
params: {

apps/sim/tools/google_drive/get_content.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const getContentTool: ToolConfig<GoogleDriveToolParams, GoogleDriveGetCon
1818
oauth: {
1919
required: true,
2020
provider: 'google-drive',
21-
additionalScopes: ['https://www.googleapis.com/auth/drive.file'],
21+
additionalScopes: ['https://www.googleapis.com/auth/drive.readonly'],
2222
},
2323

2424
params: {

0 commit comments

Comments
 (0)