lib/contrast/agent/patching/policy/policy.rb in contrast-agent-7.0.0 vs lib/contrast/agent/patching/policy/policy.rb in contrast-agent-7.1.0

- old
+ new

@@ -1,9 +1,9 @@ # Copyright (c) 2023 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details. # frozen_string_literal: true -require 'json' +require 'contrast/utils/json' require 'singleton' require 'contrast' require 'contrast/components/logger' require 'contrast/agent/patching/policy/module_policy' @@ -69,10 +69,10 @@ # # If the configuration file explicitly disables a feature, we know that we will not ever be able to enable # it, so in that case, we can skip policy loading. return if disabled_globally? - policy_data = JSON.parse(string) + policy_data = Contrast::Utils::Json.parse(string) policy_data[RULES_KEY].each do |rule_hash| rule_hash[TRIGGERS_KEY].each do |trigger_hash| trigger_node = node_type.new(trigger_hash, rule_hash) add_node(trigger_node)