@contrast/config 1.44.0 → 1.46.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/common.js CHANGED
@@ -104,6 +104,7 @@ const mappings = {
104
104
  if (!isNaN(baseProbability)) return baseProbability;
105
105
  }
106
106
  },
107
+ 'assess.stacktraces': (remoteData) => remoteData.assess?.report_stacktraces,
107
108
  'agent.logger.level': coerceLowerCase('logger.level'),
108
109
  'agent.logger.path': (remoteData) => remoteData.logger?.path,
109
110
  'agent.security_logger.syslog.enable': (remoteData) => remoteData.security_logger?.syslog?.enable,
package/lib/index.d.ts CHANGED
@@ -206,6 +206,8 @@ export interface Config {
206
206
  /** Default: `./.contrast` */
207
207
  path: string;
208
208
  }
209
+ /** Default: `true` */
210
+ minify: boolean;
209
211
  };
210
212
  source_maps: {
211
213
  /** Default: `true` */
package/lib/options.js CHANGED
@@ -500,6 +500,13 @@ Example - \`/opt/Contrast/contrast.log\` creates a log in the \`/opt/Contrast\`
500
500
  fn: toAbsolutePath,
501
501
  desc: "Set the directory in which to cache rewritten source code files. Defaults to `.contrast/` in the application's current working directory.",
502
502
  },
503
+ {
504
+ name: 'agent.node.rewrite.minify',
505
+ arg: '[false]',
506
+ default: true,
507
+ fn: castBoolean,
508
+ desc: 'Set to `false` to disable minification of rewritten source code files.'
509
+ },
503
510
  {
504
511
  name: 'agent.node.source_maps.enable',
505
512
  arg: '[false]',
@@ -575,6 +582,7 @@ Example - \`/opt/Contrast/contrast.log\` creates a log in the \`/opt/Contrast\`
575
582
  // effective based on local config and 'assess.sampling' TeamServer DTM
576
583
  name: 'assess.probabilistic_sampling.base_probability',
577
584
  arg: '<probability>',
585
+ /** @param {string} val */
578
586
  fn: (val) => {
579
587
  const p = parseFloat(val);
580
588
  if (p >= 0 && p <= 1) return p;
@@ -585,9 +593,24 @@ Example - \`/opt/Contrast/contrast.log\` creates a log in the \`/opt/Contrast\`
585
593
  });
586
594
  }
587
595
  },
588
- default: 0.10,
596
+ default: 0.05,
589
597
  desc: 'A value p within the range [0, 1]. Each request will share same probability p of being sampled.',
590
598
  },
599
+ {
600
+ name: 'assess.probabilistic_sampling.event_detail',
601
+ arg: '<level>',
602
+ default: 'FULL',
603
+ fn: (value) => {
604
+ if (!value) return undefined;
605
+ value = String(value).toUpperCase();
606
+ const valids = new Set(['FULL', 'MINIMAL']);
607
+ if (valids.has(value)) {
608
+ return value;
609
+ }
610
+ throw new Error(`Invalid option assess.probabilistic_sampling.event_detail: value must be one of ${Array.from(valids)}`);
611
+ },
612
+ desc: 'Control the values captured by Assess vulnerability events. FULL captures more context by stringifying all values involved in dataflow activity which can add performance overhead. MINIMAL can improve performance by only capturing type name for non-string event values. FULL is the default.',
613
+ },
591
614
  {
592
615
  name: 'assess.probabilistic_sampling.route_monitor.enable',
593
616
  arg: '[true]',
@@ -754,8 +777,18 @@ Example - \`label1, label2, label3\``,
754
777
  {
755
778
  name: 'server.environment',
756
779
  arg: '<environment>',
757
- // enum: ['QA', 'PRODUCTION', 'DEVELOPMENT'], none of the other agents validate this
758
- fn: uppercase,
780
+ /** @param {string} val */
781
+ fn: (val) => {
782
+ if (!val) return val;
783
+
784
+ const valid = new Set(['QA', 'PRODUCTION', 'DEVELOPMENT']);
785
+ const normalized = uppercase(val);
786
+ if (!valid.has(normalized)) {
787
+ throw new Error(`Invalid option: server.environment must be one of ${Array.from(valid)}`);
788
+ }
789
+
790
+ return normalized;
791
+ },
759
792
  desc: `Set the environment directly to override the default set by the Contrast UI. This allows the user to configure the environment dynamically at startup rather than manually updating the Server in the Contrast UI themselves afterwards.
760
793
  Valid values include \`QA\`, \`PRODUCTION\` and \`DEVELOPMENT\`. For example, \`PRODUCTION\` registers this Server as running in a \`PRODUCTION\` environment, regardless of the organization's default environment in the Contrast UI.`,
761
794
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/config",
3
- "version": "1.44.0",
3
+ "version": "1.46.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)",
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@contrast/common": "1.32.0",
24
- "@contrast/core": "1.49.0",
24
+ "@contrast/core": "1.51.0",
25
25
  "yaml": "^2.2.2"
26
26
  }
27
27
  }