Sha256: 34e3678afde90321b79eaeffaf63a92a80f88a5593a8682f03007bed6f36139a

Contents?: true

Size: 1.33 KB

Versions: 18

Compression:

Stored size: 1.33 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/application_reporting_event'
require 'contrast/agent/reporting/reporting_utilities/endpoints'
require 'contrast/utils/timer'

module Contrast
  module Agent
    module Reporting
      # This class will initialize a GET request to be send to TS. The application settings endpoint is the way
      # the Agent receives application sittings
      class ApplicationSettings < Contrast::Agent::Reporting::ApplicationReportingEvent
        def initialize
          @event_method = :GET
          @event_endpoint = Contrast::Agent::Reporting::Endpoints.application_settings
          super()
        end

        def file_name
          'application-settings'
        end

        # Attach the last server settings received timestamp to the request as it is required.
        #
        # If-Modified-Since: <day-name>, <day> <month> <year> <hour>:<minute>:<second> GMT
        # @param request [Net::HTTPRequest]
        def attach_headers request
          request['If-Modified-Since'] = since_last_update_httpdate
        end

        # @return [Hash]
        # @raise [ArgumentError]
        def to_controlled_hash
          {}
        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/application_settings.rb
contrast-agent-7.6.0 lib/contrast/agent/reporting/reporting_events/application_settings.rb
contrast-agent-7.5.0 lib/contrast/agent/reporting/reporting_events/application_settings.rb
contrast-agent-7.4.1 lib/contrast/agent/reporting/reporting_events/application_settings.rb
contrast-agent-7.4.0 lib/contrast/agent/reporting/reporting_events/application_settings.rb
contrast-agent-7.3.2 lib/contrast/agent/reporting/reporting_events/application_settings.rb
contrast-agent-7.3.1 lib/contrast/agent/reporting/reporting_events/application_settings.rb
contrast-agent-7.3.0 lib/contrast/agent/reporting/reporting_events/application_settings.rb
contrast-agent-7.2.0 lib/contrast/agent/reporting/reporting_events/application_settings.rb
contrast-agent-7.1.0 lib/contrast/agent/reporting/reporting_events/application_settings.rb
contrast-agent-7.0.0 lib/contrast/agent/reporting/reporting_events/application_settings.rb
contrast-agent-6.15.3 lib/contrast/agent/reporting/reporting_events/application_settings.rb
contrast-agent-6.15.2 lib/contrast/agent/reporting/reporting_events/application_settings.rb
contrast-agent-6.15.1 lib/contrast/agent/reporting/reporting_events/application_settings.rb
contrast-agent-6.15.0 lib/contrast/agent/reporting/reporting_events/application_settings.rb
contrast-agent-6.14.0 lib/contrast/agent/reporting/reporting_events/application_settings.rb
contrast-agent-6.13.0 lib/contrast/agent/reporting/reporting_events/application_settings.rb
contrast-agent-6.12.0 lib/contrast/agent/reporting/reporting_events/application_settings.rb