• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

input-output-hk / atala-prism-building-blocks / 7472574865

10 Jan 2024 09:05AM UTC coverage: 30.68% (-0.03%) from 30.708%
7472574865

push

web-flow
docs(prism-agent): add verification policy OpenAPI description (#835)

Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>

4013 of 13080 relevant lines covered (30.68%)

0.31 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/mercury/mercury-library/agent-cli-didcommx/src/main/scala/io/iohk/atala/mercury/AgentHardCode.scala
1
package io.iohk.atala.mercury
2

3
import zio._
4
import io.circe._
5
import io.circe.syntax._
6

7
import io.iohk.atala.mercury.model.{given, _}
8
import io.iohk.atala.mercury.protocol.issuecredential._
9
import java.io.IOException
10

11
import scala.language.implicitConversions
12

13
object AgentHardCode extends ZIOAppDefault {
14

×
15
  def run = for {
×
16
    didPeer <- for {
×
17
      peer <- ZIO.succeed(PeerDID.makePeerDid()) // (serviceEndpoint = serviceEndpoint))
×
18
      _ <- Console.printLine(s"New DID: ${peer.did}") *>
×
19
        Console.printLine(s"JWK for KeyAgreement: ${peer.jwkForKeyAgreement.toJSONString}") *>
×
20
        Console.printLine(s"JWK for KeyAuthentication: ${peer.jwkForKeyAuthentication.toJSONString}")
21
    } yield (peer)
×
22
    _ <- test.provide(DidCommX.liveLayer, AgentPeerService.makeLayer(didPeer))
23
  } yield ()
24

×
25
  val attribute1 = Attribute(name = "name", value = "Joe Blog")
×
26
  val attribute2 = Attribute(name = "dob", value = "01/10/1947")
×
27
  val credentialPreview = CredentialPreview(attributes = Seq(attribute1, attribute2))
×
28
  val body = ProposeCredential.Body(
29
    goal_code = Some("Propose Credential"),
30
    credential_preview = Some(credentialPreview),
31
  )
32

×
33
  def test: ZIO[DidOps & DidAgent, IOException, Unit] = {
×
34
    for {
×
35
      agentService <- ZIO.service[DidAgent]
×
36
      opsService <- ZIO.service[DidOps]
×
37
      msg = Message(
38
        `type` = "TEST",
×
39
        from = Some(agentService.id),
×
40
        to = Seq.empty,
×
41
        body = body.asJson.asObject.get
42
      )
43
      // signed <- didCommService.packSigned(msg)
×
44
      ttt <- opsService.packEncrypted(msg, to = agentService.id)
×
45
      msg2 <- opsService.unpack(ttt.string)
×
46
      _ <- Console.printLine(msg)
47

×
48
      aaa = msg: org.didcommx.didcomm.message.Message
×
49
      _ <- Console.printLine("aaaaaaaaaaaaaaaaaaaaaaaaaaaa")
×
50
      _ <- Console.printLine(aaa.getAttachments())
51
    } yield ()
52
  }
53

54
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc