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

hyperledger / identus-cloud-agent / 10833924030

12 Sep 2024 03:25PM CUT coverage: 48.864% (+0.07%) from 48.793%
10833924030

Pull #1351

CryptoKnightIOG
ATL-7660: Credential Schema as List

Signed-off-by: Bassam Riman <bassam.riman@iohk.io>
Pull Request #1351: feat: Support Array Of Credential Schema

15 of 28 new or added lines in 3 files covered. (53.57%)

222 existing lines in 68 files now uncovered.

7530 of 15410 relevant lines covered (48.86%)

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.system.controller.SystemEndpoints
12
import sttp.apispec.{SecurityScheme, Tag}
13
import sttp.apispec.openapi.*
14
import sttp.model.headers.AuthenticationScheme
15

16
import scala.collection.immutable.ListMap
17

18
object DocModels {
19

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

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

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

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

129
  }
130

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