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

hyperledger / identus-cloud-agent / 8939873127

02 May 2024 02:04AM UTC coverage: 49.277% (-0.07%) from 49.343%
8939873127

Pull #999

CryptoKnightIOG
ATL-6990: fix integration test

Signed-off-by: Bassam Riman <bassam.riman@iohk.io>
Pull Request #999: fix: fix integration test

7296 of 14806 relevant lines covered (49.28%)

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.iam.wallet.http.WalletManagementEndpoints
6
import org.hyperledger.identus.pollux.credentialdefinition.CredentialDefinitionRegistryEndpoints
7
import org.hyperledger.identus.pollux.credentialschema.{SchemaRegistryEndpoints, VerificationPolicyEndpoints}
8
import org.hyperledger.identus.system.controller.SystemEndpoints
9
import sttp.apispec.openapi.*
10
import sttp.apispec.{SecurityScheme, Tag}
11
import sttp.model.headers.AuthenticationScheme
12

13
import scala.collection.immutable.ListMap
14
import org.hyperledger.identus.issue.controller.IssueEndpoints
15

16
object DocModels {
17

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

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

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

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

122
  }
123

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