From aca313c31a82c4e407260ba7d0d155b982f822ec Mon Sep 17 00:00:00 2001 From: atala-dev <57987237+atala-dev@users.noreply.github.com> Date: Mon, 2 Oct 2023 10:50:49 +0100 Subject: [PATCH 1/7] Update sbt to 1.9.6 in main (#122) --- project/build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/build.properties b/project/build.properties index e2e1cd84..dde206f7 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.3 \ No newline at end of file +sbt.version=1.9.6 \ No newline at end of file From 876b7f5fb21fd338db13fb915d92d73e4ea03f00 Mon Sep 17 00:00:00 2001 From: atala-dev <57987237+atala-dev@users.noreply.github.com> Date: Mon, 2 Oct 2023 10:51:12 +0100 Subject: [PATCH 2/7] Update sbt-scalafix to 0.11.1 in main (#115) --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 246ff91d..b02abc2d 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -48,7 +48,7 @@ addSbtPlugin("io.spray" % "sbt-revolver" % "0.10.0") // https://zio.dev/howto/migrate/zio-2.x-migration-guide%20v0.9.31 //sbt "scalafixEnable; scalafixAll github:zio/zio/Zio2Upgrade?sha=series/2.x" -addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.11.0") +addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.11.1") // Deploy demo addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.1.1") From af86c1ff558ce9a473d1cd84257f537e89aaadf6 Mon Sep 17 00:00:00 2001 From: atala-dev <57987237+atala-dev@users.noreply.github.com> Date: Mon, 2 Oct 2023 10:51:33 +0100 Subject: [PATCH 3/7] Update sbt-converter to 1.0.0-beta43 in main (#129) --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index b02abc2d..70aed8ee 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -32,7 +32,7 @@ addSbtPlugin("ch.epfl.scala" % "sbt-web-scalajs-bundler" % "0.21.1") //https://github.com/ScalablyTyped/Converter/releases resolvers += Resolver.bintrayRepo("oyvindberg", "converter") resolvers += MavenRepository("sonatype-s01-snapshots", "https://s01.oss.sonatype.org/content/repositories/snapshots") -addSbtPlugin("org.scalablytyped.converter" % "sbt-converter" % "1.0.0-beta42") +addSbtPlugin("org.scalablytyped.converter" % "sbt-converter" % "1.0.0-beta43") // Utils Buildinfo addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0") From 0a8fe29103384ba624fce4c6078a647df4378135 Mon Sep 17 00:00:00 2001 From: atala-dev <57987237+atala-dev@users.noreply.github.com> Date: Mon, 2 Oct 2023 10:51:59 +0100 Subject: [PATCH 4/7] Update sbt-assembly to 2.1.3 in main (#127) --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 70aed8ee..c1dee538 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -51,7 +51,7 @@ addSbtPlugin("io.spray" % "sbt-revolver" % "0.10.0") addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.11.1") // Deploy demo -addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.1.1") +addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.1.3") addSbtPlugin("com.typesafe.sbt" % "sbt-gzip" % "1.0.2") // Release From 17b797559e5ef54b87aa69cd17ddddcd3335d7ca Mon Sep 17 00:00:00 2001 From: Fabio Pinheiro Date: Tue, 3 Oct 2023 15:39:12 +0100 Subject: [PATCH 5/7] doc: Add Badges (#132) doc: Add Badges Add invitation link to discord Update README.md Signed-off-by: Pete Vielhaber <95773776+petevielhaber@users.noreply.github.com> Co-authored-by: Pete Vielhaber <95773776+petevielhaber@users.noreply.github.com> --- README.md | 50 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index bd657938..3c935277 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,12 @@ -# Atala Prism Mediator (DIDCOMM v2) +| Live Demo | Discord | Atala PRISM Website | +| ------------------------------ | ------------------------------ | -----------------------------| +|[![Atala-Symbol]][Link-LiveDemo]|[![Badge-Discord]][Link-Discord]|[![Atala-Favicon]][Link-Atala]| + +| CI | Project Stage | Commits since latest release | +| ------------- | -------------- | -------------------------------- | +|![CI][Badge-CI]| ![Badge-Stage] |![Badge-CommitsSinceLatestRelease]| + +# Atala Mediator A DID Comm v2 mediator A service that receives messages for many agents at a single endpoint and stores them with privacy. @@ -13,6 +21,12 @@ graph LR - **CI** automate builds and tests all push to the main branch also as all PRs created. - **Scala Steward** automates the creation of pull requests for libraries with updated dependencies, saving maintainers time and effort. It can also help ensure that libraries are kept up-to-date, improving their reliability and performance. +--- + +**#atala-mediator on Discord:** + +For the fastest answers, join the [#atala-mediator][Link-Discord-Mediator] channel in the official Atala Discord and ask your questions, or just chat with other Atala developers and pioneers! + # Table of contents: - [Mediator Purpose](#Description) @@ -69,13 +83,13 @@ The mediator is especially useful when the edge entities are not always online, - [DONE] `Report Problem 2.0` https://didcomm.org/report-problem/2.0/ -# Pre-reqs +### Pre-reqs To build and run this mediator, locally you will need a few things: - Install [Docker](https://docs.docker.com/get-docker/) - Install [SBT](https://www.scala-sbt.org/download.html) -# Getting started +## Getting started This DIDComm Mediator comprises two elements: a backend service and a database. The backend service is a JVM application, and the database used is MongoDB. The backend service is also a web service with a single-page application that will give the final user an invitation page @@ -98,7 +112,7 @@ By default mediator will start on port 8080 You can open the `http://localhost:8080/` URL in a web browser, and it will show a QR code that serves as an out-of-band invitation for the Mediator. ## How to run mediator as docker image -# Docker only +### Docker only It is possible to run everything with a single command with Docker compose docker-compose.yml The latest stable image version is available in the IOHK repositories. To build a docker image locally, run NODE_OPTIONS=--openssl-legacy-provider sbt docker:publishLocal. @@ -114,7 +128,7 @@ The default configuration is set up [application.conf](/mediator/src/main/resour So in order to configure the mediator for your needs. You can either change the default configuration or you can set up environment variables that overrides the defaults: -# identity +#### identity To set up the mediator identity: - `KEY_AGREEMENT_D` - is the key agreement private key (MUST be a X25519 OKP key type). - `KEY_AGREEMENT_X` - is the key agreement public key (MUST be a X25519 OKP key type). @@ -122,7 +136,7 @@ To set up the mediator identity: - `KEY_AUTHENTICATION_X` - is the key authentication public key (MUST be an Ed25519 OKP key type). - `SERVICE_ENDPOINT` - is the endpoint of the mediator. Where the mediator will be listening to incoming DID Comm messages. -# mediator-storage +#### mediator-storage To set up the mediator storage (MongoDB): - `MONGODB_PROTOCOL` - is the protocol type used by mongo. - `MONGODB_HOST` - is the endpoint where the MongoDB will be listening. @@ -147,12 +161,30 @@ For a specific version you can setup with `MEDIATOR_VERSION` like `MEDIATOR_VERS Using the mongodb from cloud like MongoDB Atlas. You will need to create the table and indexes before starting the backend service. See the file `initdb.js`. -### Deploy +## Deploy You can easily deploy the image everywhere. We recommend a minimum of 250 mb ram to run the mediator backend service. -# mediator-tests +## mediator-tests https://github.com/input-output-hk/didcomm-v2-mediator-test-suite https://input-output-hk.github.io/didcomm-v2-mediator-test-suite/Reports.html -- [LICENSE](LICENSE) - Apache License, Version 2.0 \ No newline at end of file + +--- +[LICENSE](LICENSE) - Apache License, Version 2.0 + + +[Link-LiveDemo]:https://beta-mediator.atalaprism.io/ +[Link-Atala]:https://atalaprism.io/ +[Link-Discord]:https://discord.gg/UpxKYK2s +[Link-Discord-Mediator]:https://discord.gg/S7FZEwqe + +[Badge-Stage]: https://img.shields.io/badge/0.9.2-Production%20Ready-brightgreen.svg +[Badge-Discord]: https://img.shields.io/discord/1146426895114702858?logo=discord "chat on discord" +[Badge-CI]: https://github.com/input-output-hk/atala-prism-mediator/workflows/CI/badge.svg +[Badge-CommitsSinceLatestRelease]: https://img.shields.io/github/commits-since/input-output-hk/atala-prism-mediator/prism-mediator-v0.9.2/main?logo=github + + +[Atala-Sym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MC4yOCwxMzguMDZjLTMuMDksNS4zMiwuNzMsMTEuOTksNi44OCwxMi4wMloiLz48cGF0aCBpZD0iRmlsbC00IiBjbGFzcz0iY2xzLTIiIGQ9Ik0yMjYuMjQsMzA5LjlsNS41MSw5LjUyYzMuMDgsNS4zMiwxMC43NSw1LjMyLDEzLjg0LC4wMWw2NS4zOS0xMTIuNDVjMy4wOS01LjMyLS43My0xMS45OS02Ljg4LTEyLjAybC0xMS4wMi0uMDRjLTIuODYtLjAxLTUuNTEsMS41MS02Ljk1LDMuOThsLTU5Ljg4LDEwMi45N2MtMS40NCwyLjQ4LTEuNDUsNS41NCwwLDguMDNaIi8+PGcgaWQ9IkZpbGwtNSI+PHBhdGggY2xhc3M9ImNscy0yIiBkPSJNMjc0Ljk1LDM3MC41OGwxOS41LTMzLjU0YzEuNDQtMi40NywxLjQ1LTUuNTIsLjAyLThsLTUuNDktOS41NmMtMy4wNi01LjM0LTEwLjc2LTUuMzYtMTMuODUtLjA0bC0xOS41MiwzMy41OGMtMS40NCwyLjQ4LTEuNDUsNS41NCwwLDguMDNsNS41MSw5LjUyYzMuMDgsNS4zMiwxMC43NSw1LjMyLDEzLjg0LC4wMVoiLz48L2c+PHBhdGggaWQ9IkZpbGwtNiIgY2xhc3M9ImNscy0yIiBkPSJNMzYzLjEyLDE5NS4xNWwtMTEtLjA4Yy0yLjg3LS4wMi01LjUzLDEuNS02Ljk3LDMuOThsLTU2LjA5LDk2LjQ2Yy0zLjA5LDUuMzIsLjczLDEyLDYuODgsMTIuMDJsMTEuMDIsLjA0YzIuODYsLjAxLDUuNTEtMS41MSw2Ljk0LTMuOThsNTYuMDctOTYuNDJjMy4wOS01LjMxLS43MS0xMS45Ny02Ljg2LTEyLjAyWiIvPjwvZz48L2c+PC9nPjwvc3ZnPg== From 56d34f9ebfee74b71a644b35761861fe49515861 Mon Sep 17 00:00:00 2001 From: Shailesh Patil <53746241+mineme0110@users.noreply.github.com> Date: Wed, 4 Oct 2023 12:32:06 +0100 Subject: [PATCH 6/7] fix: OutOfBand qrcode with base url (#133) * fix: OutOfBand qrcode with base url Signed-off-by: Shailesh Patil * flaky test fix moving the affect to zio Signed-off-by: Shailesh Patil --------- Signed-off-by: Shailesh Patil --- .../mediator/db/EmbeddedMongoDBInstance.scala | 8 +------ .../mediator/db/UserAccountRepoSpec.scala | 4 +++- .../ForwardMessageExecutorSpec.scala | 9 +------ .../MediatorCoordinationExecuterSpec.scala | 13 ---------- .../mediator/protocols/MessageSetup.scala | 24 +++++++++++++++++++ .../protocols/PickupExecuterSpec.scala | 13 ---------- .../io/iohk/atala/mediator/MediatorInfo.scala | 7 ++++-- 7 files changed, 34 insertions(+), 44 deletions(-) diff --git a/mediator/src/test/scala/io/iohk/atala/mediator/db/EmbeddedMongoDBInstance.scala b/mediator/src/test/scala/io/iohk/atala/mediator/db/EmbeddedMongoDBInstance.scala index 422c4a5d..1b4cd1d3 100644 --- a/mediator/src/test/scala/io/iohk/atala/mediator/db/EmbeddedMongoDBInstance.scala +++ b/mediator/src/test/scala/io/iohk/atala/mediator/db/EmbeddedMongoDBInstance.scala @@ -12,13 +12,7 @@ object EmbeddedMongoDBInstance { val port = 27777 val hostIp = "localhost" val connectionString = s"mongodb://$hostIp:$port/messages" - val index = Index( - key = Seq("alias" -> IndexType.Ascending), - name = Some("alias_did"), - unique = true, - background = true, - partialFilter = Some(BSONDocument("alias.0" -> BSONDocument("$exists" -> true))) - ) + def layer( port: Int = 27077, hostIp: String = "localhost" diff --git a/mediator/src/test/scala/io/iohk/atala/mediator/db/UserAccountRepoSpec.scala b/mediator/src/test/scala/io/iohk/atala/mediator/db/UserAccountRepoSpec.scala index a6252522..6c748d8b 100644 --- a/mediator/src/test/scala/io/iohk/atala/mediator/db/UserAccountRepoSpec.scala +++ b/mediator/src/test/scala/io/iohk/atala/mediator/db/UserAccountRepoSpec.scala @@ -10,8 +10,10 @@ import zio.json.* import zio.test.* import zio.test.Assertion.* import io.iohk.atala.mediator.db.EmbeddedMongoDBInstance.* +import io.iohk.atala.mediator.protocols.MessageSetup + import scala.concurrent.ExecutionContext.Implicits.global -object UserAccountRepoSpec extends ZIOSpecDefault with DidAccountStubSetup { +object UserAccountRepoSpec extends ZIOSpecDefault with DidAccountStubSetup with MessageSetup { override def spec = suite("UserAccountRepoSpec")( test("insert new Did Account") { diff --git a/mediator/src/test/scala/io/iohk/atala/mediator/protocols/ForwardMessageExecutorSpec.scala b/mediator/src/test/scala/io/iohk/atala/mediator/protocols/ForwardMessageExecutorSpec.scala index c692b20c..07129cb9 100644 --- a/mediator/src/test/scala/io/iohk/atala/mediator/protocols/ForwardMessageExecutorSpec.scala +++ b/mediator/src/test/scala/io/iohk/atala/mediator/protocols/ForwardMessageExecutorSpec.scala @@ -66,14 +66,7 @@ object ForwardMessageExecutorSpec extends ZIOSpecDefault with DidAccountStubSetu .provideSomeLayer(AgentStub.agentLayer) .provideLayerShared(dataAccessLayer) @@ TestAspect.sequential - def setupAndClean = { - for { - userAccount <- ZIO.service[UserAccountRepo] - col <- userAccount.collection - _ = col.indexesManager.create(index) - _ = col.delete.one(BSONDocument()) - } yield {} - } + val dataAccessLayer = EmbeddedMongoDBInstance.layer(port, hostIp) >>> AsyncDriverResource.layer diff --git a/mediator/src/test/scala/io/iohk/atala/mediator/protocols/MediatorCoordinationExecuterSpec.scala b/mediator/src/test/scala/io/iohk/atala/mediator/protocols/MediatorCoordinationExecuterSpec.scala index 13065ef5..25367fc6 100644 --- a/mediator/src/test/scala/io/iohk/atala/mediator/protocols/MediatorCoordinationExecuterSpec.scala +++ b/mediator/src/test/scala/io/iohk/atala/mediator/protocols/MediatorCoordinationExecuterSpec.scala @@ -129,19 +129,6 @@ object MediatorCoordinationExecuterSpec extends ZIOSpecDefault with DidAccountSt .provideLayerShared(dataAccessLayer) @@ TestAspect.sequential } - def setupAndClean = { - for { - userAccount <- ZIO.service[UserAccountRepo] - col <- userAccount.collection - _ <- ZIO.fromFuture { implicit ec => - col.indexesManager.create(index) - } - _ <- ZIO.fromFuture { implicit ec => - col.delete.one(BSONDocument()) - } - } yield {} - } - val dataAccessLayer = EmbeddedMongoDBInstance.layer(port, hostIp) >>> AsyncDriverResource.layer >>> ReactiveMongoApi.layer(connectionString) diff --git a/mediator/src/test/scala/io/iohk/atala/mediator/protocols/MessageSetup.scala b/mediator/src/test/scala/io/iohk/atala/mediator/protocols/MessageSetup.scala index 65fc17a9..0174687c 100644 --- a/mediator/src/test/scala/io/iohk/atala/mediator/protocols/MessageSetup.scala +++ b/mediator/src/test/scala/io/iohk/atala/mediator/protocols/MessageSetup.scala @@ -1,9 +1,33 @@ package io.iohk.atala.mediator.protocols import fmgp.did.comm.{EncryptedMessage, PlaintextMessage} +import io.iohk.atala.mediator.db.UserAccountRepo +import reactivemongo.api.bson.BSONDocument +import zio.ZIO import zio.json.* +import reactivemongo.api.indexes.{Index, IndexType} trait MessageSetup { + val index = Index( + key = Seq("alias" -> IndexType.Ascending), + name = Some("alias_did"), + unique = true, + background = true, + partialFilter = Some(BSONDocument("alias.0" -> BSONDocument("$exists" -> true))) + ) + def setupAndClean = { + for { + userAccount <- ZIO.service[UserAccountRepo] + col <- userAccount.collection + _ <- ZIO.fromFuture { implicit ec => + col.indexesManager.create(index) + } + _ <- ZIO.fromFuture { implicit ec => + col.delete.one(BSONDocument()) + } + } yield {} + } + val mediatorDid = "did:peer:2.Ez6LSkGy3e2z54uP4U9HyXJXRpaF2ytsnTuVgh6SNNmCyGZQZ.Vz6Mkjdwvf9hWc6ibZndW9B97si92DSk9hWAhGYBgP9kUFk8Z.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9ib2IuZGlkLmZtZ3AuYXBwLyIsInIiOltdLCJhIjpbImRpZGNvbW0vdjIiXX0" val plaintextForwardNotEnrolledDidMessage: Either[String, PlaintextMessage] = diff --git a/mediator/src/test/scala/io/iohk/atala/mediator/protocols/PickupExecuterSpec.scala b/mediator/src/test/scala/io/iohk/atala/mediator/protocols/PickupExecuterSpec.scala index ad87a269..47b562f8 100644 --- a/mediator/src/test/scala/io/iohk/atala/mediator/protocols/PickupExecuterSpec.scala +++ b/mediator/src/test/scala/io/iohk/atala/mediator/protocols/PickupExecuterSpec.scala @@ -156,19 +156,6 @@ object PickupExecuterSpec extends ZIOSpecDefault with DidAccountStubSetup with M .provideLayerShared(dataAccessLayer) @@ TestAspect.sequential } - def setupAndClean = { - for { - userAccount <- ZIO.service[UserAccountRepo] - col <- userAccount.collection - _ <- ZIO.fromFuture { implicit ec => - col.indexesManager.create(index) - } - _ <- ZIO.fromFuture { implicit ec => - col.delete.one(BSONDocument()) - } - } yield {} - } - val dataAccessLayer = EmbeddedMongoDBInstance.layer(port, hostIp) >>> AsyncDriverResource.layer >>> ReactiveMongoApi.layer(connectionString) diff --git a/webapp/src/main/scala/io/iohk/atala/mediator/MediatorInfo.scala b/webapp/src/main/scala/io/iohk/atala/mediator/MediatorInfo.scala index 9bf77dd9..b5e46041 100644 --- a/webapp/src/main/scala/io/iohk/atala/mediator/MediatorInfo.scala +++ b/webapp/src/main/scala/io/iohk/atala/mediator/MediatorInfo.scala @@ -17,7 +17,10 @@ object MediatorInfo { goal = Some("RequestMediate"), accept = Some(Seq("didcomm/v2")), ) - val qrCodeData = OutOfBandPlaintext.from(invitation.toPlaintextMessage).makeURI("#/") + val host = dom.window.location.host + val scheme = dom.window.location.protocol + val fullPath = s"${scheme}//${host}" + val qrCodeData = OutOfBandPlaintext.from(invitation.toPlaintextMessage).makeURI(s"$fullPath") val divQRCode = div() { @@ -35,7 +38,7 @@ object MediatorInfo { code(invitation.from.value), ), h3("Plaintext out of band invitation:"), - p(a(href := qrCodeData, target := "_blank", code(qrCodeData))), // FIXME make it a link to the mobile app + p(a(href := fullPath, target := "_blank", code(qrCodeData))), // FIXME make it a link to the mobile app pre(code(invitation.toPlaintextMessage.toJsonPretty)), p( "To facilitate the integration with other systems you can get the plain text invitation and the out-of-band invitation on the following endpoints:", From 82f902f625246f0c1d0e06db096022e024c879c0 Mon Sep 17 00:00:00 2001 From: Milos Dzepina Date: Wed, 4 Oct 2023 15:34:44 +0200 Subject: [PATCH 7/7] fix(infra): add sync-wave to certificate template (#134) Signed-off-by: Milos Dzepina --- infrastructure/charts/mediator/templates/certificate.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/infrastructure/charts/mediator/templates/certificate.yaml b/infrastructure/charts/mediator/templates/certificate.yaml index 3c25e325..3282235a 100644 --- a/infrastructure/charts/mediator/templates/certificate.yaml +++ b/infrastructure/charts/mediator/templates/certificate.yaml @@ -6,6 +6,8 @@ metadata: namespace: "{{ .Release.Namespace }}" labels: {{ template "labels.common" . }} + annotations: + argocd.argoproj.io/sync-wave: "-1" spec: secretName: "prism-mediator-base-path-secret" duration: 2160h0m0s # 90d