Class: TCellAgent::Rust::AgentConfig
- Inherits:
-
Hash
- Object
- Hash
- TCellAgent::Rust::AgentConfig
- Defined in:
- lib/tcell_agent/rust/agent_config.rb
Instance Method Summary collapse
-
#initialize(configuration) ⇒ AgentConfig
constructor
A new instance of AgentConfig.
Constructor Details
#initialize(configuration) ⇒ AgentConfig
Returns a new instance of AgentConfig.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/tcell_agent/rust/agent_config.rb', line 6 def initialize(configuration) send_mode = 'Normal' send_mode = 'Demo' if configuration.demomode = configuration. unless configuration.js_agent_api_base_url parsed_uri = URI.parse(configuration.tcell_api_url) api_url = [parsed_uri.scheme, '://', parsed_uri.host] api_url.push(":#{parsed_uri.port}") unless [80, 443].include?(parsed_uri.port) configuration.js_agent_api_base_url = "#{api_url.join('')}/api/v1" end self['disable_event_sending'] = !configuration.should_start_event_manager? self['send_mode'] = send_mode self['agent_type'] = 'Ruby' self['agent_version'] = TCellAgent::VERSION self['diagnostics_enabled'] = false self['application'] = { :app_id => configuration.app_id, :api_key => configuration.api_key, :tcell_api_url => configuration.tcell_api_url, :tcell_input_url => configuration.tcell_input_url, :hmac_key => configuration.hmac_key, :password_hmac_key => configuration.password_hmac_key, :allow_payloads => configuration.allow_payloads, :js_agent_api_base_url => configuration.js_agent_api_base_url, :js_agent_url => configuration.js_agent_url, :cache_dir => configuration.cache_folder, :log_dir => configuration.agent_log_dir, :logging_options => , :host_identifier => configuration.host_identifier, :reverse_proxy_ip_address_header => configuration.reverse_proxy_ip_address_header, :fetch_policies_from_tcell => configuration.should_start_policy_poll?, :preload_policy_filename => configuration.preload_policy_filename } self['appfirewall'] = { :enable_body_json_inspection => true, :allow_log_payloads => true } self['max_header_size'] = configuration.max_csp_header_bytes || (1024 * 1024) end |