@contrast/protect 1.26.0 → 1.28.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.js CHANGED
@@ -19,8 +19,6 @@ const agentLib = require('@contrast/agent-lib');
19
19
  const { callChildComponentMethodsSync } = require('@contrast/common');
20
20
 
21
21
  module.exports = function(core) {
22
- if (!core.config.protect.enable) return;
23
-
24
22
  const protect = core.protect = {
25
23
  agentLib: module.exports.instantiateAgentLib(agentLib),
26
24
  };
@@ -37,6 +35,11 @@ module.exports = function(core) {
37
35
  require('./semantic-analysis')(core);
38
36
 
39
37
  protect.install = function() {
38
+ if (!core.config.getEffectiveValue('protect.enable')) {
39
+ core.logger.debug('protect is disabled, skipping installation');
40
+ return;
41
+ }
42
+
40
43
  core.rewriter.install('protect');
41
44
  callChildComponentMethodsSync(protect, 'install');
42
45
  };
package/lib/policy.js CHANGED
@@ -346,6 +346,8 @@ module.exports = function (core) {
346
346
  }
347
347
 
348
348
  messages.on(SERVER_SETTINGS_UPDATE, (msg) => {
349
+ if (!config.getEffectiveValue('protect.enable')) return;
350
+
349
351
  updateExclusions(msg);
350
352
  updateGlobalPolicy(msg);
351
353
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/protect",
3
- "version": "1.26.0",
3
+ "version": "1.28.0",
4
4
  "description": "Contrast service providing framework-agnostic Protect support",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
@@ -19,8 +19,8 @@
19
19
  "dependencies": {
20
20
  "@contrast/agent-lib": "^7.0.1",
21
21
  "@contrast/common": "1.15.1",
22
- "@contrast/core": "1.24.0",
23
- "@contrast/esm-hooks": "1.20.0",
22
+ "@contrast/core": "1.26.0",
23
+ "@contrast/esm-hooks": "1.22.0",
24
24
  "@contrast/scopes": "1.4.0",
25
25
  "ipaddr.js": "^2.0.1",
26
26
  "semver": "^7.3.7"