PureConfig ConfigReader for automatically decrypting encrypted config values using AWS KMS.
"com.dwolla" %% "secure-config" % "0.1-SNAPSHOT"
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.)