@contrast/config 1.42.0 → 1.44.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
@@ -113,6 +113,7 @@ const mappings = {
113
113
  'agent.security_logger.syslog.severity_exploited': coerceLowerCase('security_logger.syslog.severity_exploited'),
114
114
  'agent.security_logger.syslog.severity_blocked': coerceLowerCase('security_logger.syslog.severity_blocked'),
115
115
  'agent.security_logger.syslog.severity_probed': coerceLowerCase('security_logger.syslog.severity_probed'),
116
+ 'observe.enable': (remoteData) => remoteData.observe?.enable,
116
117
  'server.environment': (remoteData) => remoteData.environment,
117
118
 
118
119
  };
package/lib/config.js CHANGED
@@ -30,6 +30,7 @@ const {
30
30
  USER_CONFIGURATION_FILE,
31
31
  },
32
32
  mappings,
33
+ ConfigSource,
33
34
  } = require('./common');
34
35
 
35
36
  const CONTRAST_CONFIG_PATH = 'CONTRAST_CONFIG_PATH';
@@ -226,6 +227,9 @@ module.exports = class Config {
226
227
  source,
227
228
  });
228
229
  }
230
+
231
+ // this is not a common config value
232
+ this.setValue('preinstrument', !!process.env.CONTRAST_PREINSTRUMENT, ConfigSource.ENVIRONMENT_VARIABLE);
229
233
  }
230
234
 
231
235
  _redact(name, value) {
package/lib/index.js CHANGED
@@ -16,10 +16,14 @@
16
16
  'use strict';
17
17
 
18
18
  const { ConfigSource } = require('./common');
19
+ const { Core } = require('@contrast/core/lib/ioc/core');
19
20
  const Config = require('./config');
20
21
 
21
- module.exports = function (core = {}) {
22
- return core.config = new Config(core);
23
- };
22
+ module.exports = Core.makeComponent({
23
+ name: 'config',
24
+ factory(core = {}) {
25
+ return core.config = new Config(core);
26
+ }
27
+ });
24
28
 
25
29
  module.exports.ConfigSource = ConfigSource;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/config",
3
- "version": "1.42.0",
3
+ "version": "1.44.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)",
@@ -20,7 +20,8 @@
20
20
  "test": "../scripts/test.sh"
21
21
  },
22
22
  "dependencies": {
23
- "@contrast/common": "1.31.0",
23
+ "@contrast/common": "1.32.0",
24
+ "@contrast/core": "1.49.0",
24
25
  "yaml": "^2.2.2"
25
26
  }
26
27
  }