From 725b3eb408d4d01bb8eb099cc6a0b6907354e372 Mon Sep 17 00:00:00 2001 From: Ricardo Espinoza Date: Sun, 28 Feb 2021 11:27:52 -0500 Subject: [PATCH] :bug: Add the right scopes to Gmail service account authentication. (#1481) * fix: request gmail scope instead of books * :zap: Small improvement to #1427 * :zap: Add svg logo Co-authored-by: Josh --- .../nodes/Google/Gmail/GenericFunctions.ts | 7 ++++++- .../nodes-base/nodes/Google/Gmail/Gmail.node.ts | 4 ++-- packages/nodes-base/nodes/Google/Gmail/gmail.png | Bin 1954 -> 0 bytes packages/nodes-base/nodes/Google/Gmail/gmail.svg | 10 ++++++++++ 4 files changed, 18 insertions(+), 3 deletions(-) delete mode 100644 packages/nodes-base/nodes/Google/Gmail/gmail.png create mode 100644 packages/nodes-base/nodes/Google/Gmail/gmail.svg diff --git a/packages/nodes-base/nodes/Google/Gmail/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Gmail/GenericFunctions.ts index 3dc2eabe92..8cc738cf8e 100644 --- a/packages/nodes-base/nodes/Google/Gmail/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Gmail/GenericFunctions.ts @@ -216,7 +216,12 @@ function getAccessToken(this: IExecuteFunctions | IExecuteSingleFunctions | ILoa //https://developers.google.com/identity/protocols/oauth2/service-account#httprest const scopes = [ - 'https://www.googleapis.com/auth/books', + 'https://www.googleapis.com/auth/gmail.labels', + 'https://www.googleapis.com/auth/gmail.addons.current.action.compose', + 'https://www.googleapis.com/auth/gmail.addons.current.message.action', + 'https://mail.google.com/', + 'https://www.googleapis.com/auth/gmail.modify', + 'https://www.googleapis.com/auth/gmail.compose', ]; const now = moment().unix(); diff --git a/packages/nodes-base/nodes/Google/Gmail/Gmail.node.ts b/packages/nodes-base/nodes/Google/Gmail/Gmail.node.ts index 5601c259c5..158c0de9b0 100644 --- a/packages/nodes-base/nodes/Google/Gmail/Gmail.node.ts +++ b/packages/nodes-base/nodes/Google/Gmail/Gmail.node.ts @@ -66,14 +66,14 @@ export class Gmail implements INodeType { description: INodeTypeDescription = { displayName: 'Gmail', name: 'gmail', - icon: 'file:gmail.png', + icon: 'file:gmail.svg', group: ['transform'], version: 1, subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', description: 'Consume the Gmail API', defaults: { name: 'Gmail', - color: '#d93025', + color: '#4285F4', }, inputs: ['main'], outputs: ['main'], diff --git a/packages/nodes-base/nodes/Google/Gmail/gmail.png b/packages/nodes-base/nodes/Google/Gmail/gmail.png deleted file mode 100644 index 17210480702b3738f3d864c188c8df41be830b05..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1954 zcmX|B2{_bi7azuGOu6ZjeTyO&g>XsBm|Pmm%w!9LrjSpOlr6H%5RZz!Zs7`b!!=>X zZY*=DF3+2UL0O5zHnJ$XO?+?bSJsJDTH$Dm$-NhOye-Uf?i?*ohGwteqh5 zj^-Zte`DT1kn4`(u!ev<(+$n>_|C)#$gDvQ7Jw)&7R?rTlwd6uRe`nyl0fhs3gQC; z2wYDz%N;d~#Vk2FP2u3Yn~p#oK+gda{k;Ovj(1RV4r@CWfMhf1Y{sCV9U+995H4UI zNEN91e|Hoc$N(B#(OeH(mYV~IIY_A@0Rq@eI)7t<>+8mx?EhEBKNWy2U^t!_misk; z1MmT3&wMR2JIi02tF9t#uJE`Ie9BDq=ED8?%bXetc`o)LW3-1J9#C6Tx;Zt(dzILo z6t$G|+j7zS_5M!_pQ)=&6lxQtEA4q#MST9rt5YfnDfhfydf^OU#U=)eMB?U)2o94jI0rYo?|TQXpm*`b5b##YgY8icAR&nQeh!az z!n-ezzrHiyvsZ6p))ssldyF~sHrn?#%1A?MX`0rYp8PZdXMa^iLHa0^&tcV;{2GtY z(K>u+Z*yXBV4$m<_&V^ei=*5RV&C?5cQ%)py;Yenp7>odIlIeWoaJ#@Gt*O(<6|TA z{_f7s_STk zni?9)i#^eHKWiz;d6BILK_HPZq=mVo%g5~WFt2{NY$8}xGcrlo0H!wDKk9auOed48 zLY5o0CL;w7yMARaLOBdCVj%x`U$xU?QgdsvK}?L8SbL`NCu7Q8=`9sQ5)^%Sv{`nz z($MV&a--(Wwb0kif1MYVJyIf{4Qggr#uw%4>h{IPBz=JqCJgBC@Tl`K<+&s0D!h&B zXH-Frx|4P_TD?%Jl2K7`D@fGPo>IB61#ts!jb87 zi+>hdMx))2}vKkD~LfFDzNYi%{+ z#nL^hU;=!^w&#to4)=(|7!>P=tO9qtL&6`KbgyNwXY$(<rU!H_Soc_JL>GQ20;U8Q)%ul*LOa>?Z&0D+EGX9<I zLbvz6xzd6|4gM<)vHOprRhXskx=wiB@umRni_M)h>5px1(?Tw!mE}jfwq*_$t{$=~ zUCML$6RtV23JyZTN6L^P+s|#@wTgw|q$YyAj%kX?`fj~$pPJMOz36)RSFa;@qsv?3 z&Uw#-lfZxYDVA4oYE}04m9*>{)BT-6av9TfvsA+~3&#~oVs^E~3S)124+uGSibOq; zIXv8{{#J&u?BS!k*Jm1+5qm7}RqqdnuB%DVFKXxMziU(BjLcMJ*19L*q_P_{@~k28 zTMR$A`Q%1zNeOO z8bVumQB2B;@_k@!4pOa-17ArMruB5&Z|@LIUwS?;7nc~4hDuIKGs4K-1+WWL*%TXV zEtd~)#%k*0n#EJkoM5*>EK@^>v@ZUB(AnC(wyZQ&gr+{E8lf7*<7H*#<7C4hoYOJ4 zw^G#^C+k9Qsx@Tph$`Xr_JXV_FB6(vGJ z22_J2X;@p94W;aP|Bawp7o6ni#X6T@Ixm|p)%jhMBN_`?rPjai!CTZ5j>1$tOiYz=jQhE(93~Z$TCG7ekMo1} zdOKHAz@7RD#eqWkl)}nHP-Z*zZlS_`=YkX+@s((2jom4!f{5ht{6Aw`iJLTRdM)S~ z|N0lLoa%&mql$MgmrIOiPnn3o)kt-U;)CX(f~8B}PvF7*! diff --git a/packages/nodes-base/nodes/Google/Gmail/gmail.svg b/packages/nodes-base/nodes/Google/Gmail/gmail.svg new file mode 100644 index 0000000000..7f6de6b2e9 --- /dev/null +++ b/packages/nodes-base/nodes/Google/Gmail/gmail.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file