Sha256: 37e1216e1724a59e2598cd55a9de49148a76a708c93d64394920ae78cd23cf98

Contents?: true

Size: 1.27 KB

Versions: 7

Compression:

Stored size: 1.27 KB

Contents

# Copyright (c) 2022 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
# frozen_string_literal: true

require 'base64'

module Contrast
  module Agent
    module Reporting
      # This is the new FindingEventParentObject class which will include all the needed information for the new
      # reporting system to relay this information in the Finding/Trace messages. These FindingEventParentObject are
      # used by TeamServer to relate this event to those that came previously. They represent the events that directly
      # preceding the FindingEvent generated.
      class FindingEventParentObject
        # @return [Integer] the Id of the parent event
        attr_reader :id

        def initialize id
          @id = id
        end

        # Convert the instance variables on the class, and other information, into the identifiers required for
        # TeamServer to process the JSON form of this message.
        #
        # @return [Hash]
        # @raise [ArgumentError]
        def to_controlled_hash
          validate
          {
              id: id
          }
        end

        def validate
          raise(ArgumentError, "#{ self } did not have a proper id. Unable to continue.") unless id
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
contrast-agent-6.2.0 lib/contrast/agent/reporting/reporting_events/finding_event_parent_object.rb
contrast-agent-6.1.2 lib/contrast/agent/reporting/reporting_events/finding_event_parent_object.rb
contrast-agent-6.1.1 lib/contrast/agent/reporting/reporting_events/finding_event_parent_object.rb
contrast-agent-6.1.0 lib/contrast/agent/reporting/reporting_events/finding_event_parent_object.rb
contrast-agent-6.0.0 lib/contrast/agent/reporting/reporting_events/finding_event_parent_object.rb
contrast-agent-5.3.0 lib/contrast/agent/reporting/reporting_events/finding_event_parent_object.rb
contrast-agent-5.2.0 lib/contrast/agent/reporting/reporting_events/finding_event_parent_object.rb