Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scope requests might be to permissive #123

Closed
chregon opened this issue Apr 23, 2020 · 11 comments · Fixed by #444
Closed

Scope requests might be to permissive #123

chregon opened this issue Apr 23, 2020 · 11 comments · Fixed by #444
Labels
enhancement New feature or request

Comments

@chregon
Copy link

chregon commented Apr 23, 2020

I hope this is the right place for this, if not please inform me.

I think many users find the requested scope is a bit too much (e.g. read, edit, and delete all emails).

In my case, I have the script running with only:

"oauthScopes": [
    "https://www.googleapis.com/auth/calendar",
    "https://www.googleapis.com/auth/script.external_request",
    "https://www.googleapis.com/auth/script.scriptapp"
  ],

in the appscript.json. So no emails, and no task integration, but I bet many users don't find these necessary.

I think having the scope set manually, and maybe even informing the user of how to remove unneeded scope can help reach more people on the fence of using this. Also, might prevent some issues like this issue from becoming catastrophic down the line.

See, Authorization Scopes documentation for more.

@chregon chregon added the enhancement New feature or request label Apr 23, 2020
@jonas0b1011001
Copy link
Collaborator

Hi,
thank you for the feedback! I agree that the requested permission might be daunting to some users, but as this is open source nobody has to blindly trust the script to not misuse the permissions.

(e.g. read, edit, and delete all emails)

This will be changed in the next version by switching from GMailApp to MailApp.
Unlike GmailApp, MailApp's sole purpose is sending email. MailApp cannot access a user's Gmail inbox.

So no emails, and no task integration, but I bet many users don't find these necessary.

I see that some features are not used by some users, the best solution would be to dynamically request permissions based on the settings activated by the user but this is as far as i know currently not possible.

I think having the scope set manually, and maybe even informing the user of how to remove unneeded scope

As "Apps Script automatically detects what scopes are needed" the script will always request all permissions that might be used by the script. An explaining wiki post about Permissions and how to adjust them is a good idea.

Also, might prevent some issues like this issue from becoming catastrophic down the line.

The script will never edit/delete events that were not originally created by it!

@derekantrican
Copy link
Owner

That assessment sounds fine to me. I didn't realize that by using MailApp instead of GmailApp you can restrict the permissions you request (I haven't used MailApp much and figured they were more or less synonymous). I've never liked how some of Google's permissions descriptions, while true, make it sound like the program is going to destroy everything (eg "Can delete all your calendars...." etc) so limiting the permissions we request sounds like a good way to put some people's minds at ease

@vsub21
Copy link

vsub21 commented Oct 13, 2020

@chregon2001 Thanks for this info, I was also concerned about the excessive permissions required to run the app. Glad to know I can control it through oauthScopes.

@matthewmb
Copy link

@chregon agreed, nice find with the oauth scopes. It would be great if this info was in the installation instructions.

@derekantrican
Copy link
Owner

Please check out #191. I simply removed the last GmailApp usage (changed to MailApp) and now the "Read, compose, send, and permanently delete all your email from Gmail" is no longer requested.

The following are still requested:

  • See, edit, share, and permanently delete all of the calendars you can access using Google Calendar
  • Connect to an external service
  • Send email as you
  • Allow this application to run when you are not present
  • Create, edit, organize, and delete all your tasks

@VNRARA
Copy link

VNRARA commented Aug 18, 2022

qq: why is the script using Google Drive permissions now?

image

@jonas0b1011001
Copy link
Collaborator

qq: why is the script using Google Drive permissions now?

  1. This is not an official release you are using.
  2. Remove the two comments in Helpers.gs lines 89&90 to get rid of the permission request.

@hudcap
Copy link

hudcap commented Feb 16, 2023

Another option is to have a throwaway google account and install the script to the throwaway account. Then the calendar can be shared to your primary google account.

@VNRARA
Copy link

VNRARA commented Feb 18, 2023

@jonas0b1011001 This was literally a copy from this GitHub I made.

@jonas0b1011001
Copy link
Collaborator

@jonas0b1011001 This was literally a copy from this GitHub I made.

The filename suggests you made a copy of a testversion from my google drive. You might have found it somewhere in the comments but that does not mean it's an official realease.

@jonas0b1011001
Copy link
Collaborator

I just created a wiki article about this topic.

Further steps i'd like to take to address the concerns:

  1. Edit appscript.json to include the oauth scopes by default for easier editing.
{
  "timeZone": "Etc/GMT",
  "dependencies": {
    "enabledAdvancedServices": [
      {
        "userSymbol": "Tasks",
        "serviceId": "tasks",
        "version": "v1"
      },
      {
        "userSymbol": "Calendar",
        "serviceId": "calendar",
        "version": "v3"
      }
    ]
  },
  "oauthScopes": [
    "https://www.googleapis.com/auth/script.scriptapp",
    "https://www.googleapis.com/auth/tasks",
    "https://www.googleapis.com/auth/script.send_mail",
    "https://www.googleapis.com/auth/calendar",
    "https://www.googleapis.com/auth/script.external_request"
  ],
  "exceptionLogging": "STACKDRIVER",
  "runtimeVersion": "V8"
}
  1. Add a link to the wiki article in the script's instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
7 participants