We are developing an implementation of the KmsDriver extension based on this doc: Canton KMS Driver Developer Guide — Daml SDK 2.10.0 documentation
The implementation for the KmsDriver interface was pretty straightforward, but we are having trouble getting the Factory to compile:
[error] -- [E172] Type Error: /Users/jimzhang/workspace.daml/kaleido-canton-kms-scala/src/main/scala/aws/kms/AwsKmsDriverFactory.scala:35:71
[error] 35 | override def configReader = pureconfig.ConfigReader.mapReader[String]
[error] | ^
[error] |Cannot find an implicit instance of pureconfig.ConfigReader[String].
[error] |If you are trying to read or write a case class or sealed trait consider using PureConfig's auto derivation by adding `import pureconfig.generic.auto._`.
[error] |I found:
[error] |
[error] | pureconfig.Derivation.materializeDerivation[A]
[error] |
[error] |But method materializeDerivation in object Derivation does not match type pureconfig.Derivation[pureconfig.ConfigReader[String]].
This was after we’ve added the import import pureconfig.generic.auto._
which according to online searches was the recommendation for errors like this.
Here’s the build.sbt
file for the project config:
ThisBuild / version := "0.1.0-SNAPSHOT"
ThisBuild / scalaVersion := "3.3.5"
lazy val root = (project in file("."))
.settings(
name := "kaleido-canton-kms",
idePackagePrefix := Some("io.kaleido.canton.kms")
)
libraryDependencies += "com.daml" % "canton-community-util-logging_2.13" % "3.3.0-adhoc.20250314.13658.0.v2ae85555"
libraryDependencies += "com.github.pureconfig" %% "pureconfig-core" % "0.17.8"
libraryDependencies += "io.opentelemetry" % "opentelemetry-context" % "1.48.0"
libraryDependencies += "org.scala-lang.modules" % "scala-java8-compat_3" % "1.0.2"
libraryDependencies += "software.amazon.awssdk" % "kms" % "2.29.45"
scalacOptions += "-explain"
Any pointers would be much appreciated!
Jim