Sha256: 90e2a8e43a370d49a626765f306bd6b6cd80e6ebb22f4a4f17263942d9d34574

Contents?: true

Size: 1.29 KB

Versions: 18

Compression:

Stored size: 1.29 KB

Contents

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

require 'contrast/agent/reporting/reporting_events/reportable_hash'
require 'contrast/utils/assess/trigger_method_utils'
require 'contrast/agent/reporting/reporting_utilities/endpoints'
require 'contrast/components/assess'

module Contrast
  module Agent
    module Reporting
      # This is the new ReportingEvent class which will include all the needed and mutual information for the new
      # reporting system.
      #
      # @abstract
      class ReportingEvent < Contrast::Agent::Reporting::ReportableHash
        # @return [String] the endpoint, with host, to which this event should be sent
        attr_reader :event_endpoint
        # @return event_method [Symbol] the HTTP method to use to send this event
        attr_reader :event_method

        def initialize
          @event_method ||= :POST # rubocop:disable Lint/DisjunctiveAssignmentInConstructor
          super()
        end

        # Some reports require specific additional headers to be used. To that end, we'll attach them here, letting
        # each handle their own.
        #
        # @param _request [Net::HTTPRequest]
        def attach_headers _request; end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
contrast-agent-7.6.1 lib/contrast/agent/reporting/reporting_events/reporting_event.rb
contrast-agent-7.6.0 lib/contrast/agent/reporting/reporting_events/reporting_event.rb
contrast-agent-7.5.0 lib/contrast/agent/reporting/reporting_events/reporting_event.rb
contrast-agent-7.4.1 lib/contrast/agent/reporting/reporting_events/reporting_event.rb
contrast-agent-7.4.0 lib/contrast/agent/reporting/reporting_events/reporting_event.rb
contrast-agent-7.3.2 lib/contrast/agent/reporting/reporting_events/reporting_event.rb
contrast-agent-7.3.1 lib/contrast/agent/reporting/reporting_events/reporting_event.rb
contrast-agent-7.3.0 lib/contrast/agent/reporting/reporting_events/reporting_event.rb
contrast-agent-7.2.0 lib/contrast/agent/reporting/reporting_events/reporting_event.rb
contrast-agent-7.1.0 lib/contrast/agent/reporting/reporting_events/reporting_event.rb
contrast-agent-7.0.0 lib/contrast/agent/reporting/reporting_events/reporting_event.rb
contrast-agent-6.15.3 lib/contrast/agent/reporting/reporting_events/reporting_event.rb
contrast-agent-6.15.2 lib/contrast/agent/reporting/reporting_events/reporting_event.rb
contrast-agent-6.15.1 lib/contrast/agent/reporting/reporting_events/reporting_event.rb
contrast-agent-6.15.0 lib/contrast/agent/reporting/reporting_events/reporting_event.rb
contrast-agent-6.14.0 lib/contrast/agent/reporting/reporting_events/reporting_event.rb
contrast-agent-6.13.0 lib/contrast/agent/reporting/reporting_events/reporting_event.rb
contrast-agent-6.12.0 lib/contrast/agent/reporting/reporting_events/reporting_event.rb