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

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

08 Nov 2023 04:09PM UTC coverage: 30.962% (-0.2%) from 31.199%
6800928555

Pull #779

patlo-iog
chore: pr cleanup

Signed-off-by: Pat Losoponkul <pat.losoponkul@iohk.io>
Pull Request #779: feat(prism-agent): add multi-tenant wallet self-service capability [WIP]

52 of 292 new or added lines in 30 files covered. (17.81%)

427 existing lines in 97 files now uncovered.

4057 of 13103 relevant lines covered (30.96%)

0.31 hits per line

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

0.0
/prism-agent/service/server/src/main/scala/io/iohk/atala/event/controller/EventServerEndpoints.scala
1
package io.iohk.atala.event.controller
2

3
import io.iohk.atala.agent.walletapi.model.BaseEntity
4
import io.iohk.atala.iam.authentication.Authenticator
5
import io.iohk.atala.iam.authentication.Authorizer
6
import io.iohk.atala.iam.authentication.DefaultAuthenticator
7
import io.iohk.atala.shared.models.WalletAccessContext
8
import sttp.tapir.ztapir.*
9
import zio.*
10
import io.iohk.atala.iam.authentication.SecurityLogic
11

12
class EventServerEndpoints(
13
    eventController: EventController,
14
    authenticator: Authenticator[BaseEntity],
15
    authorizer: Authorizer[BaseEntity]
16
) {
17

18
  val createWebhookNotificationServerEndpoint: ZServerEndpoint[Any, Any] =
×
19
    EventEndpoints.createWebhookNotification
×
NEW
20
      .zServerSecurityLogic(SecurityLogic.authorizeWith(_)(authenticator, authorizer))
×
21
      .serverLogic { wac =>
×
22
        { case (rc, createWebhook) =>
×
23
          eventController
×
24
            .createWebhookNotification(createWebhook)(rc)
×
25
            .provideSomeLayer(ZLayer.succeed(wac))
26
        }
27
      }
28

29
  val listWebhookNotificationServerEndpoint: ZServerEndpoint[Any, Any] =
×
30
    EventEndpoints.listWebhookNotification
×
NEW
31
      .zServerSecurityLogic(SecurityLogic.authorizeWith(_)(authenticator, authorizer))
×
32
      .serverLogic { wac => rc =>
×
33
        eventController
×
34
          .listWebhookNotifications(rc)
×
35
          .provideSomeLayer(ZLayer.succeed(wac))
36
      }
37

38
  val deleteWebhookNotificationServerEndpoint: ZServerEndpoint[Any, Any] =
×
39
    EventEndpoints.deleteWebhookNotification
×
NEW
40
      .zServerSecurityLogic(SecurityLogic.authorizeWith(_)(authenticator, authorizer))
×
41
      .serverLogic { wac =>
×
42
        { case (rc, id) =>
×
43
          eventController
×
44
            .deleteWebhookNotification(id)(rc)
×
45
            .provideSomeLayer(ZLayer.succeed(wac))
46
        }
47
      }
48

×
49
  val all: List[ZServerEndpoint[Any, Any]] = List(
50
    createWebhookNotificationServerEndpoint,
51
    listWebhookNotificationServerEndpoint,
52
    deleteWebhookNotificationServerEndpoint
53
  )
54

55
}
56

57
object EventServerEndpoints {
×
58
  def all: URIO[EventController & DefaultAuthenticator, List[ZServerEndpoint[Any, Any]]] = {
×
59
    for {
×
60
      authenticator <- ZIO.service[DefaultAuthenticator]
×
61
      eventController <- ZIO.service[EventController]
×
62
      eventEndpoints = new EventServerEndpoints(eventController, authenticator, authenticator)
63
    } yield eventEndpoints.all
64
  }
65
}
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