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

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

19 Mar 2024 08:16AM UTC coverage: 30.934% (-0.5%) from 31.451%
8339662426

push

web-flow
feat: add revocation for JWT credentials (#934)

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

167 of 832 new or added lines in 34 files covered. (20.07%)

438 existing lines in 112 files now uncovered.

4397 of 14214 relevant lines covered (30.93%)

0.31 hits per line

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

57.89
/prism-agent/service/server/src/main/scala/io/iohk/atala/system/controller/SystemEndpoints.scala
1
package io.iohk.atala.system.controller
2

3
import io.iohk.atala.api.http.EndpointOutputs.*
4
import io.iohk.atala.api.http.{ErrorResponse, RequestContext}
5
import io.iohk.atala.system.controller.http.HealthInfo
6
import sttp.apispec.Tag
7
import sttp.tapir.ztapir.stringBody
8
import sttp.tapir.json.zio.jsonBody
9
import sttp.tapir.*
10

11
object SystemEndpoints {
12

13
  private val tagName = "System"
14
  private val tagDescription =
1✔
15
    s"""
16
       |The __${tagName}__ is a REST API that allows to check the system health and scrap the runtime metrics.
17
       |
18
       |The __health__ endpoint returns the current version of the running service.
19
       |This information can be used to check the health status of the running service in the docker or kubernetes environment.
20
       |
21
       |The __metrics__ endpoint returns the runtime metrics of the running service scraped from the internal prometheus registry.
22
       |This information is collected by the prometheus server and can be used to monitor the running service.
1✔
23
       |""".stripMargin
24

1✔
25
  val tag = Tag(tagName, Some(tagDescription))
26

27
  val health: PublicEndpoint[
28
    (RequestContext),
29
    ErrorResponse,
30
    HealthInfo,
31
    Any
UNCOV
32
  ] =
×
33
    endpoint.get
×
34
      .in(extractFromRequest[RequestContext](RequestContext.apply))
×
35
      .in("_system" / "health")
×
36
      .out(jsonBody[HealthInfo].description("The health info object."))
37
      .errorOut(basicFailures)
1✔
38
      .tag(tagName)
1✔
39
      .summary("Check the health status of the running service")
1✔
40
      .description("Returns the health info object of the running service")
1✔
41
      .name("systemHealth")
42

43
  val metrics: PublicEndpoint[
44
    (RequestContext),
45
    ErrorResponse,
46
    String,
47
    Any
48
  ] =
×
49
    endpoint.get
×
50
      .in(extractFromRequest[RequestContext](RequestContext.apply))
×
51
      .in("_system" / "metrics")
×
52
      .out(stringBody.description("The metrics as plain strings."))
53
      .errorOut(basicFailures)
1✔
54
      .tag(tagName)
1✔
55
      .summary("Collect the runtime metrics of the running service")
1✔
56
      .description("Returns the metrics of the running service from the internal Prometheus registry")
1✔
57
      .name("systemMetrics")
58

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