Class: Telm::Core::Redaction
- Inherits:
-
Object
- Object
- Telm::Core::Redaction
- Defined in:
- lib/telm/core/redaction.rb
Overview
Sensitive-column detection. On by default; the config lists take "table.column" strings and win over the pattern in both directions.
Constant Summary collapse
- DEFAULT_PATTERN =
/password|token|secret|otp|ssn|digest|api_key/i- MASK =
"••••••"
Instance Method Summary collapse
-
#initialize(config: Telm.config) ⇒ Redaction
constructor
A new instance of Redaction.
- #redact?(table_name, column_name) ⇒ Boolean
Constructor Details
Instance Method Details
#redact?(table_name, column_name) ⇒ Boolean
16 17 18 19 20 21 22 23 |
# File 'lib/telm/core/redaction.rb', line 16 def redact?(table_name, column_name) qualified = "#{table_name}.#{column_name}" return false if @unredacted.include?(qualified) return true if @redacted.include?(qualified) DEFAULT_PATTERN.match?(column_name.to_s) end |