@contrast/config 1.8.1 → 1.10.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/index.d.ts +8 -1
- package/lib/options.js +22 -1
- package/lib/util.js +4 -4
- package/package.json +2 -2
package/lib/index.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export interface Config {
|
|
|
30
30
|
|
|
31
31
|
_default: Record<string, any>;
|
|
32
32
|
_flat: Record<string, any>;
|
|
33
|
-
_sources: Record<string, '
|
|
33
|
+
_sources: Record<string, 'DEFAULT_VALUE' | 'ENVIRONMENT_VARIABLE' | 'USER_CONFIGURATION_FILE' | 'CONTRAST_UI'>;
|
|
34
34
|
api: {
|
|
35
35
|
enable: boolean;
|
|
36
36
|
api_key: string;
|
|
@@ -49,6 +49,9 @@ export interface Config {
|
|
|
49
49
|
agent: {
|
|
50
50
|
polling: {
|
|
51
51
|
app_activity_ms: number;
|
|
52
|
+
app_settings_ms: number;
|
|
53
|
+
app_update_ms: number;
|
|
54
|
+
server_settings_ms: number;
|
|
52
55
|
};
|
|
53
56
|
|
|
54
57
|
reporters: {
|
|
@@ -165,6 +168,10 @@ export interface Config {
|
|
|
165
168
|
session_metadtata: string | null;
|
|
166
169
|
};
|
|
167
170
|
|
|
171
|
+
assess: {
|
|
172
|
+
tags: string;
|
|
173
|
+
};
|
|
174
|
+
|
|
168
175
|
protect: {
|
|
169
176
|
enable: boolean;
|
|
170
177
|
|
package/lib/options.js
CHANGED
|
@@ -369,8 +369,29 @@ const agent = [
|
|
|
369
369
|
arg: '<ms>',
|
|
370
370
|
default: 30000,
|
|
371
371
|
fn: parseNum,
|
|
372
|
-
desc: 'how often (in ms)
|
|
372
|
+
desc: 'how often (in ms) application activity messages are sent to the UI',
|
|
373
373
|
},
|
|
374
|
+
{
|
|
375
|
+
name: 'agent.polling.app_update_ms',
|
|
376
|
+
arg: '<ms>',
|
|
377
|
+
default: 30000,
|
|
378
|
+
fn: parseNum,
|
|
379
|
+
desc: 'how often (in ms) application updates are sent to the UI'
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
name: 'agent.polling.app_settings_ms',
|
|
383
|
+
arg: '<ms>',
|
|
384
|
+
default: 30000,
|
|
385
|
+
fn: parseNum,
|
|
386
|
+
desc: 'how often (in ms) application settings polls are sent to the UI',
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
name: 'agent.polling.server_settings_ms',
|
|
390
|
+
arg: '<ms>',
|
|
391
|
+
default: 30000,
|
|
392
|
+
fn: parseNum,
|
|
393
|
+
desc: 'how often (in ms) server settings polls are sent to the UI',
|
|
394
|
+
}
|
|
374
395
|
];
|
|
375
396
|
|
|
376
397
|
const application = [
|
package/lib/util.js
CHANGED
|
@@ -242,9 +242,9 @@ function mergeOptions() {
|
|
|
242
242
|
let isFromDefault, origin;
|
|
243
243
|
|
|
244
244
|
if (env != null || autoEnv != null) {
|
|
245
|
-
origin = '
|
|
245
|
+
origin = 'ENVIRONMENT_VARIABLE';
|
|
246
246
|
} else if (fileFlag != null) {
|
|
247
|
-
origin = '
|
|
247
|
+
origin = 'USER_CONFIGURATION_FILE';
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
// env > file > default
|
|
@@ -257,7 +257,7 @@ function mergeOptions() {
|
|
|
257
257
|
if (optEnum && optEnum.indexOf(value) === -1) {
|
|
258
258
|
value = fn(optDefault);
|
|
259
259
|
isFromDefault = true;
|
|
260
|
-
origin = '
|
|
260
|
+
origin = 'DEFAULT_VALUE';
|
|
261
261
|
}
|
|
262
262
|
|
|
263
263
|
// set default last and separately, so that we can mark that the option was
|
|
@@ -265,7 +265,7 @@ function mergeOptions() {
|
|
|
265
265
|
if (value === undefined) {
|
|
266
266
|
value = fn(optDefault);
|
|
267
267
|
isFromDefault = true;
|
|
268
|
-
origin = '
|
|
268
|
+
origin = 'DEFAULT_VALUE';
|
|
269
269
|
}
|
|
270
270
|
|
|
271
271
|
setConfig(options, name, value, isFromDefault, origin);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrast/config",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.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)",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"test": "../scripts/test.sh"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@contrast/common": "1.
|
|
20
|
+
"@contrast/common": "1.8.0",
|
|
21
21
|
"yaml": "^2.2.2"
|
|
22
22
|
}
|
|
23
23
|
}
|