class Aws::Log::ParamFilter

Constants

SENSITIVE

A managed list of sensitive parameters that should be filtered from logs. This is updated automatically as part of each release. See the `tasks/sensitive.rake` for more information.

** DO NOT EDIT THE FOLLOWING LINE OF CODE **

Public Class Methods

new(options = {}) click to toggle source
# File lib/aws-sdk-core/log/param_filter.rb, line 16
def initialize(options = {})
  @filters = Set.new(SENSITIVE + Array(options[:filter]))
end

Public Instance Methods

filter(value) click to toggle source
# File lib/aws-sdk-core/log/param_filter.rb, line 20
def filter(value)
  case value
  when Struct, Hash then filter_hash(value)
  when Array then filter_array(value)
  else value
  end
end

Private Instance Methods

filter_array(values) click to toggle source
# File lib/aws-sdk-core/log/param_filter.rb, line 38
def filter_array(values)
  values.map { |value| filter(value) }
end
filter_hash(values) click to toggle source
# File lib/aws-sdk-core/log/param_filter.rb, line 30
def filter_hash(values)
  filtered = {}
  values.each_pair do |key, value|
    filtered[key] = @filters.include?(key) ? '[FILTERED]' : filter(value)
  end
  filtered
end