@sentry/junior-google 0.300.0 → 0.302.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
@@ -38,14 +38,18 @@ have no owner, so search shows them only when they are shared with the
38
38
  requester by name. Search returns nothing for a requester outside those
39
39
  domains.
40
40
 
41
- The dashboard shows a card for a Doc, Sheet, Slides, or Calendar event link
42
- only when the signed-in viewer can open it too. A file must name the
41
+ The dashboard shows a card for a Doc, Sheet, Slides, Drive file, Drive
42
+ folder, or Calendar event link only when the signed-in viewer can open it
43
+ too. A file must name the
43
44
  viewer's email as a reader, writer, or owner, be open to anyone with the
44
45
  link, or be open to the viewer's domain and owned in that domain. Access
45
46
  through a Google group gets no card. An event must be on the Junior
46
47
  account's calendar, with the viewer as its organizer, creator, or a guest.
47
- A file card shows the title, type, owner, and modified time. An event card
48
- shows the title and time. Cards never show content or guests.
48
+ A file card shows the title, type, owner, and modified time. A Drive link to
49
+ a Doc, Sheet, or Slides file shows the same card as its Docs link. Other
50
+ Drive files also show a thumbnail. The image route checks the viewer again
51
+ on each read, and sends Junior's credential only to Google's thumbnail host.
52
+ An event card shows the title and time. Cards never show guests.
49
53
 
50
54
  Junior edits a Doc only for a requester who can edit it through their own
51
55
  email, their domain, or an editable link. Access through a Google group is not
@@ -5,7 +5,8 @@
5
5
  * account. They enforce disclosure and invite rules in code, so the sandbox
6
6
  * and other callers get no Google credential at all.
7
7
  */
8
- import { type EgressHookContext, type IssueCredentialHookContext, type PluginCredentialResult, type PluginGrant } from "@sentry/junior-plugin-api";
8
+ import { type EgressHookContext, type IssueCredentialHookContext, type PluginContext, type PluginCredentialResult, type PluginGrant } from "@sentry/junior-plugin-api";
9
+ import { type GoogleConfig } from "./config";
9
10
  /** Calendar and Drive API host. */
10
11
  export declare const GOOGLE_API_DOMAIN = "www.googleapis.com";
11
12
  /** Every host that receives Junior's Google access token. */
@@ -142,5 +143,11 @@ export declare const GOOGLE_OPERATIONS: {
142
143
  export type GoogleOperation = keyof typeof GOOGLE_OPERATIONS;
143
144
  /** Select the grant for one Google request, or deny it. */
144
145
  export declare function googleGrantForEgress(ctx: EgressHookContext): PluginGrant;
146
+ /**
147
+ * Return a fresh access token for Junior's Google account, for a request
148
+ * that cannot go through egress, such as a Drive thumbnail that the image
149
+ * proxy fetches. Return nothing when the account is not connected.
150
+ */
151
+ export declare function readGoogleAccessToken(ctx: Pick<PluginContext, "db" | "log">, config: GoogleConfig): Promise<string | undefined>;
145
152
  /** Mint a short-lived access token for Junior's Google account. */
146
153
  export declare function issueGoogleCredential(ctx: IssueCredentialHookContext): Promise<PluginCredentialResult>;