Secret configuration value which might contain sensitive details.
When a secret configuration value is shown, the value is replaced by the first 7 characters of the SHA-1 hash for the value. This short SHA-1 hash is available as Secret#valueShortHash, and the full SHA-1 hash is available as Secret#valueHash. The underlying configuration value is available as Secret#value.
ConfigValue#secret can be used to wrap a value in Secret, while also redacting sentitive details from errors.
- Example:
scala> import cats.syntax.all._ import cats.syntax.all._ scala> val secret = Secret(123) secret: Secret[Int] = Secret(40bd001) scala> secret.valueShortHash res0: String = 40bd001 scala> secret.valueHash res1: String = 40bd001563085fc35165329ea1ff5c5ecbdbbeef scala> secret.value res2: Int = 123- Companion:
- object
class Object
trait Matchable
class Any
Value members
Abstract methods
Returns the SHA-1 hash for the configuration value.
Returns the SHA-1 hash for the configuration value.
Hashing is done in UTF-8 and the hash is
returned in hexadecimal format.