Skip to content

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

License

Notifications You must be signed in to change notification settings

Dwolla/scala-secure-config

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published