zapier-platform-core 15.6.1 → 15.6.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zapier-platform-core",
3
- "version": "15.6.1",
3
+ "version": "15.6.2",
4
4
  "description": "The core SDK for CLI apps in the Zapier Developer Platform.",
5
5
  "repository": "zapier/zapier-platform",
6
6
  "homepage": "https://platform.zapier.com/",
@@ -52,7 +52,7 @@
52
52
  "node-fetch": "2.6.7",
53
53
  "oauth-sign": "0.9.0",
54
54
  "semver": "7.5.2",
55
- "zapier-platform-schema": "15.6.1"
55
+ "zapier-platform-schema": "15.6.2"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@types/node-fetch": "^2.6.11",
@@ -120,13 +120,19 @@ const toStdout = (event, msg, data) => {
120
120
  };
121
121
 
122
122
  // try to parse json; if successful, find secrets in it
123
- const attemptFindSecretsInStr = (s) => {
123
+ const attemptFindSecretsInStr = (s, isGettingNewSecret) => {
124
124
  let parsedRespContent;
125
125
  try {
126
126
  parsedRespContent = JSON.parse(s);
127
127
  } catch {
128
128
  return [];
129
129
  }
130
+
131
+ if (isGettingNewSecret && typeof parsedRespContent === 'string') {
132
+ // Likely the response content itself is a secret
133
+ return [parsedRespContent];
134
+ }
135
+
130
136
  return findSensitiveValues(parsedRespContent);
131
137
  };
132
138
 
@@ -157,9 +163,14 @@ const buildSensitiveValues = (event, data) => {
157
163
  // for our http logs (genrated by prepareRequestLog), make sure that we try to parse the content to find any new strings
158
164
  // (such as what comes back in the response during an auth refresh)
159
165
 
166
+ const isGettingNewSecret =
167
+ event.method &&
168
+ (event.method.endsWith('refreshAccessToken') ||
169
+ event.method.endsWith('sessionConfig.perform'));
170
+
160
171
  for (const prop of ['response_content', 'request_data']) {
161
172
  if (data[prop]) {
162
- result.push(...attemptFindSecretsInStr(data[prop]));
173
+ result.push(...attemptFindSecretsInStr(data[prop], isGettingNewSecret));
163
174
  }
164
175
  }
165
176
  if (data.request_params) {