Skip to content

Commit

Permalink
feat: mediator added test for storage layer (#13)
Browse files Browse the repository at this point in the history
* feat: mediator added test for the mongo repo layer

* caching updated the version

Signed-off-by: Shailesh Patil <[email protected]>

Signed-off-by: Shailesh Patil <[email protected]>
  • Loading branch information
mineme0110 committed May 1, 2024
1 parent 594081c commit 969f50c
Show file tree
Hide file tree
Showing 12 changed files with 313 additions and 29 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ jobs:
# uses: japgolly/setup-scalajs@v1
- name: Cache sbt
uses: coursier/[email protected]
- name: Cache embedmongo
uses: actions/cache@v2
with:
path: ~/.embedmongo
key: ${{ runner.os }}-embedmongo-4.7.0
restore-keys: |
${{ runner.os }}-embedmongo-4.7.0
### Compile and TESTS ###
- run: sbt -mem 2048 -J-Xmx5120m "test"
# env:
Expand Down
21 changes: 21 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ lazy val V = new {
val zioConfig = "4.0.0-RC16"
val zioSl4j = "2.1.13"
val mongo = "1.1.0-RC10"
val embedMongo = "4.7.0"
val munitZio = "0.1.1"
val zioTest = "2.0.5"
val zioTestSbt = "2.0.5"
val zioTestMagnolia = "2.0.5"

}

/** Dependencies */
Expand Down Expand Up @@ -57,6 +63,12 @@ lazy val D = new {
val mongo = Def.setting("org.reactivemongo" %% "reactivemongo" % V.mongo)
// // For munit https://scalameta.org/munit/docs/getting-started.html#scalajs-setup
val munit = Def.setting("org.scalameta" %%% "munit" % V.munit % Test)
val embedMongo = Def.setting("de.flapdoodle.embed" % "de.flapdoodle.embed.mongo" % V.embedMongo % Test)
// For munit zio https://github.com/poslegm/munit-zio
val munitZio = Def.setting("com.github.poslegm" %% "munit-zio" % V.munitZio % Test)
val zioTest = Def.setting("dev.zio" %% "zio-test" % V.zioTest % Test)
val zioTestSbt = Def.setting("dev.zio" %% "zio-test-sbt" % V.zioTestSbt % Test)
val zioTestMagnolia = Def.setting("dev.zio" %% "zio-test-magnolia" % V.zioTestMagnolia % Test)
}

inThisBuild(
Expand Down Expand Up @@ -163,6 +175,14 @@ lazy val mediator = project
D.zioLoggingSl4j.value
),
libraryDependencies += D.mongo.value,
libraryDependencies ++= Seq(
D.munit.value,
D.embedMongo.value,
D.zioTest.value,
D.zioTestSbt.value,
D.zioTestMagnolia.value,
),
testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework")
)
.settings(
Compile / mainClass := Some("io.iohk.atala.mediator.app.MediatorStandalone"),
Expand All @@ -172,6 +192,7 @@ lazy val mediator = project
dockerExposedPorts := Seq(8080),
dockerBaseImage := "openjdk:11",
)
.settings(Test / parallelExecution := false)
.dependsOn(httpUtils.jvm) // did, didExample,
.enablePlugins(JavaAppPackaging, DockerPlugin)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ case class MediatorAgent(
// val resolverLayer: ULayer[DynamicResolver] =
// DynamicResolver.resolverLayer(didSocketManager)

type Services = Resolver & Agent & Operations & MessageDispatcher & DidAccountRepo & MessageItemRepo
val protocolHandlerLayer: URLayer[DidAccountRepo & MessageItemRepo, ProtocolExecuter[Services]] =
type Services = Resolver & Agent & Operations & MessageDispatcher & UserAccountRepo & MessageItemRepo
val protocolHandlerLayer: URLayer[UserAccountRepo & MessageItemRepo, ProtocolExecuter[Services]] =
ZLayer.succeed(
ProtocolExecuterCollection[Services](
BasicMessageExecuter,
Expand Down Expand Up @@ -89,7 +89,7 @@ case class MediatorAgent(
data: String,
mSocketID: Option[SocketID],
): ZIO[
Operations & Resolver & MessageDispatcher & MediatorAgent & MessageItemRepo & DidAccountRepo,
Operations & Resolver & MessageDispatcher & MediatorAgent & MessageItemRepo & UserAccountRepo,
MediatorError,
Option[EncryptedMessage]
] =
Expand All @@ -110,7 +110,7 @@ case class MediatorAgent(
msg: EncryptedMessage,
mSocketID: Option[SocketID]
): ZIO[
Operations & Resolver & MessageDispatcher & MediatorAgent & MessageItemRepo & DidAccountRepo,
Operations & Resolver & MessageDispatcher & MediatorAgent & MessageItemRepo & UserAccountRepo,
MediatorError,
Option[EncryptedMessage]
] =
Expand Down Expand Up @@ -150,7 +150,7 @@ case class MediatorAgent(
def createSocketApp(
annotationMap: Seq[LogAnnotation]
): ZIO[
MediatorAgent & Resolver & Operations & MessageDispatcher & MessageItemRepo & DidAccountRepo,
MediatorAgent & Resolver & Operations & MessageDispatcher & MessageItemRepo & UserAccountRepo,
Nothing,
zio.http.Response
] = {
Expand Down Expand Up @@ -255,7 +255,7 @@ object MediatorAgent {
.copy(status = Status.BadRequest)
)
}: Http[
Operations & Resolver & MessageDispatcher & MediatorAgent & MessageItemRepo & DidAccountRepo,
Operations & Resolver & MessageDispatcher & MediatorAgent & MessageItemRepo & UserAccountRepo,
Throwable,
Request,
Response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ case class DataBaseConfig(
object MediatorStandalone extends ZIOAppDefault {

val app: HttpApp[ // type HttpApp[-R, +Err] = Http[R, Err, Request, Response]
Hub[String] & Operations & MessageDispatcher & MediatorAgent & Resolver & MessageItemRepo & DidAccountRepo,
Hub[String] & Operations & MessageDispatcher & MediatorAgent & Resolver & MessageItemRepo & UserAccountRepo,
Throwable
] = MediatorAgent.didCommApp
++ Http
Expand Down Expand Up @@ -104,7 +104,7 @@ object MediatorStandalone extends ZIOAppDefault {
.provideSomeLayer(
AsyncDriverResource.layer
>>> ReactiveMongoApi.layer(mediatorDbConfig.connectionString)
>>> MessageItemRepo.layer.and(DidAccountRepo.layer)
>>> MessageItemRepo.layer.and(UserAccountRepo.layer)
)
.provideSomeLayer(Operations.layerDefault)
.provideSomeLayer(client >>> MessageDispatcherJVM.layer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ import zio.*

import scala.concurrent.ExecutionContext

object DidAccountRepo {
def layer: ZLayer[ReactiveMongoApi, Throwable, DidAccountRepo] =
object UserAccountRepo {
def layer: ZLayer[ReactiveMongoApi, Throwable, UserAccountRepo] =
ZLayer {
for {
ref <- ZIO.service[ReactiveMongoApi]
} yield DidAccountRepo(ref)(using scala.concurrent.ExecutionContext.global)
} yield UserAccountRepo(ref)(using scala.concurrent.ExecutionContext.global)
}
}

class DidAccountRepo(reactiveMongoApi: ReactiveMongoApi)(using ec: ExecutionContext) {
class UserAccountRepo(reactiveMongoApi: ReactiveMongoApi)(using ec: ExecutionContext) {
def collectionName: String = "user.account"

def collection: IO[StorageCollection, BSONCollection] = reactiveMongoApi.database
.map(_.collection(collectionName))
.mapError(ex => StorageCollection(ex))

def newDidAccount(did: DIDSubject /*, alias: Seq[DID] = Seq.empty*/ ): IO[StorageError, WriteResult] = {
def newDidAccount(did: DIDSubject): IO[StorageError, WriteResult] = {
val value = DidAccount(
did = did,
alias = Seq(did),
Expand Down Expand Up @@ -96,7 +96,7 @@ class DidAccountRepo(reactiveMongoApi: ReactiveMongoApi)(using ec: ExecutionCont
}

/** @return
* numbre of documents updated in DB
* number of documents updated in DB
*/
def addToInboxes(recipients: Set[DIDSubject], msg: EncryptedMessage): ZIO[Any, StorageError, Int] = {
def selector =
Expand Down Expand Up @@ -135,8 +135,8 @@ class DidAccountRepo(reactiveMongoApi: ReactiveMongoApi)(using ec: ExecutionCont
} yield result.nModified
}

def makeAsDelivered(didAccount: DIDSubject, hashs: Seq[HASH]): ZIO[Any, StorageError, Int] = {
def selector = BSONDocument("did" -> didAccount.did, "messagesRef.hash" -> BSONDocument("$in" -> hashs))
def markAsDelivered(didAccount: DIDSubject, hashes: Seq[HASH]): ZIO[Any, StorageError, Int] = {
def selector = BSONDocument("did" -> didAccount.did, "messagesRef.hash" -> BSONDocument("$in" -> hashes))
def update: BSONDocument = BSONDocument("$set" -> BSONDocument("messagesRef.$.state" -> true))

for {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import zio.json.*

object ForwardMessageExecuter
extends ProtocolExecuterWithServices[
ProtocolExecuter.Services & DidAccountRepo & MessageItemRepo
ProtocolExecuter.Services & UserAccountRepo & MessageItemRepo
] {

override def suportedPIURI: Seq[PIURI] = Seq(ForwardMessage.piuri)

override def program[R1 <: DidAccountRepo & MessageItemRepo](
override def program[R1 <: UserAccountRepo & MessageItemRepo](
plaintextMessage: PlaintextMessage
): ZIO[R1, MediatorError, Action] = {
// the val is from the match to be definitely stable
Expand All @@ -30,7 +30,7 @@ object ForwardMessageExecuter
for {
_ <- ZIO.logInfo("ForwardMessage")
repoMessageItem <- ZIO.service[MessageItemRepo]
repoDidAccount <- ZIO.service[DidAccountRepo]
repoDidAccount <- ZIO.service[UserAccountRepo]
recipientsSubject = Set(m.next) // m.msg.recipientsSubject
numbreOfUpdated <- repoDidAccount.addToInboxes(recipientsSubject, m.msg)
msg <-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import fmgp.did.comm.protocol.*
import fmgp.did.comm.protocol.mediatorcoordination2.*
import io.iohk.atala.mediator.*
import io.iohk.atala.mediator.actions.*
import io.iohk.atala.mediator.db.DidAccountRepo
import io.iohk.atala.mediator.db.UserAccountRepo
import zio.*
import zio.json.*
object MediatorCoordinationExecuter extends ProtocolExecuterWithServices[ProtocolExecuter.Services & DidAccountRepo] {
object MediatorCoordinationExecuter extends ProtocolExecuterWithServices[ProtocolExecuter.Services & UserAccountRepo] {

override def suportedPIURI: Seq[PIURI] = Seq(
MediateRequest.piuri,
Expand All @@ -23,7 +23,7 @@ object MediatorCoordinationExecuter extends ProtocolExecuterWithServices[Protoco
Keylist.piuri,
)

override def program[R1 <: (DidAccountRepo)](
override def program[R1 <: (UserAccountRepo)](
plaintextMessage: PlaintextMessage
): ZIO[R1, MediatorError, Action] = {
// the val is from the match to be definitely stable
Expand All @@ -49,7 +49,7 @@ object MediatorCoordinationExecuter extends ProtocolExecuterWithServices[Protoco
case m: MediateRequest =>
for {
_ <- ZIO.logInfo("MediateRequest")
repo <- ZIO.service[DidAccountRepo]
repo <- ZIO.service[UserAccountRepo]
result <- repo.newDidAccount(m.from.asDIDURL.toDID)
reply = result.n match
case 1 => m.makeRespondMediateGrant.toPlaintextMessage
Expand All @@ -58,7 +58,7 @@ object MediatorCoordinationExecuter extends ProtocolExecuterWithServices[Protoco
case m: KeylistUpdate =>
for {
_ <- ZIO.logInfo("KeylistUpdate")
repo <- ZIO.service[DidAccountRepo]
repo <- ZIO.service[UserAccountRepo]
updateResponse <- ZIO.foreach(m.updates) {
case (fromto, KeylistAction.add) =>
repo.addAlias(m.from.toDID, fromto.toDID).map {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import io.iohk.atala.mediator.db.*
import zio.*
import zio.json.*
object PickupExecuter
extends ProtocolExecuterWithServices[ProtocolExecuter.Services & DidAccountRepo & MessageItemRepo] {
extends ProtocolExecuterWithServices[ProtocolExecuter.Services & UserAccountRepo & MessageItemRepo] {

override def suportedPIURI: Seq[PIURI] = Seq(
StatusRequest.piuri,
Expand All @@ -23,7 +23,7 @@ object PickupExecuter
LiveModeChange.piuri,
)

override def program[R1 <: DidAccountRepo & MessageItemRepo](
override def program[R1 <: UserAccountRepo & MessageItemRepo](
plaintextMessage: PlaintextMessage
): ZIO[R1, MediatorError, Action] = {
// the val is from the match to be definitely stable
Expand All @@ -48,7 +48,7 @@ object PickupExecuter
for {
_ <- ZIO.logInfo("DeliveryRequest")
repoMessageItem <- ZIO.service[MessageItemRepo]
repoDidAccount <- ZIO.service[DidAccountRepo]
repoDidAccount <- ZIO.service[UserAccountRepo]
didRequestingMessages = m.from.asFROMTO
mDidAccount <- repoDidAccount.getDidAccount(didRequestingMessages.toDID)
msgHash = mDidAccount match
Expand Down Expand Up @@ -87,9 +87,9 @@ object PickupExecuter
case m: MessagesReceived =>
for {
_ <- ZIO.logInfo("MessagesReceived")
repoDidAccount <- ZIO.service[DidAccountRepo]
repoDidAccount <- ZIO.service[UserAccountRepo]
didRequestingMessages = m.from.asFROMTO
mDidAccount <- repoDidAccount.makeAsDelivered(
mDidAccount <- repoDidAccount.markAsDelivered(
didRequestingMessages.toDID,
m.message_id_list.map(e => e.toInt) // TODO have it safe 'toInt'
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package io.iohk.atala.mediator.db
import fmgp.did.comm.EncryptedMessage
import zio.json.*
trait AccountStubSetup {
val alice =
"did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9hbGljZS5kaWQuZm1ncC5hcHAvIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ"
val bob =
"did:peer:2.Ez6LSkGy3e2z54uP4U9HyXJXRpaF2ytsnTuVgh6SNNmCyGZQZ.Vz6Mkjdwvf9hWc6ibZndW9B97si92DSk9hWAhGYBgP9kUFk8Z.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9ib2IuZGlkLmZtZ3AuYXBwLyIsInIiOltdLCJhIjpbImRpZGNvbW0vdjIiXX0"

val encryptedMessageAlice: Either[String, EncryptedMessage] = """{
| "ciphertext": "L8wzawffzL7kbVyDcMiHgQMwlqLUqWDYOwH4f0VOFK7sJL8vO-H_JBDCADu7gvH1MDHdVJDXQmSv5dDXp6JYubagcSfBqyZGKGOQDQz-1Ir6-sqZ9K5xRPMt76dYbSswrxhaROVJvtAXyrTmN3KEv8SgP_vt8za5QU6B8cM6gp2CycJKoIhETnhVEVjHnrX0YcyzBsLhd-ZKb8e1Nlz_XSh-3cw1oIQMFjXHnU3PSjrqXcrC-4qSGpVVpHvMSOF3o2EbLGEpP-8UbI0psgSLd9a2VUF9xV55r7Bvn_zJp6tC3-KZKNLO0Rc2K-6JRgyyZjo7O_8aj7Ns6Lx0OjUXoKLiA6B79goHiv8qxJ04k5EWD_h8gt4M3_oByH_cVXH35RDK5SwNV6cVl6zRqiH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TGxaNk5rMXJhbVIzZG1ZNWFGZGpObWxpV201a1Z6bENPVGR6YVRreVJGTnJPV2hYUVdoSFdVSm5VRGxyVlVack9Gb3VVMlY1U2pCSmFtOXBXa2N3YVV4RFNucEphbTlwWVVoU01HTklUVFpNZVRscFlqSkpkVnBIYkd0TWJWcDBXak5CZFZsWVFuZE1lVWx6U1c1SmFVOXNkR1JNUTBwb1NXcHdZa2x0VW5CYVIwNTJZbGN3ZG1ScVNXbFlXREFqTmt4VGEwZDVNMlV5ZWpVMGRWQTBWVGxJZVZoS1dGSndZVVl5ZVhSemJsUjFWbWRvTmxOT1RtMURlVWRhVVZvIiwidHlwIjoiYXBwbGljYXRpb24vZGlkY29tbS1lbmNyeXB0ZWQranNvbiIsImVuYyI6IkEyNTZDQkMtSFM1MTIiLCJhbGciOiJFQ0RILTFQVStBMjU2S1cifQ",
| "recipients": [{
| "encrypted_key": "eFHcJkoUle7ZkksvZjvhJHLagF7y5B5gDQX11tc1kus2xa3Vn_QmzyVwFzScOHTCEjWRUe7r63rHBFBw0El2ukZW2tcitxr8",
| "header": {
| "kid": "did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9hbGljZS5kaWQuZm1ncC5hcHAvIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ#6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y"
| }
| }],
| "tag": "6MUE-lIZFVRId9qX-0If18EsPcfld_a3r2gQXXq4ms4",
| "iv": "plEK7sqstAIkIxVKyfuuYg"
|}""".stripMargin.fromJson[EncryptedMessage]
val encryptedMessageBob: Either[String, EncryptedMessage] = """{
| "ciphertext": "-dyjeU0aRQ8F87yAJFbOmmuon0UtEhQpmDQhYclMiTAqi06wH2bLTjtJNIOFG9sJ12uIyaQ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cHM6Ly9hbGljZS5kaWQuZm1ncC5hcHAvIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ#6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y"
| }
| }],
| "tag": "iR0meUd8R3X5dleMywNHq5NaGJ4g0h2tok414SJ7UGI",
| "iv": "T-I0b4fIktFXVhAIFoSmQg"
|}""".stripMargin.fromJson[EncryptedMessage]
}
Loading

0 comments on commit 969f50c

Please sign in to comment.