@contrast/config 1.22.0 → 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.
- package/LICENSE +1 -1
- package/lib/common.js +1 -1
- package/lib/config.js +4 -2
- package/lib/index.d.ts +4 -2
- package/lib/index.js +1 -1
- package/lib/options.js +9 -2
- package/package.json +1 -1
package/LICENSE
CHANGED
package/lib/common.js
CHANGED
package/lib/config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright:
|
|
2
|
+
* Copyright: 2024 Contrast Security, Inc
|
|
3
3
|
* Contact: support@contrastsecurity.com
|
|
4
4
|
* License: Commercial
|
|
5
5
|
|
|
@@ -34,6 +34,7 @@ const {
|
|
|
34
34
|
|
|
35
35
|
const CONTRAST_CONFIG_PATH = 'CONTRAST_CONFIG_PATH';
|
|
36
36
|
const CONTRAST_PREFIX = 'CONTRAST_';
|
|
37
|
+
const HOME_CONFIG_DIR = path.resolve(os.homedir(), '.config', 'contrast');
|
|
37
38
|
const OS_CONFIG_DIR = os.platform() === 'win32'
|
|
38
39
|
? path.resolve(process.env.ProgramData || '', 'contrast')
|
|
39
40
|
: '/etc/contrast';
|
|
@@ -130,7 +131,8 @@ module.exports = class Config {
|
|
|
130
131
|
process.cwd(),
|
|
131
132
|
path.resolve(OS_CONFIG_DIR, 'node'),
|
|
132
133
|
OS_CONFIG_DIR,
|
|
133
|
-
path.resolve(
|
|
134
|
+
path.resolve(HOME_CONFIG_DIR, 'node'),
|
|
135
|
+
HOME_CONFIG_DIR,
|
|
134
136
|
];
|
|
135
137
|
}
|
|
136
138
|
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright:
|
|
2
|
+
* Copyright: 2024 Contrast Security, Inc
|
|
3
3
|
* Contact: support@contrastsecurity.com
|
|
4
4
|
* License: Commercial
|
|
5
5
|
|
|
@@ -192,7 +192,7 @@ export interface Config {
|
|
|
192
192
|
reporting: {
|
|
193
193
|
/** Default: `true` */
|
|
194
194
|
enable: boolean;
|
|
195
|
-
/** Default: `
|
|
195
|
+
/** Default: `100` */
|
|
196
196
|
interval_ms: number;
|
|
197
197
|
};
|
|
198
198
|
};
|
|
@@ -202,6 +202,8 @@ export interface Config {
|
|
|
202
202
|
/** 'Set the response duration (in milliseconds) after which we will warn that a request has been hanging.' Default: `5000` */
|
|
203
203
|
warn_ms: number;
|
|
204
204
|
};
|
|
205
|
+
/** Set the full path of the npm executable, used for library analysis. Default: `'npm'` */
|
|
206
|
+
npm_path: string;
|
|
205
207
|
};
|
|
206
208
|
};
|
|
207
209
|
|
package/lib/index.js
CHANGED
package/lib/options.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright:
|
|
2
|
+
* Copyright: 2024 Contrast Security, Inc
|
|
3
3
|
* Contact: support@contrastsecurity.com
|
|
4
4
|
* License: Commercial
|
|
5
5
|
|
|
@@ -433,7 +433,8 @@ Example - \`/opt/Contrast/contrast.log\` creates a log in the \`/opt/Contrast\`
|
|
|
433
433
|
{
|
|
434
434
|
name: 'agent.node.library_usage.reporting.interval_ms',
|
|
435
435
|
arg: '<num>',
|
|
436
|
-
|
|
436
|
+
fn: parseNum,
|
|
437
|
+
default: 100,
|
|
437
438
|
desc: 'Set the interval (in milliseconds) for collecting code events for library usage.',
|
|
438
439
|
},
|
|
439
440
|
{
|
|
@@ -450,6 +451,12 @@ Example - \`/opt/Contrast/contrast.log\` creates a log in the \`/opt/Contrast\`
|
|
|
450
451
|
fn: parseNum,
|
|
451
452
|
desc: 'Set the response duration (in milliseconds) after which we will warn that a request has been hanging.'
|
|
452
453
|
},
|
|
454
|
+
{
|
|
455
|
+
name: 'agent.node.npm_path',
|
|
456
|
+
arg: '<path>',
|
|
457
|
+
default: 'npm',
|
|
458
|
+
desc: 'Set the full path of the npm executable, used for library analysis',
|
|
459
|
+
},
|
|
453
460
|
// inventory
|
|
454
461
|
{
|
|
455
462
|
name: 'inventory.analyze_libraries',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrast/config",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.23.0",
|
|
4
4
|
"description": "An API for discovering Contrast agent configuration data",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
|