lib/contrast/agent/assess/events/source_event.rb in contrast-agent-6.2.0 vs lib/contrast/agent/assess/events/source_event.rb in contrast-agent-6.3.0

- old
+ new

@@ -54,22 +54,12 @@ @_forced_source_name ||= Contrast::Utils::StringUtils.force_utf8(source_name) end # Probably only for source events, but we'll go with source_type instead. java & .net support source_type # in propagation events, so we'll future proof this - def build_event_source_dtm - # You can have a source w/o a name, but not w/o a type - return unless source_type - - dtm = Contrast::Api::Dtm::TraceEventSource.new - dtm.type = forced_source_type - dtm.name = forced_source_name - dtm - end - - # Probably only for source events, but we'll go with source_type instead. java & .net support source_type - # in propagation events, so we'll future proof this + # + # @return [Contrast::Agent::Reporting::TraceEventSource, nil] def build_event_source # You can have a source w/o a name, but not w/o a type return unless source_type trace_event_source = Contrast::Agent::Reporting::TraceEventSource.new @@ -86,9 +76,23 @@ return unless @policy_node&.targets&.any? event_dtm.source = @policy_node.source_string if @policy_node.source_string event_dtm.target = @policy_node.target_string @policy_node.targets[0] + end + + private + + # Probably only for source events, but we'll go with source_type instead. java & .net support source_type + # in propagation events, so we'll future proof this + def build_event_source_dtm + # You can have a source w/o a name, but not w/o a type + return unless source_type + + dtm = Contrast::Api::Dtm::TraceEventSource.new + dtm.type = forced_source_type + dtm.name = forced_source_name + dtm end end end end end