Skip to content

Commit

Permalink
build: zio dependency updates (#1100)
Browse files Browse the repository at this point in the history
Signed-off-by: Hyperledger Bot <[email protected]>
Signed-off-by: Pat Losoponkul <[email protected]>
Co-authored-by: Hyperledger Bot <[email protected]>
Co-authored-by: Pat Losoponkul <[email protected]>
  • Loading branch information
3 people authored Aug 14, 2024
1 parent cfc4ccf commit 8b8d521
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 44 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ jobs:
name: "Build and unit tests"
runs-on: self-hosted
if: ${{ !contains(github.event.pull_request.title, '[skip ci]') }}
permissions:
checks: write
pull-requests: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
container:
Expand Down
10 changes: 5 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ lazy val V = new {
val munitZio = "0.2.0"

// https://mvnrepository.com/artifact/dev.zio/zio
val zio = "2.0.22"
val zioConfig = "4.0.1"
val zioLogging = "2.1.17"
val zio = "2.1.1"
val zioConfig = "4.0.2"
val zioLogging = "2.2.4"
val zioJson = "0.6.2"
val zioHttp = "3.0.0-RC6"
val zioHttp = "3.0.0-RC7"
val zioCatsInterop = "3.3.0" // TODO "23.1.0.2" // https://mvnrepository.com/artifact/dev.zio/zio-interop-cats
val zioMetricsConnector = "2.3.1"
val zioMock = "1.0.0-RC12"
Expand Down Expand Up @@ -79,7 +79,7 @@ lazy val V = new {
val scalaUri = "4.0.3"

val jwtCirceVersion = "9.4.6"
val zioPreludeVersion = "1.0.0-RC24"
val zioPreludeVersion = "1.0.0-RC26"

val apollo = "1.3.5"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,15 @@ import zio.http.Client

object SystemModule {

private val tmp: IO[Config.Error, AppConfig] =
val configLayer: ZLayer[Any, Config.Error, AppConfig] = ZLayer.fromZIO(
for {
ret: AppConfig <- TypesafeConfigProvider
.fromTypesafeConfig(ConfigFactory.load())
.load(AppConfig.config)
_ <- ZIO.log(s"HTTP server endpoint is setup as '${ret.agent.httpEndpoint.publicEndpointUrl}'")
_ <- ZIO.log(s"DIDComm server endpoint is setup as '${ret.agent.didCommEndpoint.publicEndpointUrl}'")
} yield ret

val configLayer = ZLayer.fromZIO(tmp)
)

val zioHttpClientLayer: ZLayer[Any, Throwable, Client] = {
import zio.http.netty.NettyConfig
Expand Down Expand Up @@ -232,36 +231,31 @@ object RepoModule {
}

val allSecretStorageLayer: TaskLayer[DIDSecretStorage & WalletSecretStorage & GenericSecretStorage] = {
ZLayer.fromZIO {
ZIO
.service[AppConfig]
.map(_.agent.secretStorage)
.tap(conf => ZIO.logInfo(s"Using '${conf.backend}' as a secret storage backend"))
.flatMap { conf =>
val useSemanticPath = conf.vault.map(_.useSemanticPath).getOrElse(true)
conf.backend match {
case SecretStorageBackend.vault =>
ZIO.succeed(
ZLayer.make[DIDSecretStorage & WalletSecretStorage & GenericSecretStorage](
VaultDIDSecretStorage.layer(useSemanticPath),
VaultGenericSecretStorage.layer(useSemanticPath),
VaultWalletSecretStorage.layer,
vaultClientLayer,
)
)
case SecretStorageBackend.postgres =>
ZIO.succeed(
ZLayer.make[DIDSecretStorage & WalletSecretStorage & GenericSecretStorage](
JdbcDIDSecretStorage.layer,
JdbcGenericSecretStorage.layer,
JdbcWalletSecretStorage.layer,
agentContextAwareTransactorLayer,
)
)
}
SystemModule.configLayer
.tap { config =>
val backend = config.get.agent.secretStorage.backend
ZIO.logInfo(s"Using '${backend}' as a secret storage backend")
}
.flatMap { config =>
val secretStorageConfig = config.get.agent.secretStorage
val useSemanticPath = secretStorageConfig.vault.map(_.useSemanticPath).getOrElse(true)
secretStorageConfig.backend match {
case SecretStorageBackend.vault =>
ZLayer.make[DIDSecretStorage & WalletSecretStorage & GenericSecretStorage](
VaultDIDSecretStorage.layer(useSemanticPath),
VaultGenericSecretStorage.layer(useSemanticPath),
VaultWalletSecretStorage.layer,
vaultClientLayer,
)
case SecretStorageBackend.postgres =>
ZLayer.make[DIDSecretStorage & WalletSecretStorage & GenericSecretStorage](
JdbcDIDSecretStorage.layer,
JdbcGenericSecretStorage.layer,
JdbcWalletSecretStorage.layer,
agentContextAwareTransactorLayer,
)
}
.provide(SystemModule.configLayer)
}.flatten
}
}

}
7 changes: 7 additions & 0 deletions examples/st-multi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Configuration

| Exposed Service | Description |
|------------------------------|----------------------------------------|
| `localhost:8080/cloud-agent` | Single-tenant Cloud Agent#1 (issuer) |
| `localhost:8081/cloud-agent` | Single-tenant Cloud Agent#2 (holder) |
| `localhost:8082/cloud-agent` | Single-tenant Cloud Agent#3 (verifier) |
7 changes: 0 additions & 7 deletions examples/st-multi/README.me

This file was deleted.

0 comments on commit 8b8d521

Please sign in to comment.