Secret

ciris.Secret
See theSecret companion object
sealed abstract class Secret[+A]

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.

Attributes

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
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Abstract methods

def value: A

Returns the underlying configuration value.

Returns the underlying configuration value.

Attributes

def valueHash: String

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.

Attributes

def valueShortHash: String

Returns the first 7 characters of the SHA-1 hash for the configuration value.

Returns the first 7 characters of the SHA-1 hash for the configuration value.

Attributes

See also: