@checkly/playwright-core 1.51.17-beta.2 → 1.51.17

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.
Files changed (50) hide show
  1. package/lib/checkly/secretsFilter.js +6 -10
  2. package/lib/generated/bindingsControllerSource.js +7 -0
  3. package/lib/generated/clockSource.js +1 -2
  4. package/lib/generated/consoleApiSource.js +1 -2
  5. package/lib/generated/injectedScriptSource.js +1 -2
  6. package/lib/generated/pollingRecorderSource.js +1 -2
  7. package/lib/generated/storageScriptSource.js +7 -0
  8. package/lib/generated/utilityScriptSource.js +1 -2
  9. package/lib/generated/webSocketMockSource.js +1 -2
  10. package/lib/server/har/harRecorder.js +3 -1
  11. package/lib/server/trace/recorder/tracing.js +9 -20
  12. package/lib/server/utils/fileUtils.js +65 -2
  13. package/lib/vite/traceViewer/sw.bundle.js +7888 -3
  14. package/lib/vite/traceViewer/uiMode.html +1 -1
  15. package/package.json +1 -1
  16. package/lib/common/socksProxy.js +0 -569
  17. package/lib/common/timeoutSettings.js +0 -73
  18. package/lib/common/types.js +0 -5
  19. package/lib/image_tools/colorUtils.js +0 -98
  20. package/lib/image_tools/compare.js +0 -108
  21. package/lib/image_tools/imageChannel.js +0 -70
  22. package/lib/image_tools/stats.js +0 -102
  23. package/lib/protocol/transport.js +0 -82
  24. package/lib/third_party/diff_match_patch.js +0 -2222
  25. package/lib/utils/ascii.js +0 -31
  26. package/lib/utils/comparators.js +0 -171
  27. package/lib/utils/crypto.js +0 -174
  28. package/lib/utils/debug.js +0 -46
  29. package/lib/utils/debugLogger.js +0 -91
  30. package/lib/utils/env.js +0 -49
  31. package/lib/utils/eventsHelper.js +0 -38
  32. package/lib/utils/happy-eyeballs.js +0 -210
  33. package/lib/utils/headers.js +0 -52
  34. package/lib/utils/hostPlatform.js +0 -133
  35. package/lib/utils/httpServer.js +0 -237
  36. package/lib/utils/linuxUtils.js +0 -78
  37. package/lib/utils/manualPromise.js +0 -109
  38. package/lib/utils/multimap.js +0 -75
  39. package/lib/utils/network.js +0 -160
  40. package/lib/utils/processLauncher.js +0 -248
  41. package/lib/utils/profiler.js +0 -53
  42. package/lib/utils/rtti.js +0 -44
  43. package/lib/utils/semaphore.js +0 -51
  44. package/lib/utils/spawnAsync.js +0 -45
  45. package/lib/utils/task.js +0 -58
  46. package/lib/utils/time.js +0 -37
  47. package/lib/utils/traceUtils.js +0 -44
  48. package/lib/utils/userAgent.js +0 -105
  49. package/lib/utils/wsServer.js +0 -127
  50. package/lib/utils/zipFile.js +0 -75
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.SerializedFS = void 0;
6
+ exports.SerializedFS = exports.SecretSerializedFS = void 0;
7
7
  exports.canAccessFile = canAccessFile;
8
8
  exports.copyFileAndMakeWritable = copyFileAndMakeWritable;
9
9
  exports.existsAsync = void 0;
@@ -201,4 +201,67 @@ class SerializedFS {
201
201
  }
202
202
  }
203
203
  }
204
- exports.SerializedFS = SerializedFS;
204
+
205
+ // [Checkly] SecretSerializedFS extends SerializedFS to apply secret scrubbing to all file writes
206
+ exports.SerializedFS = SerializedFS;
207
+ class SecretSerializedFS extends SerializedFS {
208
+ constructor(secretsFilter) {
209
+ super();
210
+ this._secretsFilter = void 0;
211
+ this._secretsFilter = secretsFilter;
212
+ }
213
+ writeFile(file, content, skipIfExists) {
214
+ const scrubbedContent = this._scrubContent(content);
215
+ super.writeFile(file, scrubbedContent, skipIfExists);
216
+ }
217
+ appendFile(file, text, flush) {
218
+ const scrubbedText = this._scrubContent(text);
219
+ super.appendFile(file, scrubbedText, flush);
220
+ }
221
+
222
+ // [Checkly] Create a scrubbing-enabled zip file wrapper
223
+ createScrubbingZipFile(ZipFileClass) {
224
+ const scrubContent = this._scrubContent.bind(this);
225
+ return class ScrubbingZipFile extends ZipFileClass {
226
+ addBuffer(buffer, metadataPath) {
227
+ const scrubbedBuffer = scrubContent(buffer);
228
+ super.addBuffer(scrubbedBuffer, metadataPath);
229
+ }
230
+ };
231
+ }
232
+
233
+ // [Checkly] Apply secret scrubbing to any content being written
234
+ _scrubContent(content) {
235
+ if (Buffer.isBuffer(content)) {
236
+ // Handle buffer content - only scrub if it looks like text
237
+ try {
238
+ const text = content.toString('utf8');
239
+ if (this._isLikelyTextContent(text)) {
240
+ const scrubbedText = this._secretsFilter(text);
241
+ return Buffer.from(scrubbedText, 'utf8');
242
+ }
243
+ return content; // Return original buffer for non-text content
244
+ } catch {
245
+ return content; // Return original if can't decode as UTF-8
246
+ }
247
+ } else {
248
+ // Handle string content
249
+ return this._secretsFilter(content);
250
+ }
251
+ }
252
+
253
+ // [Checkly] Check if content looks like text that could contain secrets
254
+ _isLikelyTextContent(text) {
255
+ if (text.length === 0) return false;
256
+
257
+ // Check if the string contains mostly printable characters, but only sample the first 1000 chars
258
+ const sampleSize = Math.min(1000, text.length);
259
+ let printableCount = 0;
260
+ for (let i = 0; i < sampleSize; i++) {
261
+ const code = text.charCodeAt(i);
262
+ if (code >= 32 && code <= 126 || code === 9 || code === 10 || code === 13) printableCount++;
263
+ }
264
+ return printableCount / sampleSize > 0.8;
265
+ }
266
+ }
267
+ exports.SecretSerializedFS = SecretSerializedFS;