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

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

26 Jun 2023 08:57AM UTC coverage: 27.426% (+0.1%) from 27.31%
5376174778

push

web-flow
fix(prism-agent): decouple secret storage backend from agent (#570)

* chore: add PrismAgentApp

* chore: refactor jobs repitition

* chore: encapsulate DidCommHttpServer

* chore: config can choose multiple implementation

* chore: use auto layer wiring

* chore: remove unused imports

* chore: add logging and comments

* docs: update secret storage docs

* chore: log error when storage backend is wrong

* Update docs/docusaurus/secrets/operation.md

Co-authored-by: Yurii Shynbuiev - IOHK <102033808+yshyn-iohk@users.noreply.github.com>

---------

Co-authored-by: Yurii Shynbuiev - IOHK <102033808+yshyn-iohk@users.noreply.github.com>

2493 of 9090 relevant lines covered (27.43%)

0.27 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 io.iohk.atala.mercury.DidCommX
12
import scala.language.implicitConversions
13

14
object AgentHardCode extends ZIOAppDefault {
15

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

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

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

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

56
}
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