@contrast/agentify 1.22.3 → 1.23.0

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.
@@ -17,7 +17,6 @@
17
17
  'use strict';
18
18
 
19
19
  const Module = require('node:module');
20
-
21
20
  const rewriteIsDeadzoned = require('./rewrite-is-deadzoned');
22
21
 
23
22
  /**
@@ -14,22 +14,58 @@
14
14
  */
15
15
  'use strict';
16
16
 
17
- // i'm leaving out index.js now because it doesn't really matter and i want
18
- // to keep this list short. maybe a little bit of experimentation to figure
19
- // out optimal way to do this lookup.
20
- const doNotRewriteEndingPaths = [
21
- //'node_modules/bcryptjs/index.js',
22
- 'node_modules/bcryptjs/dist/bcrypt.js',
23
- ];
17
+ const { sep } = require('path');
18
+
19
+ // todo: find optimal way to do these lookups
20
+ const DEADZONED_PATHS = [
21
+ 'ast-types', // CONTRAST-33909: `String` injection causes this module to crash.
22
+ 'angular',
23
+ 'acorn',
24
+ 'archiver',
25
+ 'archiver-utils',
26
+ 'bcrypt',
27
+ 'bcrypt-nodejs',
28
+ 'bcryptjs', // node_modules/bcryptjs/index.js, node_modules/bcryptjs/dist/bcrypt.js
29
+ 'babel',
30
+ 'babel-cli',
31
+ 'babel-core',
32
+ 'browserify',
33
+ 'bunyan',
34
+ 'coffee-script',
35
+ 'compression',
36
+ // 'cookie', // todo: verify this doesn't break sources/propagation
37
+ // 'cookie-signature', // ditto
38
+ 'gzippo',
39
+ // 'handlebars', // ditto
40
+ 'handlebars-precompiler',
41
+ // 'hbs', // ditto
42
+ 'html-webpack-plugin',
43
+ 'jquery',
44
+ 'jsrsasign',
45
+ 'iconv-lite',
46
+ 'less',
47
+ 'logger-console',
48
+ 'loopback-datasource-juggler',
49
+ 'node-webpack',
50
+ 'react',
51
+ 'react-dom',
52
+ 'react-dom/server',
53
+ 'requirejs',
54
+ 'semver',
55
+ 'strong-remoting',
56
+ 'uglify-js',
57
+ 'bn.js',
58
+ 'node-forge',
59
+ 'moment',
60
+ 'moment-timezone'
61
+ ].map((pkgName) => ['node_modules', pkgName, ''].join(sep));
24
62
 
25
63
  module.exports = function rewriteIsDeadzoned(filename) {
26
64
  // make all windows separators into unix separators
27
- filename = filename.replace(/\\/g, '/');
28
- for (const endingPath of doNotRewriteEndingPaths) {
29
- if (filename.endsWith(endingPath)) {
30
- return true;
31
- }
32
-
33
- return false;
65
+ for (const path of DEADZONED_PATHS) {
66
+ const start = filename.indexOf(path);
67
+ if (start >= 0) return filename.indexOf('node_modules', start + path.length) == -1;
34
68
  }
69
+
70
+ return false;
35
71
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/agentify",
3
- "version": "1.22.3",
3
+ "version": "1.23.0",
4
4
  "description": "Configures Contrast agent services and instrumentation within an application",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
@@ -17,18 +17,18 @@
17
17
  "test": "../scripts/test.sh"
18
18
  },
19
19
  "dependencies": {
20
- "@contrast/common": "1.19.0",
21
- "@contrast/config": "1.26.2",
22
- "@contrast/core": "1.30.0",
20
+ "@contrast/common": "1.20.0",
21
+ "@contrast/config": "1.27.0",
22
+ "@contrast/core": "1.31.0",
23
23
  "@contrast/deadzones": "1.1.2",
24
24
  "@contrast/dep-hooks": "1.3.1",
25
- "@contrast/esm-hooks": "2.4.1",
26
- "@contrast/instrumentation": "1.6.0",
25
+ "@contrast/esm-hooks": "2.5.0",
26
+ "@contrast/instrumentation": "1.7.0",
27
27
  "@contrast/logger": "1.8.0",
28
- "@contrast/metrics": "1.6.0",
28
+ "@contrast/metrics": "1.7.0",
29
29
  "@contrast/patcher": "1.7.1",
30
- "@contrast/reporter": "1.25.1",
31
- "@contrast/rewriter": "1.5.0",
30
+ "@contrast/reporter": "1.26.0",
31
+ "@contrast/rewriter": "1.6.0",
32
32
  "@contrast/scopes": "1.4.0"
33
33
  }
34
34
  }