• 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/ZioHttpClient.scala
1
package io.iohk.atala.mercury
2

3
import zio._
4
import zio.http.{Header as _, *}
5
import io.iohk.atala.mercury._
6
object ZioHttpClient {
×
7
  val layer = ZLayer.succeed(new ZioHttpClient())
8
}
9

10
class ZioHttpClient extends HttpClient {
11

×
12
  override def get(url: String): Task[HttpResponse] =
×
13
    zio.http.Client
×
14
      .request(url)
×
15
      .provideSomeLayer(zio.http.Client.default)
×
16
      .provideSomeLayer(zio.Scope.default)
17
      .flatMap { response =>
×
18
        response.headers.toSeq.map(e => e)
×
19
        response.body.asString
20
          .map(body =>
21
            HttpResponse(
×
22
              response.status.code,
×
23
              response.headers.map(h => Header(h.headerName, h.renderedValue)).toSeq,
24
              body
25
            )
26
          )
27
      }
28

×
29
  def postDIDComm(url: String, data: String): Task[HttpResponse] =
×
30
    zio.http.Client
31
      .request(
32
        url = url, // TODO make ERROR type
33
        method = Method.POST,
×
34
        headers = Headers("content-type" -> "application/didcomm-encrypted+json"),
35
        // headers = Headers("content-type" -> MediaTypes.contentTypeEncrypted),
×
36
        content = Body.fromChunk(Chunk.fromArray(data.getBytes)),
37
        // ssl = ClientSSLOptions.DefaultSSL,
38
      )
×
39
      .provideSomeLayer(zio.http.Client.default)
×
40
      .provideSomeLayer(zio.Scope.default)
41
      .flatMap { response =>
×
42
        response.headers.toSeq.map(e => e)
×
43
        response.body.asString
44
          .map(body =>
45
            HttpResponse(
×
46
              response.status.code,
×
47
              response.headers.map(h => Header(h.headerName, h.renderedValue)).toSeq,
48
              body
49
            )
50
          )
51
      }
52
}
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