@sentry/junior-google 0.298.0 → 0.299.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.
package/README.md CHANGED
@@ -1,17 +1,19 @@
1
1
  # @sentry/junior-google
2
2
 
3
3
  Proof of concept. Junior uses its own Google Workspace account, such as
4
- `junior@example.com`, to schedule meetings, read Meet transcripts, and read
5
- Google Docs, Sheets, and Slides that are shared with that account. Junior does
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
6
7
  not use the Google credentials of the people it helps.
7
8
 
8
9
  ## Setup
9
10
 
10
11
  1. In the Google Cloud project of the dashboard OAuth client, enable the
11
- Calendar, Drive, Sheets, and Slides APIs.
12
+ Calendar, Docs, Drive, Sheets, and Slides APIs.
12
13
  2. Use an **Internal** consent screen. Add the scopes
13
14
  `calendar.events.freebusy`, `calendar.events.readonly`,
14
- `calendar.events.owned`, and `drive.readonly`.
15
+ `calendar.events.owned`, `documents`, `drive.file`, and `drive.readonly`.
16
+ After you add a scope, reconnect the account in step 7.
15
17
  3. Add the redirect URIs
16
18
  `https://<junior host>/api/plugins/google/oauth/callback` and
17
19
  `http://127.0.0.1:8765/oauth/callback` (CLI).
@@ -24,6 +26,27 @@ not use the Google credentials of the people it helps.
24
26
  `junior google connect`.
25
27
 
26
28
  Anyone who can talk to Junior can read what the Junior account can see. Share
27
- calendars and files with that account only when that is acceptable.
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.
31
+ Search finds only files that any employee could already find in Drive, and
32
+ files shared with the requester by name. Files shared by link, or only with
33
+ other people or groups, never show up in search. Search also drops every file
34
+ that no account in `GOOGLE_WORKSPACE_ALLOWED_DOMAINS` owns. Shared-drive files
35
+ have no owner, so search shows them only when they are shared with the
36
+ requester by name. Search returns nothing for a requester outside those
37
+ domains.
38
+
39
+ Junior edits a Doc only for a requester who can edit it through their own
40
+ email, their domain, or an editable link. Access through a Google group is not
41
+ checked. Anyone who can talk to Junior can read a Doc that Junior edits, if
42
+ they give Junior its link. Junior makes the requester the owner of a Doc it
43
+ creates, then removes its own access. Google emails the requester about the
44
+ new ownership. Junior cannot read or edit that Doc again unless the requester
45
+ shares it back. This only works for requesters in the same Workspace
46
+ organization as Junior's account.
47
+
48
+ Each edit of an existing Doc needs the `revision_id` that `readGoogleDoc` or
49
+ the last edit returned. If someone changed the Doc after that, the edit is
50
+ refused, so Junior never changes text that it did not read.
28
51
 
29
52
  Plugin setup: https://junior.sentry.dev/extend/
package/dist/config.d.ts CHANGED
@@ -18,11 +18,18 @@ export declare const GOOGLE_ALLOWED_DOMAINS_ENV = "GOOGLE_WORKSPACE_ALLOWED_DOMA
18
18
  * still decide how much detail each calendar shows.
19
19
  * - `calendar.events.owned`: create and change events on Junior's own
20
20
  * calendar.
21
+ * - `documents`: create Docs and edit Docs that Junior's account can already
22
+ * edit, through the Docs API. It gives no access to other Drive files and
23
+ * cannot change sharing.
24
+ * - `drive.file`: make the requester the owner of a Doc that Junior created,
25
+ * then remove Junior's own access. It only covers files this OAuth client
26
+ * created, so it cannot change sharing on other files. Full `drive` is not
27
+ * needed.
21
28
  * - `drive.readonly`: search Drive, export Docs, read Sheets and Slides, and
22
29
  * read comments. The Drive comments API accepts no narrower read scope. The
23
30
  * Sheets and Slides APIs also accept this scope.
24
31
  */
25
- export declare const GOOGLE_API_SCOPES: readonly ["https://www.googleapis.com/auth/calendar.events.freebusy", "https://www.googleapis.com/auth/calendar.events.owned", "https://www.googleapis.com/auth/calendar.events.readonly", "https://www.googleapis.com/auth/drive.readonly"];
32
+ export declare const GOOGLE_API_SCOPES: readonly ["https://www.googleapis.com/auth/calendar.events.freebusy", "https://www.googleapis.com/auth/calendar.events.owned", "https://www.googleapis.com/auth/calendar.events.readonly", "https://www.googleapis.com/auth/documents", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.readonly"];
26
33
  /** Identity scopes used only to verify which account signed in. */
27
34
  export declare const GOOGLE_IDENTITY_SCOPES: readonly ["openid", "email"];
28
35
  export interface GoogleConfig {
@@ -48,6 +48,30 @@ export declare const GOOGLE_OPERATIONS: {
48
48
  readonly method: "POST";
49
49
  readonly path: RegExp;
50
50
  };
51
+ readonly "google.docs.document.batchUpdate": {
52
+ readonly access: "write";
53
+ readonly host: "docs.googleapis.com";
54
+ readonly method: "POST";
55
+ readonly path: RegExp;
56
+ };
57
+ readonly "google.docs.document.create": {
58
+ readonly access: "write";
59
+ readonly host: "docs.googleapis.com";
60
+ readonly method: "POST";
61
+ readonly path: RegExp;
62
+ };
63
+ readonly "google.docs.document.get": {
64
+ readonly access: "read";
65
+ readonly host: "docs.googleapis.com";
66
+ readonly method: "GET";
67
+ readonly path: RegExp;
68
+ };
69
+ readonly "google.drive.about.get": {
70
+ readonly access: "read";
71
+ readonly host: "www.googleapis.com";
72
+ readonly method: "GET";
73
+ readonly path: RegExp;
74
+ };
51
75
  readonly "google.drive.comments.list": {
52
76
  readonly access: "read";
53
77
  readonly host: "www.googleapis.com";
@@ -72,6 +96,30 @@ export declare const GOOGLE_OPERATIONS: {
72
96
  readonly method: "GET";
73
97
  readonly path: RegExp;
74
98
  };
99
+ readonly "google.drive.permission.create": {
100
+ readonly access: "write";
101
+ readonly host: "www.googleapis.com";
102
+ readonly method: "POST";
103
+ readonly path: RegExp;
104
+ };
105
+ readonly "google.drive.file.delete": {
106
+ readonly access: "write";
107
+ readonly host: "www.googleapis.com";
108
+ readonly method: "DELETE";
109
+ readonly path: RegExp;
110
+ };
111
+ readonly "google.drive.permission.delete": {
112
+ readonly access: "write";
113
+ readonly host: "www.googleapis.com";
114
+ readonly method: "DELETE";
115
+ readonly path: RegExp;
116
+ };
117
+ readonly "google.drive.permissions.list": {
118
+ readonly access: "read";
119
+ readonly host: "www.googleapis.com";
120
+ readonly method: "GET";
121
+ readonly path: RegExp;
122
+ };
75
123
  readonly "google.sheets.spreadsheet.get": {
76
124
  readonly access: "read";
77
125
  readonly host: "sheets.googleapis.com";