Class: Contrast::Agent::Reporting::ServerSettings

Inherits:
ServerReportingEvent show all
Defined in:
lib/contrast/agent/reporting/reporting_events/server_settings.rb

Overview

This class will initialize a GET request to be send to TS. The server settings endpoint is the way the Agent receives server sittings - Protect rules settings, patterns, keywords and deny/allow lists, log setting.

Instance Attribute Summary

Attributes inherited from ReportingEvent

#event_endpoint, #event_method

Instance Method Summary collapse

Methods inherited from ReportableHash

#event_json, #valid?, #validate

Methods included from Components::Logger::InstanceMethods

#cef_logger, #logger

Constructor Details

#initializeServerSettings

Returns a new instance of ServerSettings.



14
15
16
17
18
# File 'lib/contrast/agent/reporting/reporting_events/server_settings.rb', line 14

def initialize
  @event_method = :GET
  @event_endpoint = Contrast::Agent::Reporting::Endpoints.server_settings
  super()
end

Instance Method Details

#attach_headers(request) ⇒ Object

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

Parameters:

  • request (Net::HTTPRequest)


28
29
30
# File 'lib/contrast/agent/reporting/reporting_events/server_settings.rb', line 28

def attach_headers request
  request['If-Modified-Since'] = since_last_update_httpdate
end

#file_nameObject



20
21
22
# File 'lib/contrast/agent/reporting/reporting_events/server_settings.rb', line 20

def file_name
  'server-settings'
end

#to_controlled_hashHash

Returns:

Raises:

  • (ArgumentError)


34
35
36
# File 'lib/contrast/agent/reporting/reporting_events/server_settings.rb', line 34

def to_controlled_hash
  {}
end