@scenarist/msw-adapter 0.4.4 → 0.4.6

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.
@@ -1 +1 @@
1
- {"version":3,"file":"dynamic-handler.d.ts","sourceRoot":"","sources":["../../src/handlers/dynamic-handler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAIjB,gBAAgB,EAChB,cAAc,EACd,MAAM,EACP,MAAM,iBAAiB,CAAC;AAKzB,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAC;IACjD,QAAQ,CAAC,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,cAAc,GAAG,SAAS,CAAC;IAC3E,QAAQ,CAAC,qBAAqB,EAAE,CAC9B,UAAU,EAAE,MAAM,KACf,iBAAiB,GAAG,SAAS,CAAC;IACnC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC;IACzC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAoIF,eAAO,MAAM,oBAAoB,GAC/B,SAAS,qBAAqB,KAC7B,WAyIF,CAAC"}
1
+ {"version":3,"file":"dynamic-handler.d.ts","sourceRoot":"","sources":["../../src/handlers/dynamic-handler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAIjB,gBAAgB,EAChB,cAAc,EACd,MAAM,EACP,MAAM,iBAAiB,CAAC;AAKzB,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAC;IACjD,QAAQ,CAAC,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,cAAc,GAAG,SAAS,CAAC;IAC3E,QAAQ,CAAC,qBAAqB,EAAE,CAC9B,UAAU,EAAE,MAAM,KACf,iBAAiB,GAAG,SAAS,CAAC;IACnC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC;IACzC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAoIF,eAAO,MAAM,oBAAoB,GAC/B,SAAS,qBAAqB,KAC7B,WA+IF,CAAC"}
@@ -173,13 +173,18 @@ export const createDynamicHandler = (options) => {
173
173
  // Log the error via Logger if available
174
174
  if (options.logger) {
175
175
  const errorMessage = error instanceof Error ? error.message : String(error);
176
+ // Security: Only include stack traces in non-production environments
177
+ // to prevent information exposure through log aggregation systems.
178
+ // Stack traces can reveal internal file paths, dependency versions,
179
+ // and implementation details that could aid attackers.
180
+ const includeStack = process.env.NODE_ENV !== "production";
176
181
  options.logger.error(LogCategories.REQUEST, `Handler error: ${errorMessage}`, {
177
182
  testId,
178
183
  requestUrl: request.url,
179
184
  requestMethod: request.method,
180
185
  }, {
181
186
  errorName: error instanceof Error ? error.name : "Unknown",
182
- stack: error instanceof Error ? error.stack : undefined,
187
+ stack: includeStack && error instanceof Error ? error.stack : undefined,
183
188
  });
184
189
  }
185
190
  // Use specific error code from ScenaristError, or fallback to HANDLER_ERROR
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scenarist/msw-adapter",
3
- "version": "0.4.4",
3
+ "version": "0.4.6",
4
4
  "description": "Internal: MSW integration layer for Scenarist framework adapters",
5
5
  "author": "Paul Hammond (citypaul) <paul@packsoftware.co.uk>",
6
6
  "license": "MIT",
@@ -42,18 +42,18 @@
42
42
  ],
43
43
  "dependencies": {
44
44
  "path-to-regexp": "^6.3.0",
45
- "@scenarist/core": "0.4.4"
45
+ "@scenarist/core": "0.4.6"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "msw": "^2.0.0"
49
49
  },
50
50
  "devDependencies": {
51
- "@types/node": "^24.10.1",
52
- "@vitest/coverage-v8": "^4.0.14",
53
- "eslint": "^9.39.1",
54
- "msw": "^2.12.3",
51
+ "@types/node": "^25.0.3",
52
+ "@vitest/coverage-v8": "^4.0.16",
53
+ "eslint": "^9.39.2",
54
+ "msw": "^2.12.7",
55
55
  "typescript": "^5.9.3",
56
- "vitest": "^4.0.15",
56
+ "vitest": "^4.0.16",
57
57
  "@scenarist/eslint-config": "^0.0.0",
58
58
  "@scenarist/typescript-config": "0.0.0"
59
59
  },