@contrast/config 1.57.1 → 1.58.1

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 CHANGED
@@ -39,15 +39,14 @@ export type SyslogLevel =
39
39
  | 'info'
40
40
  | 'debug';
41
41
 
42
- export interface ConfigOption<T> {
42
+ export interface ConfigOption<T = any> {
43
43
  name: string;
44
- abbrev?: string;
45
- env: string;
44
+ desc: string;
46
45
  arg: string;
46
+ env?: string;
47
47
  enum?: T[];
48
48
  default?: T;
49
49
  fn?: (arg: any, cfg: Config, source: string) => T;
50
- desc: string;
51
50
  }
52
51
 
53
52
  export interface Config {
@@ -62,6 +61,7 @@ export interface Config {
62
61
  args?: any[];
63
62
  }[];
64
63
 
64
+ installation_tool: string;
65
65
  preinstrument: boolean,
66
66
 
67
67
  api: {
@@ -212,6 +212,8 @@ export interface Config {
212
212
  source_maps: {
213
213
  /** Default: `true` */
214
214
  enable: boolean;
215
+ /** Default: `false` */
216
+ inline: boolean;
215
217
  };
216
218
  library_usage: {
217
219
  reporting: {
@@ -229,6 +231,8 @@ export interface Config {
229
231
  };
230
232
  /** Set the full path of the npm executable, used for library analysis. Default: `'npm'` */
231
233
  npm_path: string;
234
+ /** Default: `false` */
235
+ mask_http_body: boolean;
232
236
  };
233
237
  };
234
238
 
package/lib/options.js CHANGED
@@ -122,6 +122,13 @@ const options = [
122
122
  fn: castBoolean,
123
123
  desc: 'Set to `false` to disable Contrast agent.',
124
124
  },
125
+ {
126
+ name: 'installation_tool',
127
+ desc: 'Set when a tool like the Agent Operator or the Flex Agent manages the agent installation.',
128
+ arg: '<tool>',
129
+ default: 'NONE',
130
+ env: 'CONTRAST_INSTALLATION_TOOL',
131
+ },
125
132
  // api
126
133
  {
127
134
  name: 'api.enable',
@@ -539,6 +546,13 @@ Example - \`/opt/Contrast/contrast.log\` creates a log in the \`/opt/Contrast\`
539
546
  fn: castBoolean,
540
547
  desc: 'Set to `false` to disable source map generation when rewriting.',
541
548
  },
549
+ {
550
+ name: 'agent.node.source_maps.inline',
551
+ arg: '[true]',
552
+ default: false,
553
+ fn: castBoolean,
554
+ desc: 'Set to `true` to inline source maps into rewritten files instead of writing them to separate files. Forces `source_maps.enable` when set to `true`.',
555
+ },
542
556
  // agent.node.library_usage.reporting
543
557
  {
544
558
  name: 'agent.node.library_usage.reporting.enable',
@@ -574,6 +588,11 @@ Example - \`/opt/Contrast/contrast.log\` creates a log in the \`/opt/Contrast\`
574
588
  default: 'npm',
575
589
  desc: 'Set the full path of the npm executable, used for library analysis',
576
590
  },
591
+ {
592
+ name: 'agent.node.mask_http_body',
593
+ arg: '[false]',
594
+ desc: 'Mask the HTTP request body with `xxxx`',
595
+ },
577
596
  // inventory
578
597
  {
579
598
  name: 'inventory.analyze_libraries',
@@ -871,9 +890,13 @@ Example - \`label1, label2, label3\``,
871
890
  desc: 'Set to `false` to disable detection of cloud provider metadata such as resource identifiers.'
872
891
  },
873
892
  ].map((opt) => {
874
- let env = StringPrototypeReplaceAll.call(StringPrototypeToUpperCase.call(opt.name), '.', '__');
875
- env = StringPrototypeReplaceAll.call(env, '-', '_');
876
- return Object.assign(opt, { env: `CONTRAST__${env}` });
893
+ if (!opt.env) {
894
+ let env = StringPrototypeReplaceAll.call(StringPrototypeToUpperCase.call(opt.name), '.', '__');
895
+ env = StringPrototypeReplaceAll.call(env, '-', '_');
896
+ return Object.assign(opt, { env: `CONTRAST__${env}` });
897
+ }
898
+
899
+ return opt;
877
900
  });
878
901
 
879
902
  module.exports = options;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/config",
3
- "version": "1.57.1",
3
+ "version": "1.58.1",
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)",
@@ -21,8 +21,8 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@contrast/common": "1.41.1",
24
- "@contrast/core": "1.62.1",
25
- "deepmerge": "^4.3.1",
26
- "yaml": "^2.2.2"
24
+ "@contrast/core": "1.63.1",
25
+ "deepmerge": "4.3.1",
26
+ "yaml": "2.2.2"
27
27
  }
28
28
  }