Sha256: f0444e0623daa8437ccdafbd558cf01dde2b390f434208e772cf574999300978
Contents?: true
Size: 1.79 KB
Versions: 10
Compression:
Stored size: 1.79 KB
Contents
# Copyright (c) 2022 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details. # frozen_string_literal: true require 'contrast/components/logger' 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 include Contrast::Components::Logger::InstanceMethods # @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 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 # 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 begin validate rescue ArgumentError => e logger.error('ReportingEvent validation failed with: ', e) return end {} end # @raise [ArgumentError] def validate; end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems