Redaction

object Redaction

Helpers for keeping credentials out of toString() output and logs.

Functions

Link copied to clipboard
fun keysOnly(properties: Map<String, Any?>): String

Renders only the keys of properties; the values (which may be secrets) are never printed.

Link copied to clipboard
fun secret(value: Any?): String

null or <redacted>, for a presence-only rendering of a secret.

Link copied to clipboard
fun url(value: String?): String

Reduces a URL to scheme://host[:port]. JSON-RPC endpoints routinely embed the API key in the path (/v2/<key>) or query (?apikey=...) or userinfo; none of that survives. An unparseable value yields <redacted-url> rather than being echoed back.