Skip to content

Commit

Permalink
fix: update open-api-spec and generator script and package.json (#990)
Browse files Browse the repository at this point in the history
Signed-off-by: mineme0110 <[email protected]>
Signed-off-by: Fabio Pinheiro <[email protected]>
Co-authored-by: Fabio Pinheiro <[email protected]>
  • Loading branch information
mineme0110 and FabioPinheiro authored Apr 29, 2024
1 parent 1ea6218 commit 88c1b5e
Show file tree
Hide file tree
Showing 32 changed files with 108 additions and 94 deletions.
25 changes: 17 additions & 8 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ jobs:
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.ATALA_GITHUB_ACTOR }}
password: ${{ secrets.ATALA_GITHUB_TOKEN }}
username: hyperledger-bot
password: ${{ secrets.GITHUB_TOKEN }}

- name: Install Compose
uses: ndeloof/[email protected]
Expand All @@ -54,8 +54,8 @@ jobs:
env:
CLOUD_AGENT_PATH: "../.."
ENV_FILE: "infrastructure/local/.env"
GITHUB_ACTOR: ${{ secrets.ATALA_GITHUB_ACTOR }}
GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }}
GITHUB_ACTOR: hyperledger-bot
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd "${CLOUD_AGENT_PATH}" || exit 129
sbt docker:publishLocal
Expand All @@ -71,11 +71,20 @@ jobs:
env:
PRISM_NODE_VERSION: ${{ steps.build_local_cloud_agent.outputs.prism_node_version }}
OPEN_ENTERPRISE_AGENT_VERSION: ${{ steps.build_local_cloud_agent.outputs.open_enterprise_agent_version }}
ATALA_GITHUB_ACTOR: ${{ secrets.ATALA_GITHUB_ACTOR }}
ATALA_GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }}
continue-on-error: true
GITHUB_ACTOR: hyperledger-bot
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# continue-on-error: true
run: |
./gradlew test --tests "IntegrationTestsRunner"
- name: Make report of integration tests
if: always()
env:
PRISM_NODE_VERSION: ${{ steps.build_local_cloud_agent.outputs.prism_node_version }}
OPEN_ENTERPRISE_AGENT_VERSION: ${{ steps.build_local_cloud_agent.outputs.open_enterprise_agent_version }}
GITHUB_ACTOR: hyperledger-bot
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./gradlew test --tests "IntegrationTestsRunner" || true
./gradlew reports
- name: Extract test results
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/release-clients.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
name: Publish prism-agent clients
name: Publish Identus-cloud-agent clients

on:
workflow_dispatch:
inputs:
releaseTag:
description: "Tag to release clients (e.g. prism-agent-v1.31.0)"
description: "Tag to release clients (e.g. identus-cloud-agent-v1.33.0)"
required: true
type: string
push:
tags:
- "prism-agent-v*"
- "identus-cloud-agent-v*"

jobs:
publish-clients:
name: 'Build and publish Prism-Agent clients'
name: 'Build and publish Identus-cloud-Agent clients'
runs-on: ubuntu-latest
env:
VERSION_TAG: ${{inputs.releaseTag || github.ref_name}}
ATALA_GITHUB_ACTOR: ${{secrets.ATALA_GITHUB_ACTOR}}
ATALA_GITHUB_TOKEN: ${{secrets.ATALA_GITHUB_TOKEN}}
NODE_AUTH_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }}
GITHUB_ACTOR: ${{secrets.GITHUB_ACTOR}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

steps:
- name: Checkout
Expand All @@ -44,20 +44,20 @@ jobs:
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.ATALA_GITHUB_ACTOR }}
password: ${{ secrets.ATALA_GITHUB_TOKEN }}
username: hyperledger-bot
password: ${{ secrets.GITHUB_TOKEN }}

- name: Setup yq - portable yaml processor
uses: mikefarah/[email protected]

- name: Install generator dependencies
working-directory: prism-agent/client/generator
working-directory: cloud-agent/client/generator
run: yarn install

- name: Generate clients
working-directory: prism-agent/client/generator
working-directory: cloud-agent/client/generator
run: yarn generate:all

- name: Publish clients
working-directory: prism-agent/client/generator
working-directory: cloud-agent/client/generator
run: yarn publish:clients
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@ target/
**.env.*
workspace.json
docs/architecture/structurizr/.structurizr/
cloud-agent/client/typescript
cloud-agent/client/kotlin/src/main/kotlin/
!cloud-agent/client/kotlin/src/main/kotlin/org/hyperledger/identus/client/models/CredentialSubject.kt
!cloud-agent/client/kotlin/src/main/kotlin/org/hyperledger/identus/client/models/Service.kt
!cloud-agent/client/kotlin/src/main/kotlin/org/hyperledger/identus/client/models/UpdateManagedDIDServiceAction.kt
6 changes: 3 additions & 3 deletions cloud-agent/client/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Prism-agent client generator
# Cloud-agent client generator

This project goal is to generate the models based on the OpenAPI Specification.

Expand All @@ -18,9 +18,9 @@ cd generator
yarn publish:clients
```

## Prism-agent lifecycle
## Cloud-agent lifecycle

`prism-client-generator` creates the clients after the `prism-agent-v*` tag is created.
`identus-client-generator` creates the clients after the `cloud-agent-v*` tag is created.

## Supported clients

Expand Down
2 changes: 1 addition & 1 deletion cloud-agent/client/generator/generate-clients.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ yarn openapi-generator-cli generate \
-i ../../service/api/http/cloud-agent-openapi-spec.yaml \
-o ../kotlin \
--ignore-file-override ../kotlin/.openapi-generator-ignore \
--additional-properties=packageName=io.iohk.atala.prism,serializationLibrary=gson,enumPropertyNaming=UPPERCASE
--additional-properties=packageName=org.hyperledger.identus.client,serializationLibrary=gson,enumPropertyNaming=UPPERCASE

# generate typescript models
yarn openapi-generator-cli generate \
Expand Down
12 changes: 6 additions & 6 deletions cloud-agent/client/kotlin/.openapi-generator-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ build.gradle
docs

# igore broken files
src/main/kotlin/io/iohk/atala/prism/models/UpdateManagedDIDServiceAction.kt
src/main/kotlin/io/iohk/atala/prism/models/UpdateManagedDIDServiceActionType.kt
src/main/kotlin/org/hyperledger/identus/client/models/UpdateManagedDIDServiceAction.kt
src/main/kotlin/org/hyperledger/identus/client/models/UpdateManagedDIDServiceActionType.kt

src/main/kotlin/io/iohk/atala/prism/models/Service.kt
src/main/kotlin/io/iohk/atala/prism/models/ServiceType.kt
src/main/kotlin/org/hyperledger/identus/client/models/Service.kt
src/main/kotlin/org/hyperledger/identus/client/models/ServiceType.kt

src/main/kotlin/io/iohk/atala/prism/models/StatusPurpose.kt
src/main/kotlin/io/iohk/atala/prism/models/CredentialSubject.kt
src/main/kotlin/org/hyperledger/identus/client/models/StatusPurpose.kt
src/main/kotlin/org/hyperledger/identus/client/models/CredentialSubject.kt
8 changes: 4 additions & 4 deletions cloud-agent/client/kotlin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
group 'io.iohk.atala.prism'
group 'org.hyperledger.identus'

wrapper {
gradleVersion = '7.5'
Expand Down Expand Up @@ -51,10 +51,10 @@ publishing {
repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/hyperledger-labs/open-enterprise-agent/"
url = "https://maven.pkg.github.com/hyperledger/identus-cloud-agent/"
credentials {
username = System.getenv("ATALA_GITHUB_ACTOR")
password = System.getenv("ATALA_GITHUB_TOKEN")
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion cloud-agent/client/kotlin/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

rootProject.name = 'prism-kotlin-client'
rootProject.name = 'identus--kotlin-client'
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"UnusedImport"
)

package org.hyperledger.identus.prism.models
package org.hyperledger.identus.client.models

import com.google.gson.annotations.SerializedName

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"UnusedImport"
)

package org.hyperledger.identus.prism.models
package org.hyperledger.identus.client.models

import org.hyperledger.identus.prism.models.Json
import org.hyperledger.identus.client.models.Json

import com.google.gson.annotations.SerializedName

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"UnusedImport"
)

package org.hyperledger.identus.prism.models
package org.hyperledger.identus.client.models

import org.hyperledger.identus.prism.models.Json
import org.hyperledger.identus.client.models.Json

import com.google.gson.annotations.SerializedName

Expand Down
2 changes: 1 addition & 1 deletion tests/integration-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies {
testImplementation("io.ktor:ktor-server-netty:2.3.0")
testImplementation("io.ktor:ktor-client-apache:2.3.0")
// RestAPI client
testImplementation("io.iohk.atala.prism:prism-kotlin-client:1.31.0")
testImplementation("org.hyperledger.identus:identus-kotlin-client:1.32.0")
// Test helpers library
testImplementation("io.iohk.atala:atala-automation:0.3.2")
// Hoplite for configuration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package common

import io.iohk.atala.prism.models.CredentialSchemaInput
import org.hyperledger.identus.client.models.CredentialSchemaInput
import models.JsonSchema
import models.JsonSchemaProperty
import java.util.UUID
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package common

import io.iohk.atala.prism.models.*
import org.hyperledger.identus.client.models.*
import java.time.Duration

object TestConstants {
Expand Down
8 changes: 4 additions & 4 deletions tests/integration-tests/src/test/kotlin/models/Events.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package models

import com.google.gson.JsonElement
import com.google.gson.annotations.SerializedName
import io.iohk.atala.prism.models.Connection
import io.iohk.atala.prism.models.IssueCredentialRecord
import io.iohk.atala.prism.models.ManagedDID
import io.iohk.atala.prism.models.PresentationStatus
import org.hyperledger.identus.client.models.Connection
import org.hyperledger.identus.client.models.IssueCredentialRecord
import org.hyperledger.identus.client.models.ManagedDID
import org.hyperledger.identus.client.models.PresentationStatus

data class Event(
@SerializedName("type") var type: String,
Expand Down
4 changes: 2 additions & 2 deletions tests/integration-tests/src/test/kotlin/steps/Setup.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import config.AgentRole
import config.Config
import io.cucumber.java.AfterAll
import io.cucumber.java.BeforeAll
import io.iohk.atala.prism.models.CreateWalletRequest
import io.iohk.atala.prism.models.CreateWebhookNotification
import org.hyperledger.identus.client.models.CreateWalletRequest
import org.hyperledger.identus.client.models.CreateWebhookNotification
import io.restassured.RestAssured
import io.restassured.builder.RequestSpecBuilder
import net.serenitybdd.screenplay.Actor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import io.cucumber.java.ParameterType
import io.cucumber.java.en.Given
import io.iohk.atala.automation.extensions.get
import io.iohk.atala.automation.serenity.ensure.Ensure
import io.iohk.atala.prism.models.Connection
import io.iohk.atala.prism.models.ConnectionsPage
import io.iohk.atala.prism.models.IssueCredentialRecord
import io.iohk.atala.prism.models.IssueCredentialRecordPage
import org.hyperledger.identus.client.models.Connection
import org.hyperledger.identus.client.models.ConnectionsPage
import org.hyperledger.identus.client.models.IssueCredentialRecord
import org.hyperledger.identus.client.models.IssueCredentialRecordPage
import net.serenitybdd.rest.SerenityRest
import net.serenitybdd.screenplay.Actor
import net.serenitybdd.screenplay.actors.OnStage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import io.cucumber.java.en.Then
import io.cucumber.java.en.When
import io.iohk.atala.automation.extensions.get
import io.iohk.atala.automation.serenity.ensure.Ensure
import io.iohk.atala.prism.models.AcceptConnectionInvitationRequest
import io.iohk.atala.prism.models.Connection
import io.iohk.atala.prism.models.CreateConnectionRequest
import org.hyperledger.identus.client.models.AcceptConnectionInvitationRequest
import org.hyperledger.identus.client.models.Connection
import org.hyperledger.identus.client.models.CreateConnectionRequest
import net.serenitybdd.rest.SerenityRest
import net.serenitybdd.screenplay.Actor
import org.apache.http.HttpStatus.SC_CREATED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import io.cucumber.java.en.Then
import io.cucumber.java.en.When
import io.iohk.atala.automation.extensions.get
import io.iohk.atala.automation.serenity.ensure.Ensure
import io.iohk.atala.prism.models.*
import org.hyperledger.identus.client.models.*
import models.AnoncredsSchema
import models.CredentialEvent
import net.serenitybdd.rest.SerenityRest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import io.cucumber.java.en.Then
import io.cucumber.java.en.When
import io.iohk.atala.automation.extensions.get
import io.iohk.atala.automation.serenity.ensure.Ensure
import io.iohk.atala.prism.models.DIDOperationResponse
import io.iohk.atala.prism.models.DIDResolutionResult
import org.hyperledger.identus.client.models.DIDOperationResponse
import org.hyperledger.identus.client.models.DIDResolutionResult
import net.serenitybdd.rest.SerenityRest
import net.serenitybdd.screenplay.Actor
import org.apache.http.HttpStatus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import io.cucumber.java.en.Then
import io.cucumber.java.en.When
import io.iohk.atala.automation.extensions.get
import io.iohk.atala.automation.serenity.ensure.Ensure
import io.iohk.atala.prism.models.CreateManagedDidRequest
import io.iohk.atala.prism.models.CreateManagedDidRequestDocumentTemplate
import io.iohk.atala.prism.models.Json
import io.iohk.atala.prism.models.ManagedDID
import io.iohk.atala.prism.models.ManagedDIDKeyTemplate
import io.iohk.atala.prism.models.ManagedDIDPage
import io.iohk.atala.prism.models.Purpose
import io.iohk.atala.prism.models.Service
import org.hyperledger.identus.client.models.CreateManagedDidRequest
import org.hyperledger.identus.client.models.CreateManagedDidRequestDocumentTemplate
import org.hyperledger.identus.client.models.Json
import org.hyperledger.identus.client.models.ManagedDID
import org.hyperledger.identus.client.models.ManagedDIDKeyTemplate
import org.hyperledger.identus.client.models.ManagedDIDPage
import org.hyperledger.identus.client.models.Purpose
import org.hyperledger.identus.client.models.Service
import net.serenitybdd.rest.SerenityRest
import net.serenitybdd.screenplay.Actor
import org.apache.http.HttpStatus.SC_CREATED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import io.cucumber.java.en.Then
import io.cucumber.java.en.When
import io.iohk.atala.automation.extensions.get
import io.iohk.atala.automation.serenity.ensure.Ensure
import io.iohk.atala.prism.models.*
import org.hyperledger.identus.client.models.*
import net.serenitybdd.rest.SerenityRest
import net.serenitybdd.screenplay.Actor
import org.apache.http.HttpStatus
Expand Down
22 changes: 11 additions & 11 deletions tests/integration-tests/src/test/kotlin/steps/did/UpdateDidSteps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ import io.cucumber.java.en.Then
import io.cucumber.java.en.When
import io.iohk.atala.automation.extensions.get
import io.iohk.atala.automation.serenity.ensure.Ensure
import io.iohk.atala.prism.models.ActionType
import io.iohk.atala.prism.models.DIDOperationResponse
import io.iohk.atala.prism.models.DIDResolutionResult
import io.iohk.atala.prism.models.Json
import io.iohk.atala.prism.models.ManagedDIDKeyTemplate
import io.iohk.atala.prism.models.Purpose
import io.iohk.atala.prism.models.RemoveEntryById
import io.iohk.atala.prism.models.Service
import io.iohk.atala.prism.models.UpdateManagedDIDRequest
import io.iohk.atala.prism.models.UpdateManagedDIDRequestAction
import io.iohk.atala.prism.models.UpdateManagedDIDServiceAction
import org.hyperledger.identus.client.models.ActionType
import org.hyperledger.identus.client.models.DIDOperationResponse
import org.hyperledger.identus.client.models.DIDResolutionResult
import org.hyperledger.identus.client.models.Json
import org.hyperledger.identus.client.models.ManagedDIDKeyTemplate
import org.hyperledger.identus.client.models.Purpose
import org.hyperledger.identus.client.models.RemoveEntryById
import org.hyperledger.identus.client.models.Service
import org.hyperledger.identus.client.models.UpdateManagedDIDRequest
import org.hyperledger.identus.client.models.UpdateManagedDIDRequestAction
import org.hyperledger.identus.client.models.UpdateManagedDIDServiceAction
import net.serenitybdd.rest.SerenityRest
import net.serenitybdd.screenplay.Actor
import org.apache.http.HttpStatus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package steps.multitenancy
import interactions.Post
import io.iohk.atala.automation.extensions.get
import io.iohk.atala.automation.serenity.ensure.Ensure
import io.iohk.atala.prism.models.ApiKeyAuthenticationRequest
import io.iohk.atala.prism.models.CreateEntityRequest
import io.iohk.atala.prism.models.EntityResponse
import org.hyperledger.identus.client.models.ApiKeyAuthenticationRequest
import org.hyperledger.identus.client.models.CreateEntityRequest
import org.hyperledger.identus.client.models.EntityResponse
import net.serenitybdd.rest.SerenityRest
import net.serenitybdd.screenplay.Actor
import org.apache.http.HttpStatus.SC_CREATED
Expand Down
Loading

0 comments on commit 88c1b5e

Please sign in to comment.