Skip to content

Commit

Permalink
Upgrade Ciris to 3.5.x
Browse files Browse the repository at this point in the history
Upgrade Scala 3 and Scala 2
Upgrade Cats-effect and cats-core
Upgrade awssdk secretsmanager
Upgrade munit
  • Loading branch information
alexgb1 committed Feb 1, 2024
1 parent 098b379 commit b3f0169
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 19 deletions.
23 changes: 14 additions & 9 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ name := "ciris-aws-secretsmanager"
organization := "io.github.keirlawson"
licenses += ("MIT", url("http://opensource.org/licenses/MIT"))

scalaVersion := "3.2.2"
crossScalaVersions := Seq(scalaVersion.value, "2.13.10", "2.12.17")
scalaVersion := "3.3.1"
crossScalaVersions := Seq(scalaVersion.value, "2.13.12", "2.12.18")
releaseCrossBuild := true

libraryDependencies ++= Seq(
"is.cir" %% "ciris" % "3.1.0",
"org.typelevel" %% "cats-core" % "2.9.0",
"org.typelevel" %% "cats-effect" % "3.4.8",
"software.amazon.awssdk" % "secretsmanager" % "2.22.3",
"org.typelevel" %% "munit-cats-effect-3" % "1.0.6" % Test
"is.cir" %% "ciris" % "3.5.0",
"org.typelevel" %% "cats-core" % "2.10.0",
"org.typelevel" %% "cats-effect" % "3.5.2",
"software.amazon.awssdk" % "secretsmanager" % "2.23.14",
"org.typelevel" %% "munit-cats-effect-3" % "1.0.7" % Test
)

publishTo := sonatypePublishToBundle.value
Expand All @@ -31,7 +31,12 @@ scmInfo := Some(
)
)
developers := List(
Developer(id="keirlawson", name="Keir Lawson", email="[email protected]", url=url("https://github.com/keirlawson/"))
Developer(
id = "keirlawson",
name = "Keir Lawson",
email = "[email protected]",
url = url("https://github.com/keirlawson/")
)
)

import ReleaseTransformations._
Expand All @@ -51,4 +56,4 @@ releaseProcess := Seq[ReleaseStep](
pushChanges
)

Compile / doc / sources := Nil
Compile / doc / sources := Nil
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.2.1")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.10.0")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.1.1")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.1.1")
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ To get started with [sbt](https://www.scala-sbt.org), simply add the following l

For Cats Effect 3:
```scala
libraryDependencies += "io.github.keirlawson" %% "ciris-aws-secretsmanager" % "6.0.2"
libraryDependencies += "io.github.keirlawson" %% "ciris-aws-secretsmanager" % "7.0.0"
```

The library is published for Scala 2.12, 2.13 and 3.1.
The library is published for Scala 2.12, 2.13 and 3.3.

### Example

Expand Down
5 changes: 3 additions & 2 deletions src/main/scala/ciris/aws/secretsmanager/SecretString.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ciris.aws.secretsmanager

import cats.effect.Async
import cats.implicits._
import ciris.{ConfigKey, ConfigValue, Secret}
import software.amazon.awssdk.services.secretsmanager.SecretsManagerAsyncClient
Expand All @@ -11,7 +12,7 @@ sealed abstract class SecretString[F[_]] {
}

private[secretsmanager] object SecretString {
final def apply[F[_]](client: SecretsManagerAsyncClient): SecretString[F] =
final def apply[F[_]: Async](client: SecretsManagerAsyncClient): SecretString[F] =
new SecretString[F] {
override final def apply(key: String): ConfigValue[F, Secret[String]] =
fetch(key, GetSecretValueRequest.builder().secretId(key).build())
Expand All @@ -23,7 +24,7 @@ private[secretsmanager] object SecretString {
key: String,
request: GetSecretValueRequest
): ConfigValue[F, Secret[String]] =
ConfigValue.async { cb =>
ConfigValue.async_ { cb =>
val configKey =
ConfigKey(s"secret string $key from AWS secrets manager")
client.getSecretValue(request).whenComplete { (resp, error) =>
Expand Down
13 changes: 8 additions & 5 deletions src/main/scala/ciris/aws/secretsmanager/package.scala
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
package ciris.aws

import cats.effect.Async
import cats.effect.kernel.{Resource, Sync}
import ciris.ConfigValue
import software.amazon.awssdk.auth.credentials.{AwsCredentialsProvider, DefaultCredentialsProvider}
import software.amazon.awssdk.services.secretsmanager.SecretsManagerAsyncClient
import software.amazon.awssdk.services.secretsmanager.SecretsManagerAsyncClientBuilder
import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider
import software.amazon.awssdk.services.secretsmanager.{
SecretsManagerAsyncClient,
SecretsManagerAsyncClientBuilder
}

package object secretsmanager {
def secrets[F[_]: Sync](
def secrets[F[_]: Async](
region: Region
): ConfigValue[F, SecretString[F]] =
secrets(
Expand All @@ -17,7 +20,7 @@ package object secretsmanager {
.credentialsProvider(DefaultCredentialsProvider.create())
)

def secrets[F[_]: Sync](
def secrets[F[_]: Async](
clientBuilder: SecretsManagerAsyncClientBuilder
): ConfigValue[F, SecretString[F]] =
ConfigValue.resource {
Expand Down

0 comments on commit b3f0169

Please sign in to comment.