module

Noir::Redact

Masks credentials in option values before they reach a log line. -d dumps every option, and debug output is what users paste into issues.

Constants

MASK = "***"
SECRET_KEYS = ["ai_key"] of ::String

Options whose whole value is a credential.

Class methods

named_value(entry : String) : String

Name: value → Name: ***. Without a separator (a malformed --probe-header "Authorization Bearer xyz") everything after the first word is hidden, and a lone word is hidden whole.

Source
option(key : String, value : YAML::Any) : String
Source
secret(text : String, secrets : Enumerable(String)) : String

Every occurrence of each secret in text, for text a remote party wrote (a provider error body that echoes the key it was sent). Secrets under four characters are left alone: masking them would garble the message and hide nothing worth hiding.

Source
url(text : String) : String

Mask userinfo and query values of every URL in text, keeping the query parameter names.

Source
webhook(text : String) : String

A webhook URL down to its origin.

Source