dwolla / scala-secure-config   0.4.1

MIT License GitHub

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

Scala versions: 3.x 2.13

Secure Config

Dwolla/scala-secure-config CI license

PureConfig ConfigReader for automatically decrypting encrypted config values using AWS KMS.

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.)