@contrast/agentify 1.12.0 → 1.13.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.
Files changed (2) hide show
  1. package/lib/index.js +11 -5
  2. package/package.json +3 -3
package/lib/index.js CHANGED
@@ -90,6 +90,10 @@ class Agent {
90
90
  */
91
91
  Module.runMain = async function (...args) {
92
92
  try {
93
+ for (const err of config._errors) {
94
+ throw err;
95
+ }
96
+
93
97
  logger.info('Starting the Contrast agent');
94
98
  logger.debug({ config }, 'Agent configuration');
95
99
 
@@ -136,20 +140,22 @@ class Agent {
136
140
  }
137
141
 
138
142
  logDiagnosticFiles() {
139
- const { config: { agent: { diagnostics } }, logger } = this.core;
143
+ const { config, logger } = this.core;
144
+
145
+ if (!config.agent.diagnostics.enable) return;
140
146
 
141
- if (!diagnostics.enable) return;
147
+ const { report_path } = config.agent.diagnostics;
142
148
 
143
149
  // let these run async so they don't block agent startup.
144
150
  fs.writeFile(
145
- path.join(diagnostics.report_path, 'contrast_effective_config.json'),
146
- JSON.stringify(this.core.getEffectiveConfig(), null, 2)
151
+ path.join(report_path, 'contrast_effective_config.json'),
152
+ JSON.stringify(config.getReport({ redact: true }), null, 2)
147
153
  ).catch((err) => {
148
154
  logger.warn({ err }, 'unable to write effective config file');
149
155
  });
150
156
 
151
157
  fs.writeFile(
152
- path.join(diagnostics.report_path, 'contrast_system_info.json'),
158
+ path.join(report_path, 'contrast_system_info.json'),
153
159
  JSON.stringify(this.core.getSystemInfo(), null, 2)
154
160
  ).catch((err) => {
155
161
  logger.warn({ err }, 'unable to write system info file');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/agentify",
3
- "version": "1.12.0",
3
+ "version": "1.13.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)",
@@ -17,6 +17,6 @@
17
17
  "test": "../scripts/test.sh"
18
18
  },
19
19
  "dependencies": {
20
- "@contrast/common": "1.14.0"
20
+ "@contrast/common": "1.15.0"
21
21
  }
22
- }
22
+ }