dwolla / scala-secure-config   0.2.0

MIT License GitHub

Tagged type and PureConfig ConfigReader for automatically decrypting encrypted config values in TypeSafe Config files.

Scala versions: 2.13 2.12

Secure Config

Dwolla/scala-secure-config CI license

Tagged type and PureConfig ConfigReader for automatically decrypting encrypted config values in TypeSafe Config files.

Artifacts

Library

"com.dwolla" %% "secure-config" % "0.1-SNAPSHOT"

Examples

case class JenkinsConfig[F[_]](baseUri: Uri, username: String, password: F[SecurableString])

val config: Stream[IO, JenkinsConfig[Id]] = 
  Stream.eval(loadConfigF[IO, JenkinsConfig[IO]]).through( _.evalMap { b 
    val cryptoTexts = b.password :: HNil
  
    cryptoTexts.sequence.map {
      case password :: HNil 
        JenkinsConfig[Id](b.baseUri, b.username, password)
    }
  })

(The hope is that the pipe can eventually be made generic so that knowledge of the specific encrypted fields doesn't need to be maintained in the pipe.)