Secret Masker
object SecretMasker
Utility object that masks secret values for safe display in logs, diagnostics, and configuration dumps.
Three masking strategies are supported (see MaskStrategy):
| Strategy | Input | Output | Description |
|---|---|---|---|
| MaskStrategy.FULL | "superSecret" | "********" | Replaces the entire value with asterisks. |
| MaskStrategy.PARTIAL | "superSecret" (visibleChars=4) | "supe********" | Keeps the first N characters visible. |
| MaskStrategy.EDGES | "superSecret" | "s**********t" | Shows only the first and last character. |
Empty strings always produce "********" regardless of strategy. Strings of length 2 or less under MaskStrategy.EDGES also produce "********" to avoid revealing the full value.
Since
1.0