@contrast/agentify 1.53.0 → 1.55.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.
- package/lib/utils.js +13 -7
- package/package.json +17 -17
package/lib/utils.js
CHANGED
|
@@ -18,13 +18,17 @@
|
|
|
18
18
|
const path = require('path');
|
|
19
19
|
const process = require('process');
|
|
20
20
|
const semver = require('semver');
|
|
21
|
-
|
|
22
21
|
const {
|
|
23
22
|
engines: {
|
|
24
23
|
node: nodeEngines,
|
|
25
24
|
}
|
|
26
25
|
} = require('../package.json');
|
|
27
26
|
|
|
27
|
+
const UNSUPPORTED_FLAGS = [
|
|
28
|
+
'--experimental',
|
|
29
|
+
'--permission',
|
|
30
|
+
];
|
|
31
|
+
|
|
28
32
|
const { primordials: { StringPrototypeSlice, StringPrototypeSplit, StringPrototypeTrim } } = require('@contrast/common');
|
|
29
33
|
|
|
30
34
|
/**
|
|
@@ -33,7 +37,7 @@ const { primordials: { StringPrototypeSlice, StringPrototypeSplit, StringPrototy
|
|
|
33
37
|
* @param {string} core.nodeEngines
|
|
34
38
|
*/
|
|
35
39
|
function preStartupValidation(core) {
|
|
36
|
-
|
|
40
|
+
assertNoUnsupportedFlags();
|
|
37
41
|
assertSupportedNodeVersion(core.nodeEngines || nodeEngines);
|
|
38
42
|
assertSupportedPreloadUsage();
|
|
39
43
|
}
|
|
@@ -61,15 +65,17 @@ function assertSupportedNodeVersion(engines) {
|
|
|
61
65
|
* Checks that no experimental feature flags are used.
|
|
62
66
|
* @throws {Error}
|
|
63
67
|
*/
|
|
64
|
-
function
|
|
68
|
+
function assertNoUnsupportedFlags() {
|
|
65
69
|
const {
|
|
66
70
|
execArgv,
|
|
67
71
|
env: { NODE_OPTIONS },
|
|
68
72
|
} = process;
|
|
69
73
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
74
|
+
for (const pattern of UNSUPPORTED_FLAGS) {
|
|
75
|
+
if (execArgv.some(arg => arg.includes(pattern)) || NODE_OPTIONS?.includes(pattern)) {
|
|
76
|
+
const msg = `Contrast Agent does not support flags matching \`${pattern}\`.`;
|
|
77
|
+
throw new Error(msg);
|
|
78
|
+
}
|
|
73
79
|
}
|
|
74
80
|
}
|
|
75
81
|
|
|
@@ -168,6 +174,6 @@ module.exports = {
|
|
|
168
174
|
assertValidOpts,
|
|
169
175
|
assertSupportedNodeVersion,
|
|
170
176
|
assertSupportedPreloadUsage,
|
|
171
|
-
|
|
177
|
+
assertNoUnsupportedFlags,
|
|
172
178
|
preStartupValidation,
|
|
173
179
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrast/agentify",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.55.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)",
|
|
@@ -14,28 +14,28 @@
|
|
|
14
14
|
"types": "lib/index.d.ts",
|
|
15
15
|
"engines": {
|
|
16
16
|
"npm": ">=6.13.7 <7 || >= 8.3.1",
|
|
17
|
-
"node": ">=
|
|
17
|
+
"node": ">= 18.7.0"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
20
|
"test": "bash ../scripts/test.sh"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@contrast/common": "1.
|
|
24
|
-
"@contrast/config": "1.
|
|
25
|
-
"@contrast/core": "1.
|
|
26
|
-
"@contrast/deadzones": "1.
|
|
27
|
-
"@contrast/dep-hooks": "1.
|
|
28
|
-
"@contrast/esm-hooks": "2.
|
|
23
|
+
"@contrast/common": "1.36.0",
|
|
24
|
+
"@contrast/config": "1.51.0",
|
|
25
|
+
"@contrast/core": "1.56.0",
|
|
26
|
+
"@contrast/deadzones": "1.28.0",
|
|
27
|
+
"@contrast/dep-hooks": "1.25.0",
|
|
28
|
+
"@contrast/esm-hooks": "2.30.0",
|
|
29
29
|
"@contrast/find-package-json": "^1.1.0",
|
|
30
|
-
"@contrast/instrumentation": "1.
|
|
31
|
-
"@contrast/logger": "1.
|
|
32
|
-
"@contrast/metrics": "1.
|
|
33
|
-
"@contrast/patcher": "1.
|
|
34
|
-
"@contrast/perf": "1.
|
|
35
|
-
"@contrast/reporter": "1.
|
|
36
|
-
"@contrast/rewriter": "1.
|
|
37
|
-
"@contrast/scopes": "1.
|
|
38
|
-
"@contrast/sources": "1.
|
|
30
|
+
"@contrast/instrumentation": "1.35.0",
|
|
31
|
+
"@contrast/logger": "1.29.0",
|
|
32
|
+
"@contrast/metrics": "1.33.0",
|
|
33
|
+
"@contrast/patcher": "1.28.0",
|
|
34
|
+
"@contrast/perf": "1.4.0",
|
|
35
|
+
"@contrast/reporter": "1.54.0",
|
|
36
|
+
"@contrast/rewriter": "1.32.0",
|
|
37
|
+
"@contrast/scopes": "1.26.0",
|
|
38
|
+
"@contrast/sources": "1.2.0",
|
|
39
39
|
"on-finished": "^2.4.1",
|
|
40
40
|
"semver": "^7.6.0"
|
|
41
41
|
}
|