# Class LittleGhost::Support::Redactor

Documentation version: Edge

Canonical HTML: https://littleghostai.org/docs/LittleGhost/Support/Redactor.html

Redactor removes common credential keys, known secret values, and
secret-shaped strings from nested diagnostic data. It returns a copy and
leaves the caller's value unchanged.

Redaction is a defense-in-depth aid, not proof that arbitrary sensitive
content is safe to export. Applications should add known secret values and
send telemetry only to the intended destination.

## Inheritance

`LittleGhost::Support::Redactor < Object`

## Class methods

<a id="method-c-new"></a>
### `.new`

```ruby
.new(redactions: [], stringify_keys: false)
```

Adds literal secrets to the built-in patterns. Values shorter than eight
characters are ignored to avoid over-redaction.

## Instance methods

<a id="method-i-call"></a>
### `#call`

```ruby
#call(value, key: nil)
```

Produces a redacted copy of `value`.

<a id="method-i-scrub_string"></a>
### `#scrub_string`

```ruby
#scrub_string(value)
```

Normalizes invalid UTF-8 and replaces configured and common secrets.

<a id="method-i-sensitive_key-3F"></a>
### `#sensitive_key?`

```ruby
#sensitive_key?(key)
```

Checks whether `key` matches a credential-like name.
