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

hyperledger / identus-cloud-agent / 11056380298

26 Sep 2024 04:28PM CUT coverage: 48.66% (+0.05%) from 48.609%
11056380298

Pull #1375

yshyn-iohk
fix: migration to a new eudi.openid4vci library

Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
Pull Request #1375: fix: OAS and http clients for Kotliln and TypeScript

34 of 81 new or added lines in 25 files covered. (41.98%)

182 existing lines in 53 files now uncovered.

7860 of 16153 relevant lines covered (48.66%)

0.49 hits per line

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

0.0
/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/agent/server/http/DocModels.scala
1
package org.hyperledger.identus.agent.server.http
2

3
import org.hyperledger.identus.castor.controller.{DIDEndpoints, DIDRegistrarEndpoints}
4
import org.hyperledger.identus.connect.controller.ConnectionEndpoints
5
import org.hyperledger.identus.event.controller.EventEndpoints
6
import org.hyperledger.identus.iam.entity.http.EntityEndpoints
7
import org.hyperledger.identus.iam.wallet.http.WalletManagementEndpoints
8
import org.hyperledger.identus.issue.controller.IssueEndpoints
9
import org.hyperledger.identus.pollux.credentialdefinition.CredentialDefinitionRegistryEndpoints
10
import org.hyperledger.identus.pollux.credentialschema.{SchemaRegistryEndpoints, VerificationPolicyEndpoints}
11
import org.hyperledger.identus.pollux.prex.PresentationExchangeEndpoints
12
import org.hyperledger.identus.system.controller.SystemEndpoints
13
import sttp.apispec.{SecurityScheme, Tag}
14
import sttp.apispec.openapi.*
15
import sttp.model.headers.AuthenticationScheme
16

17
import scala.collection.immutable.ListMap
18

19
object DocModels {
20

21
  private val apiKeySecuritySchema = SecurityScheme(
×
22
    `type` = "apiKey",
23
    description = Some("API Key Authentication. The header `apikey` must be set with the API key."),
24
    name = Some("apikey"),
25
    in = Some("header"),
26
    scheme = None,
27
    bearerFormat = None,
28
    flows = None,
29
    openIdConnectUrl = None
30
  )
31

32
  private val adminApiKeySecuritySchema = SecurityScheme(
×
33
    `type` = "apiKey",
34
    description =
35
      Some("Admin API Key Authentication. The header `x-admin-api-key` must be set with the Admin API key."),
36
    name = Some("x-admin-api-key"),
37
    in = Some("header"),
38
    scheme = None,
39
    bearerFormat = None,
40
    flows = None,
41
    openIdConnectUrl = None
42
  )
43

44
  private val jwtSecurityScheme = SecurityScheme(
×
45
    `type` = "http",
46
    description =
47
      Some("JWT Authentication. The header `Authorization` must be set with the JWT token using `Bearer` scheme"),
48
    name = Some("Authorization"),
49
    in = Some("header"),
50
    scheme = Some(AuthenticationScheme.Bearer.name),
51
    bearerFormat = None,
52
    flows = None,
53
    openIdConnectUrl = None
54
  )
55

56
  val customiseDocsModel: OpenAPI => OpenAPI = { oapi =>
57
    oapi
58
      .openapi("3.0.3")
×
59
      .info(
×
60
        Info(
61
          title = "Identus Cloud Agent API Reference",
62
          version = "1.0", // Will be replaced dynamically by 'Tapir2StaticOAS'
63
          summary = None,
64
          description = Some("""
×
65
              |The Identus Cloud Agent API facilitates the integration and management of self-sovereign identity capabilities within applications.
66
              |It supports DID (Decentralized Identifiers) management, verifiable credential exchange, and secure messaging based on DIDComm standards.
67
              |The API is designed to be interoperable with various blockchain and DLT (Distributed Ledger Technology) platforms, ensuring wide compatibility and flexibility.
68
              |Key features include connection management, credential issuance and verification, and secure, privacy-preserving communication between entities.
69
              |Additional information and the full list of capabilities can be found in the [Open Enterprise Agent documentation](https://docs.atalaprism.io/docs/category/prism-cloud-agent)
70
              |""".stripMargin),
×
71
          termsOfService = None,
72
          contact = None,
73
          license = Some(
74
            License(
75
              name = "Apache 2.0",
76
              url = Some("https://www.apache.org/licenses/LICENSE-2.0"),
77
              extensions = ListMap.empty
×
78
            )
79
          ),
80
          extensions = ListMap.empty
×
81
        )
82
      )
83
      .servers(
×
84
        List(
×
85
          Server(url = "http://localhost:8085", description = Some("The local instance of the Cloud Agent")),
×
86
          Server(
×
87
            url = "http://localhost/cloud-agent",
88
            description = Some("The local instance of the Cloud Agent behind the APISIX proxy")
89
          ),
90
          Server(
×
91
            url = "https://k8s-dev.atalaprism.io/cloud-agent",
92
            description = Some("The Cloud Agent in the Staging Environment")
93
          ),
94
        )
95
      )
96
      .components(
×
97
        oapi.components
98
          .getOrElse(sttp.apispec.openapi.Components.Empty)
×
99
          .copy(securitySchemes =
100
            ListMap(
×
101
              "apiKeyAuth" -> Right(apiKeySecuritySchema),
×
102
              "adminApiKeyAuth" -> Right(adminApiKeySecuritySchema),
×
103
              "jwtAuth" -> Right(jwtSecurityScheme)
×
104
            )
105
          )
106
      )
107
      .addSecurity(
×
108
        ListMap(
×
109
          "apiKeyAuth" -> Vector.empty[String],
×
110
          "adminApiKeyAuth" -> Vector.empty[String],
×
111
          "jwtAuth" -> Vector.empty[String]
×
112
        )
113
      )
114
      .tags(
×
115
        List(
×
116
          ConnectionEndpoints.tag,
117
          IssueEndpoints.tag,
118
          VerificationPolicyEndpoints.tag,
119
          SchemaRegistryEndpoints.tag,
120
          CredentialDefinitionRegistryEndpoints.tag,
121
          DIDEndpoints.tag,
122
          DIDRegistrarEndpoints.tag,
123
          WalletManagementEndpoints.tag,
124
          SystemEndpoints.tag,
125
          EventEndpoints.tag,
126
          EntityEndpoints.tag,
127
          PresentationExchangeEndpoints.tag
128
        )
129
      )
130

131
  }
132

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