Module: Philiprehberger::Mask::DeepScrubber
- Defined in:
- lib/philiprehberger/mask/deep_scrubber.rb
Overview
Recursively scrub sensitive data in hashes and arrays
Constant Summary collapse
- FILTERED =
'[FILTERED]'
Class Method Summary collapse
-
.call(data, patterns:, sensitive_keys:, mode: :full) ⇒ Object
Deep-walk and scrub a data structure.
-
.call_with_audit(data, patterns:, sensitive_keys:) ⇒ Hash
Deep-walk and scrub with audit trail.
Class Method Details
.call(data, patterns:, sensitive_keys:, mode: :full) ⇒ Object
Deep-walk and scrub a data structure
16 17 18 |
# File 'lib/philiprehberger/mask/deep_scrubber.rb', line 16 def self.call(data, patterns:, sensitive_keys:, mode: :full) walk(data, patterns, normalize_keys(sensitive_keys), mode) end |
.call_with_audit(data, patterns:, sensitive_keys:) ⇒ Hash
Deep-walk and scrub with audit trail
26 27 28 29 30 |
# File 'lib/philiprehberger/mask/deep_scrubber.rb', line 26 def self.call_with_audit(data, patterns:, sensitive_keys:) audit = [] result = walk_with_audit(data, patterns, normalize_keys(sensitive_keys), audit) { result: result, audit: audit } end |