@mcpher/gas-fakes 2.3.0 → 2.3.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/README.md CHANGED
@@ -51,6 +51,17 @@ Configuration for your local Node environment is handled via environment variabl
51
51
  | `LOG_DESTINATION` | `CONSOLE` | Logging destination: `CONSOLE`, `CLOUD`, `BOTH`, or `NONE`. |
52
52
  | `STORE_TYPE` | `FILE` | Internal storage type for properties/cache: `FILE` (local) or `UPSTASH` (Redis). |
53
53
 
54
+ ### Note on Consumer Accounts and ADC
55
+
56
+ If you are using a consumer account (gmail.com) or do not have access to Domain-Wide Delegation (DWD), you must use Application Default Credentials (`AUTH_TYPE="adc"`) to authenticate with Google Workspace assets.
57
+
58
+ **Important Security Note:** Due to recent Workspace security changes, you **must** create and provide a custom OAuth2 client credentials JSON file during initialization (`gas-fakes init`) to avoid `403 Access Blocked` errors when using Workspace scopes (like Gmail or Drive).
59
+
60
+ - **Guide:** [How to allow access to Workspace scopes with Application Default Credentials](https://ramblings.mcpher.com/how-to-allow-access-to-sensitive-scopes-with-application-default-credentials/)
61
+ - **Link to Create Credentials:** [Google Cloud Console Credentials Page](https://console.cloud.google.com/apis/credentials)
62
+
63
+ **Security Warning:** Always add your client credentials JSON file to your `.gitignore` to prevent it from being committed to GitHub or other source control.
64
+
54
65
 
55
66
 
56
67
  ### Cloud Logging Integration
package/package.json CHANGED
@@ -7,10 +7,10 @@
7
7
  "@mcpher/fake-gasenum": "^1.0.6",
8
8
  "@mcpher/gas-flex-cache": "^1.1.5",
9
9
  "@microsoft/microsoft-graph-client": "^3.0.7",
10
- "@modelcontextprotocol/sdk": "^1.27.1",
10
+ "@modelcontextprotocol/sdk": "^1.28.0",
11
11
  "@sindresorhus/is": "^7.2.0",
12
12
  "acorn": "^8.16.0",
13
- "archiver": "^7.0.1",
13
+ "archiver": "^4.0.2",
14
14
  "commander": "^14.0.3",
15
15
  "dotenv": "^17.3.1",
16
16
  "fast-xml-parser": "^5.5.9",
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "name": "@mcpher/gas-fakes",
41
41
  "author": "bruce mcpherson",
42
- "version": "2.3.0",
42
+ "version": "2.3.1",
43
43
  "license": "MIT",
44
44
  "main": "main.js",
45
45
  "description": "An implementation of the Google Workspace Apps Script runtime: Run native App Script Code on Node and Cloud Run",
@@ -201,8 +201,11 @@ const setAuth = async (scopes = [], mcpLoading = false) => {
201
201
 
202
202
  id.sourceClient = await id.auth.getClient(sourceScopes.length > 0 ? { scopes: sourceScopes } : {})
203
203
 
204
- const { tokenInfo: userInfo } = await _getTokenInfo(id.sourceClient);
205
- const userEmail = process.env.GOOGLE_WORKSPACE_SUBJECT || userInfo.email
204
+ let userEmail = process.env.GOOGLE_WORKSPACE_SUBJECT;
205
+ if (!userEmail) {
206
+ const { tokenInfo: userInfo } = await _getTokenInfo(id.sourceClient);
207
+ userEmail = userInfo.email;
208
+ }
206
209
 
207
210
  const dwdClient = new OAuth2Client()
208
211
  dwdClient._token = null