Skip to content

Commit 7901153

Browse files
Niloth-ptimabbott
authored andcommitted
google-calendar: Narrow the permission scope to calendar events.
Previously used scope: `calendar.readonly` New scope: `calendar.events.readonly` Other than events, a calendar contains `settings`, `addons` ,`app`, `calendarlist`, `calendars`, `acls` (permissions), `freebusy` (availability), and more. Since this integration only sends reminders, we need access only to the events. More narrow scopes like `calendar.events.owned.readonly` and `calendar.events.public.readonly` are available, but we want to be able to support shared calendars as well, so we're not using them. Also removed a comment regarding SCOPES that has now become redundant.
1 parent ab42ddb commit 7901153

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

zulip/integrations/google/get-google-credentials

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ from google.auth.transport.requests import Request
55
from google.oauth2.credentials import Credentials
66
from google_auth_oauthlib.flow import InstalledAppFlow
77

8-
# If modifying these scopes, delete your previously saved credentials
9-
# at zulip/bots/gcal/
10-
# NOTE: When adding more scopes, add them after the previous one in the same field, with a space
11-
# seperating them.
12-
SCOPES = ["https://www.googleapis.com/auth/calendar.readonly"]
8+
SCOPES = ["https://www.googleapis.com/auth/calendar.events.readonly"]
139
# This file contains the information that google uses to figure out which application is requesting
1410
# this client's data.
1511
CLIENT_SECRET_FILE = "client_secret.json" # noqa: S105

zulip/integrations/google/google-calendar

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ except ImportError:
2121
sys.path.append(os.path.join(os.path.dirname(__file__), "../../"))
2222
import zulip
2323

24-
SCOPES = ["https://www.googleapis.com/auth/calendar.readonly"]
24+
SCOPES = ["https://www.googleapis.com/auth/calendar.events.readonly"]
2525
CLIENT_SECRET_FILE = "client_secret.json" # noqa: S105
2626
HOME_DIR = os.path.expanduser("~")
2727

0 commit comments

Comments
 (0)