Module: NewRelic::Agent::NewRelicService::SecurityPolicySettings

Defined in:
lib/new_relic/agent/new_relic_service/security_policy_settings.rb

Defined Under Namespace

Classes: Validator

Constant Summary collapse

EXPECTED_SECURITY_POLICIES =
%w[
  record_sql
  attributes_include
  allow_raw_exception_messages
  custom_events
  custom_parameters
  custom_instrumentation_editor
  message_parameters
].map(&:freeze)

Class Method Summary collapse

Class Method Details

.preliminary_settings(security_policies) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/new_relic/agent/new_relic_service/security_policy_settings.rb', line 19

def self.preliminary_settings(security_policies)
  enabled_key = 'enabled'.freeze
  settings = EXPECTED_SECURITY_POLICIES.inject({}) do |memo, policy_name|
    memo[policy_name] = {enabled_key => security_policies[policy_name][enabled_key]}
    memo
  end
  {'security_policies' => settings}
end