Packages

  • package root

    This is the API documentation for Ciris: lightweight, extensible, and validated configuration loading in Scala.
    The documentation is kept up-to-date with new releases, currently documenting release v0.12.0 on Scala 2.12.
    Please note that the documentation targets the JVM, and there may be differences on Scala.js and Scala Native.

    This is the API documentation for Ciris: lightweight, extensible, and validated configuration loading in Scala.
    The documentation is kept up-to-date with new releases, currently documenting release v0.12.0 on Scala 2.12.
    Please note that the documentation targets the JVM, and there may be differences on Scala.js and Scala Native.

    Ciris is divided into the following set of modules.

    • The cats module integrates with cats for type classes and type class instances.
    • The cats-effect module integrates with cats-effect for type classes for effect types.
    • The core module provides basic functionality and support for standard library types.
    • The enumeratum module integrates with enumeratum to be able to read enumerations.
    • The generic module uses shapeless to be able to read products and coproducts.
    • The refined module integrates with refined to be able to read refinement types.
    • The spire module integrates with spire to be able to read more number types.
    • The squants module integrates with squants to read values with unit of measure.

    If you're looking for usage instructions, please refer to the usage guide.

    Definition Classes
    root
  • package ciris

    The main namespace of Ciris is ciris, and the easiest way to get started is to bring it into scope with an import.
    If you are looking for a getting started guide, with examples and explanations, please refer to the usage guide.

    The main namespace of Ciris is ciris, and the easiest way to get started is to bring it into scope with an import.
    If you are looking for a getting started guide, with examples and explanations, please refer to the usage guide.

    Definition Classes
    root
  • package api
    Definition Classes
    ciris
  • package cats

    Module providing an integration with cats.

    Module providing an integration with cats.

    Definition Classes
    ciris
  • package decoders
    Definition Classes
    ciris
  • package enumeratum

    Module providing an integration with enumeratum.

    Module providing an integration with enumeratum.

    Definition Classes
    ciris
  • package generic

    Module using shapeless for generic derivation of ConfigDecoders.

    Module using shapeless for generic derivation of ConfigDecoders.

    Definition Classes
    ciris
  • package refined

    Module providing an integration with refined.

    Module providing an integration with refined.

    Definition Classes
    ciris
  • package spire

    Module providing an integration with spire.

    Module providing an integration with spire.

    Definition Classes
    ciris
  • package squants

    Module providing an integration with squants.

    Module providing an integration with squants.

    Definition Classes
    ciris
  • ConfigDecoder
  • ConfigEntry
  • ConfigError
  • ConfigErrors
  • ConfigException
  • ConfigKeyType
  • ConfigResult
  • ConfigSource
  • ConfigValue
  • Secret

final class Secret[A] extends AnyRef

Secret is used to denote that a configuration value is secret, and that it should not be included in any log output. By wrapping a value with Secret, the value will not be printed, but a Secret(hash) placeholder will take its place, where hash is the SHA1 short hash of the value as a String in UTF-8. The short hash can be retrieved with valueShortHash and the full hash with valueHash. When decoding types wrapped with Secret, sensitive details will automatically be redacted from error messages.

To create a new Secret, use the apply method in the companion object.

scala> Secret(123)
res0: Secret[Int] = Secret(40bd001)

The equals, hashCode, copy, and unapply methods are implemented.

scala> Secret(123) == Secret(123)
res1: Boolean = true

scala> Secret(123).copy("abc")
res2: Secret[String] = Secret(a9993e3)

scala> Secret(123) match { case Secret(value) => Secret(value + 1) }
res3: Secret[Int] = Secret(f38cfe2)

The original value can be retrieved; be careful to not include it in logs.

scala> Secret(123).value
res4: Int = 123
A

the type of the original value being wrapped

Source
Secret.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Secret
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  6. def copy[B](value: B = value): Secret[B]
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(that: Any): Boolean
    Definition Classes
    Secret → AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. def hashCode(): Int
    Definition Classes
    Secret → AnyRef → Any
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  17. def toString(): String

    Generates a String representation which includes the short SHA1 hash of the value as a String.

    Generates a String representation which includes the short SHA1 hash of the value as a String. By logging this hash, we can see whether it matches a pre-generated hash of the secret, and know that we're using the expected secret -- without logging the actual secret.

    returns

    a String representation containing valueShortHash

    Definition Classes
    Secret → AnyRef → Any
    See also

    valueShortHash

    valueHash

  18. val value: A
  19. def valueHash: String

    Generates the SHA1 hash of the value as a String in UTF-8 encoding.

    Generates the SHA1 hash of the value as a String in UTF-8 encoding. The hash is returned in hex encoding and a short version, available from valueShortHash is used in toString.

    returns

    the SHA1 hex hash of value.toString in UTF-8

  20. def valueShortHash: String

    Short version of valueHash.

    Short version of valueHash. Only the first 7 characters are included. This short version of the hash is used in toString.

    returns

    the first 7 characters of valueHash

  21. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped