lib/contrast/tasks/config.rb in contrast-agent-6.1.0 vs lib/contrast/tasks/config.rb in contrast-agent-6.1.1
- old
+ new
@@ -73,11 +73,11 @@
config = Contrast::Configuration.new
abort('Unable to Build Config') unless config
missing = []
api_hash = config.root.api.to_hash
api_hash.each_key do |key|
- value = mask_keys api_hash, key
+ value = mask_keys(api_hash, key)
if value.is_a?(Contrast::Config::ApiProxyConfiguration)
Contrast::Config.validate_proxy(value)
elsif value.is_a?(Contrast::Config::CertificationConfiguration)
Contrast::Config.validate_cert(value)
next
@@ -90,59 +90,59 @@
end
abort("Missing required API configuration values: #{ missing.join(', ') }") unless missing.empty?
end
def self.validate_proxy config
- puts "Proxy Enabled: #{ config.enable }"
+ puts("Proxy Enabled: #{ config.enable }")
return unless config.enable
- puts "Proxy URL: #{ config.url }"
+ puts("Proxy URL: #{ config.url }")
abort('Proxy Enabled but no Proxy URL given') unless config.url
end
def self.validate_cert config
- puts "Certification Enabled: #{ config.enable }"
+ puts("Certification Enabled: #{ config.enable }")
return unless config.enable
- puts "CA File: #{ config.ca_file }"
+ puts("CA File: #{ config.ca_file }")
abort('CA file path not provided') unless config.ca_file
- puts "Cert File: #{ config.cert_file }"
+ puts("Cert File: #{ config.cert_file }")
abort('Cert file path not provided') unless config.cert_file
- puts "Key File: #{ config.key_file }"
+ puts("Key File: #{ config.key_file }")
abort('Key file path not provided') unless config.key_file
end
def self.validate_audit config
- puts "Request Audit Enabled: #{ config.enable }"
+ puts("Request Audit Enabled: #{ config.enable }")
return unless config.enable
config.each do |k, v|
- puts "#{ k }::#{ v }"
+ puts("#{ k }::#{ v }")
end
end
def self.validate_headers
missing = []
reporter = Contrast::Agent::Reporter.new
reporter_headers = reporter.client.headers.to_hash
reporter_headers.each_key do |key|
- value = mask_keys reporter_headers, key
+ value = mask_keys(reporter_headers, key)
missing << key if value.nil?
end
abort("Missing required header values: #{ missing.join(', ') }") unless missing.empty?
reporter
end
def self.test_connection reporter
connection = reporter.connection
abort('Failed to Initialize Connection please check error logs for details') unless connection
- abort('Failed to Start Client please check error logs for details') unless reporter.client.startup! connection
+ abort('Failed to Start Client please check error logs for details') unless reporter.client.startup!(connection)
end
def self.mask_keys hash, key
value = hash[key]
redacted_value = Contrast::Configuration::REDACTED if SKIP_LOG.include?(key.to_s)
- puts "#{ key }::#{ redacted_value || value }" unless value.is_a?(Contrast::Config::BaseConfiguration)
+ puts("#{ key }::#{ redacted_value || value }") unless value.is_a?(Contrast::Config::BaseConfiguration)
value
end
end
end
end