Class: Checkend::Filters::SanitizeFilter
- Inherits:
-
Object
- Object
- Checkend::Filters::SanitizeFilter
- Defined in:
- lib/checkend/filters/sanitize_filter.rb
Overview
SanitizeFilter scrubs sensitive data from hashes before sending.
It recursively traverses hashes and arrays, replacing values for keys that match the configured filter patterns.
Constant Summary collapse
- FILTERED =
'[FILTERED]'- TRUNCATE_LIMIT =
10_000- MAX_DEPTH =
10
Instance Method Summary collapse
-
#call(data) ⇒ Hash, ...
Sanitize a hash, scrubbing sensitive values.
-
#initialize(config) ⇒ SanitizeFilter
constructor
A new instance of SanitizeFilter.
Constructor Details
#initialize(config) ⇒ SanitizeFilter
Returns a new instance of SanitizeFilter.
15 16 17 18 |
# File 'lib/checkend/filters/sanitize_filter.rb', line 15 def initialize(config) @filter_keys = config.filter_keys.map { |k| k.to_s.downcase } @filter_pattern = build_pattern(@filter_keys) end |
Instance Method Details
#call(data) ⇒ Hash, ...
Sanitize a hash, scrubbing sensitive values
24 25 26 |
# File 'lib/checkend/filters/sanitize_filter.rb', line 24 def call(data) sanitize(deep_dup(data), 0) end |