lib/contrast/agent/assess/policy/trigger/xpath.rb in contrast-agent-7.5.0 vs lib/contrast/agent/assess/policy/trigger/xpath.rb in contrast-agent-7.6.0
- old
+ new
@@ -13,16 +13,30 @@
# as a splat argument or an options hash, we need to iterate through
# these objects to see if we were tracking on any of them and report
# a finding if so.
class Xpath
class << self
+ # @param trigger_node [Contrast::Agent::Assess::Policy::MethodPolicy] the node that governs this
+ # propagation event.
+ # @param _source [Object] the source of the propagation
+ # @param object [Object] the object to which the source is being appended
+ # @param args [Array<Object>] the arguments to the method
+ # @param ret [Object] the return value of the method
+ # @return [Object] the return value of the method
def xpath_expression_trigger trigger_node, _source, object, ret, *args
return ret unless args
process(trigger_node, object, ret, *args)
end
+ # @param trigger_node [Contrast::Agent::Assess::Policy::MethodPolicy] the node that governs this
+ # propagation event.
+ # @param _source [Object] the source of the propagation
+ # @param object [Object] the object to which the source is being appended
+ # @param args [Array<Object>] the arguments to the method
+ # @param ret [Object] the return value of the method
+ # @return [Object] the return value of the method
def xpath_oga_trigger trigger_node, _source, object, ret, *args
return ret unless args
# convert the options arg in Oga::XML::CharacterNode#initialize into an
# array of its values so we can check if any are unsafe
@@ -30,9 +44,14 @@
process(trigger_node, object, ret, *args)
end
private
+ # @param trigger_node [Contrast::Agent::Assess::Policy::MethodPolicy] the node that governs this
+ # propagation event.
+ # @param object [Object] the object to which the source is being appended
+ # @param ret [Object] the return value of the method
+ # @param args [Array<Object>] the arguments to the method
def process trigger_node, object, ret, *args
args.each do |arg|
next unless arg.cs__is_a?(String) || arg.cs__is_a?(Symbol)
next unless Contrast::Agent::Assess::Tracker.tracked?(arg)
next unless trigger_node.violated?(arg)