lib/contrast/extension/assess/regexp.rb in contrast-agent-4.14.1 vs lib/contrast/extension/assess/regexp.rb in contrast-agent-5.0.0
- old
+ new
@@ -1,11 +1,12 @@
-# Copyright (c) 2021 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
+# Copyright (c) 2022 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
# frozen_string_literal: true
require 'contrast/agent/assess/policy/propagation_node'
require 'contrast/components/logger'
require 'contrast/components/scope'
+require 'contrast/agent/assess/events/event_data'
module Contrast
module Extension
module Assess
# This Class provides us with a way to invoke Regexp propagation for those
@@ -51,10 +52,15 @@
return unless (result = info_hash[:result])
return unless (string = info_hash[:string])
return unless (properties = Contrast::Agent::Assess::Tracker.properties!(target))
properties.splat_from(string, target)
- properties.build_event(REGEXP_EQUAL_SQUIGGLE_NODE, target, self, result, [string])
+ event_data = Contrast::Agent::Assess::Events::EventData.new(REGEXP_EQUAL_SQUIGGLE_NODE,
+ target,
+ self,
+ result,
+ [string])
+ properties.build_event(event_data)
end
rescue Exception => e # rubocop:disable Lint/RescueException
logger.error('Unable to propagate during Regexp#=~', e)
end
end