@particle-academy/gmail-inbox-js 0.3.0 → 0.4.1
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/CHANGELOG.md +46 -0
- package/README.md +8 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -12,6 +12,52 @@ derived — somebody has to write what changed — but writing it in the
|
|
|
12
12
|
provider repo would be a hand-edit that `.weaver.json` flags and the next
|
|
13
13
|
sync destroys.
|
|
14
14
|
|
|
15
|
+
## [0.4.1] — 2026-11-08
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- **The Laravel config's environment variable names now split camelCase**,
|
|
20
|
+
as documented. **Consumer action: none.** The old unsplit names are still
|
|
21
|
+
read as a fallback, so an app that set them keeps working; the new names
|
|
22
|
+
are preferred.
|
|
23
|
+
|
|
24
|
+
| Preferred | Still read |
|
|
25
|
+
|---|---|
|
|
26
|
+
| `GMAIL_INBOX_CLIENT_ID` | `GMAIL_INBOX_CLIENTID` |
|
|
27
|
+
| `GMAIL_INBOX_CLIENT_SECRET` | `GMAIL_INBOX_CLIENTSECRET` |
|
|
28
|
+
| `GMAIL_INBOX_ACCESS_TOKEN` | `GMAIL_INBOX_ACCESSTOKEN` |
|
|
29
|
+
| `GMAIL_INBOX_REFRESH_TOKEN` | `GMAIL_INBOX_REFRESHTOKEN` |
|
|
30
|
+
| `GMAIL_INBOX_PUSH_AUDIENCE` | `GMAIL_INBOX_PUSHAUDIENCE` |
|
|
31
|
+
| `GMAIL_INBOX_PUSH_SERVICE_ACCOUNT` | `GMAIL_INBOX_PUSHSERVICEACCOUNT` |
|
|
32
|
+
|
|
33
|
+
## [0.4.0] — 2026-11-08
|
|
34
|
+
|
|
35
|
+
### Added
|
|
36
|
+
|
|
37
|
+
- **One Google consent grant, shared by every Google connector** (`oauth.grant:
|
|
38
|
+
"google"`), for an org-level Google connection: one OAuth client, one consent
|
|
39
|
+
and one refresh token per person, with each feature's scopes asked for when it
|
|
40
|
+
is first used. Declared in the manifest, the `-ui` package's OAuth constant,
|
|
41
|
+
the README and the registry index:
|
|
42
|
+
- `authorizeParams`: `access_type=offline` and `include_granted_scopes=true`.
|
|
43
|
+
A refresh token comes back only on the FIRST code exchange, so keep the stored
|
|
44
|
+
one when an exchange returns none.
|
|
45
|
+
- `revoke`: POST `https://oauth2.googleapis.com/revoke` with `token`, and
|
|
46
|
+
`scope: "grant"`. **Revoking removes the person's WHOLE Google grant, every
|
|
47
|
+
Google connector**, so a per-feature disconnect stops using that feature's
|
|
48
|
+
scopes locally and only a full Google disconnect revokes.
|
|
49
|
+
- `identity`: identify the account by the id_token's `sub` (request `openid`;
|
|
50
|
+
issuer `https://accounts.google.com` or `accounts.google.com`; audience is
|
|
51
|
+
the `clientId`), never by email, which Google says is neither unique nor
|
|
52
|
+
permanent.
|
|
53
|
+
`restrictedScopes` is `gmail.readonly`: Google verifies per OAuth client, so
|
|
54
|
+
sharing one client with the other Google connectors puts every feature behind
|
|
55
|
+
the annual CASA assessment, and a separate client keeps it here alone. The
|
|
56
|
+
`clientId` help now states that trade-off instead of forbidding a shared client.
|
|
57
|
+
|
|
58
|
+
Nothing a request sends has changed; this is what a host needs to run the
|
|
59
|
+
connection.
|
|
60
|
+
|
|
15
61
|
## [0.3.0] — 2026-11-08
|
|
16
62
|
|
|
17
63
|
### Added
|
package/README.md
CHANGED
|
@@ -41,7 +41,7 @@ A Gmail Inbox connection holds 6 values.
|
|
|
41
41
|
|
|
42
42
|
| Field | Scope | Secret | Where it comes from |
|
|
43
43
|
|---|---|---|---|
|
|
44
|
-
| **OAuth client ID** | per installation | not secret |
|
|
44
|
+
| **OAuth client ID** | per installation | not secret | From Google Cloud Console -> APIs & Services -> Credentials. ONE value for the whole installation. This connector requests a RESTRICTED scope, and Google verifies per OAuth client: sharing one client with the other Google connectors (one consent, one grant) puts every Google feature behind the annual CASA assessment; a separate client for this connector keeps it here alone, at the cost of a second consent. Your choice. |
|
|
45
45
|
| **OAuth client secret** | per installation | **secret** | The client secret for the same OAuth app. One value for the whole installation. |
|
|
46
46
|
| **Access token** | per connected account | **secret** | Per connected Google account, and it expires after ONE HOUR. The host refreshes it with the refresh token. |
|
|
47
47
|
| **Refresh token** | per connected account | **secret** | Per connected Google account. Google issues one only when the consent request asks for offline access; without it the connection dies within the hour. |
|
|
@@ -57,6 +57,13 @@ Gmail Inbox uses OAuth2 (authorization_code). The package DECLARES the exchange;
|
|
|
57
57
|
- **Scopes** — `https://www.googleapis.com/auth/gmail.readonly`
|
|
58
58
|
- **Access token lifetime** — 3600 seconds (1 hours). A host that never refreshes works all afternoon and is broken by morning.
|
|
59
59
|
|
|
60
|
+
**One consent grant, shared** (`grant: "google"`). Every connector declaring the same grant can run on ONE OAuth client, with one consent and one refresh token per person.
|
|
61
|
+
|
|
62
|
+
- **Authorize with** `access_type=offline`, `include_granted_scopes=true`. Ask for a feature's scopes when it is first used; the new token covers every scope granted before. A refresh token comes back only on the FIRST exchange, so keep the stored one when an exchange returns none.
|
|
63
|
+
- **Revoke** — POST https://oauth2.googleapis.com/revoke with `token`. **It removes the WHOLE grant**: every connector sharing it, not only this one. A per-feature disconnect stops using that feature's scopes locally; only a full disconnect revokes.
|
|
64
|
+
- **Identify the account by `sub`**: request `openid`, then verify the token response's id_token (issuer `https://accounts.google.com` or `accounts.google.com`, keys at https://www.googleapis.com/oauth2/v3/certs, audience = `clientId`). Never key a connection by email.
|
|
65
|
+
- **Restricted scopes**: `https://www.googleapis.com/auth/gmail.readonly`. Verification is per OAuth client, so sharing one client with the rest of the grant puts every feature behind the provider's restricted-scope assessment; a separate client keeps it on this connector alone.
|
|
66
|
+
|
|
60
67
|
The refresh tokens do **not** rotate: the same one is reusable, so a refresh may safely be retried and may run concurrently. Stated rather than assumed, because the opposite — a provider that spends the token and revokes the grant on a replay — looks identical until it happens.
|
|
61
68
|
|
|
62
69
|
### The estate
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@particle-academy/gmail-inbox-js",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Gmail Inbox for Node — the service descriptor, its faker, its webhook verification, and one function per operation. Plain HTTP on @particle-academy/fancy-connector-core; no vendor SDK.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@particle-academy/fancy-flow": ">=0.47.1 <2.0",
|
|
57
|
-
"@particle-academy/gmail-inbox-ui": ">=0.
|
|
57
|
+
"@particle-academy/gmail-inbox-ui": ">=0.4.0 <0.5.0"
|
|
58
58
|
},
|
|
59
59
|
"peerDependenciesMeta": {
|
|
60
60
|
"@particle-academy/fancy-flow": {
|