@sentry/junior-google 0.308.0 → 0.310.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +24 -8
  2. package/dist/index.js +697 -304
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  Proof of concept. Junior uses its own Google Workspace account, such as
4
4
  `junior@example.com`, to schedule meetings, read Meet transcripts, read
5
- Google Docs, Sheets, and Slides that are shared with that account, and create
6
- and edit Google Docs. Junior does
5
+ Google Docs, Sheets, and Slides that are shared with that account, create
6
+ and edit Google Docs, and edit Google Slides. Junior does
7
7
  not use the Google credentials of the people it helps.
8
8
 
9
9
  ## Setup
@@ -12,7 +12,8 @@ not use the Google credentials of the people it helps.
12
12
  Calendar, Docs, Drive, Sheets, and Slides APIs.
13
13
  2. Use an **Internal** consent screen. Add the scopes
14
14
  `calendar.events.freebusy`, `calendar.events.readonly`,
15
- `calendar.events.owned`, `documents`, `drive.file`, and `drive.readonly`.
15
+ `calendar.events.owned`, `documents`, `drive.file`, `drive.readonly`, and
16
+ `presentations`.
16
17
  After you add a scope, reconnect the account in step 7.
17
18
  3. Add the redirect URIs
18
19
  `https://<junior host>/api/plugins/google/oauth/callback` and
@@ -25,9 +26,13 @@ not use the Google credentials of the people it helps.
25
26
  7. Connect the account on **Admin → Google account** in the dashboard, or run
26
27
  `junior google connect`.
27
28
 
28
- Anyone who can talk to Junior can read what the Junior account can see. Share
29
- calendars and files with that account only when that is acceptable. Given a
30
- link, Junior opens any Doc, Sheet, or Slides file shared with its account.
29
+ Anyone who can talk to Junior can read the calendars that the Junior account
30
+ can see. Share calendars with that account only when that is acceptable.
31
+ Junior reads a Doc, Sheet, or Slides file, or its comments, only for a
32
+ requester who can open it too. This is the check that link cards use: the
33
+ file names the requester, anyone with the link can open it, or the
34
+ requester's domain can open it and owns it. Access through a Google group
35
+ does not count.
31
36
  One tool, `readGoogleFile`, reads all three. It takes the type from the link,
32
37
  or from Drive for a bare file id.
33
38
  Search finds only files that any employee could already find in Drive, and
@@ -53,8 +58,9 @@ An event card shows the title and time. Cards never show guests.
53
58
 
54
59
  Junior edits a Doc only for a requester who can edit it through their own
55
60
  email, their domain, or an editable link. Access through a Google group is not
56
- checked. Anyone who can talk to Junior can read a Doc that Junior edits, if
57
- they give Junior its link. Junior makes the requester the owner of a Doc it
61
+ checked. The plugin enforces this for every change to an existing Drive file:
62
+ each write operation declares how it checks the requester, and a file write
63
+ fails unless the tool passes the file that the editor check returned. Junior makes the requester the owner of a Doc it
58
64
  creates, then removes its own access. Google emails the requester about the
59
65
  new ownership. Junior cannot read or edit that Doc again unless the requester
60
66
  shares it back. This only works for requesters in the same Workspace
@@ -64,4 +70,14 @@ Each edit of an existing Doc needs the `revision_id` that `readGoogleFile` or
64
70
  the last edit returned. If someone changed the Doc after that, the edit is
65
71
  refused, so Junior never changes text that it did not read.
66
72
 
73
+ Slides edits follow the same rules. Junior edits a presentation only for a
74
+ requester who can edit it. `updateGoogleSlides` sends Slides API
75
+ `batchUpdate` requests at the `revision_id` that `readGoogleSlidesLayout` or
76
+ the last edit returned. A Sheets chart needs a Sheet that the requester can
77
+ open too, and only YouTube videos can be added, because Junior cannot check
78
+ who can open a Drive video. Junior does not refresh a Sheets chart, because
79
+ the request does not name the chart's Sheet. `getGoogleSlideThumbnail` renders a slide so Junior
80
+ can check its work. The sandbox downloads the rendered image, which needs no
81
+ credential.
82
+
67
83
  Plugin setup: https://junior.sentry.dev/extend/