diff --git a/.dockerignore b/.dockerignore index 6f16852e..b78f3ee6 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,2 @@ **/.git build/test-results -ui-src diff --git a/.env.docker b/.env.docker index d5faa7cb..43b9062b 100644 --- a/.env.docker +++ b/.env.docker @@ -18,14 +18,14 @@ MIW_AUTH_REDIRECT_URL=http://localhost:8080/callback MIW_AUTH_ROLE_MAPPINGS=create_wallets:add_wallets,view_wallets:view_wallets,update_wallets:update_wallets,delete_wallets:delete_wallets,view_wallet:view_wallet,update_wallet:update_wallet MIW_AUTH_RESOURCE_ID=ManagedIdentityWallets -MIW_OPENAPI_TITLE="placeholder - Managed Identity Wallets API" -MIW_OPENAPI_DESCRIPTION="placeholder - Managed Identity Wallets API" -MIW_OPENAPI_TERM_OF_SERVICES_URL="placeholder-url-to-term-of-services" -MIW_OPENAPI_CONTACT_NAME="placeholder-contact-name" -MIW_OPENAPI_CONTACT_EMAIL="placeholder-contact-email" -MIW_OPENAPI_CONTACT_URL="placeholder-url" -MIW_OPENAPI_LICENSE_NAME="Apache 2.0" -MIW_OPENAPI_LICENSE_URL="placeholder-url-to-license" +MIW_OPENAPI_TITLE=placeholder - Managed Identity Wallets API +MIW_OPENAPI_DESCRIPTION=placeholder - Managed Identity Wallets API +MIW_OPENAPI_TERM_OF_SERVICES_URL=placeholder-url-to-term-of-services +MIW_OPENAPI_CONTACT_NAME=placeholder-contact-name +MIW_OPENAPI_CONTACT_EMAIL=placeholder-contact-email +MIW_OPENAPI_CONTACT_URL=placeholder-url +MIW_OPENAPI_LICENSE_NAME=Apache 2.0 +MIW_OPENAPI_LICENSE_URL=placeholder-url-to-license ACAPY_NETWORK_IDENTIFIER=local:test ACAPY_BASE_WALLET_API_ADMIN_URL=http://localhost:11000 diff --git a/.github/workflows/deploy-staging.yaml b/.github/workflows/deploy-staging.yaml index 3d1e0c8f..060a93e6 100644 --- a/.github/workflows/deploy-staging.yaml +++ b/.github/workflows/deploy-staging.yaml @@ -62,12 +62,6 @@ jobs: with: arguments: installDist - - name: setup nodejs - uses: actions/setup-node@master - - - name: build admin ui - run: cd ui-src && yarn && yarn build && cp -r dist/* ../static - - name: Build and push staging images uses: docker/build-push-action@v2 with: diff --git a/.github/workflows/kics.yml b/.github/workflows/kics.yml index 0bddf2bb..43a39767 100644 --- a/.github/workflows/kics.yml +++ b/.github/workflows/kics.yml @@ -63,7 +63,7 @@ jobs: # GITHUB_TOKEN enables this github action to access github API and post comments in a pull request # token: ${{ secrets.GITHUB_TOKEN }} # enable_comments: true - exclude_paths: "docs/openapi_v310.json" + exclude_paths: "docs/openapi_v330.json" # Upload findings to GitHub Advanced Security Dashboard - name: Upload SARIF file for GitHub Advanced Security Dashboard diff --git a/.github/workflows/service-build.yaml b/.github/workflows/service-build.yaml index 0583a26d..28d45968 100644 --- a/.github/workflows/service-build.yaml +++ b/.github/workflows/service-build.yaml @@ -88,12 +88,6 @@ jobs: vkey: '${{ secrets.ORG_VERACODE_API_KEY }}' #reference to API Key in github, which is set as github or. secret include: 'build/install/org.eclipse.tractusx.managedidentitywallets/lib/org.eclipse.tractusx.managedidentitywallets-*jar' - - name: setup nodejs - uses: actions/setup-node@master - - - name: build admin ui - run: cd ui-src && npm install -g yarn && yarn && yarn build && cp -r dist/* ../static - - name: Build and push Docker image uses: docker/build-push-action@v2 with: diff --git a/Dockerfile b/Dockerfile index 60e76cb4..a2868fc9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,5 @@ EXPOSE 8080:8080 RUN addgroup -g 1001 -S user && adduser -u 1001 -S -s /bin/false -G user user USER user COPY ./build/install/org.eclipse.tractusx.managedidentitywallets/ /app/ -COPY ./static /app/static WORKDIR /app/bin CMD ["./org.eclipse.tractusx.managedidentitywallets"] diff --git a/README.md b/README.md index 92e36fb8..e4406b6f 100644 --- a/README.md +++ b/README.md @@ -460,29 +460,3 @@ To regenerate the README.md after updating `values.yaml` or `Chart.yaml` run ``` helm-docs --sort-values-order file ``` - -## Dashboard - -Within `ui-src` a simple Vue based dashboard application is available -which currently only shows the existing companies as well as is able -to retrieve the full BPN information from the CX data pool API on a -click on the BPN. - -It can be developed with - -``` -cd ui-src -yarn serve -``` - -In each release the files in `/static` are updated but within the deployment -pipeline the application is built and copied over to the `/static` directory. - -The steps to build the static files are like following: - -``` -cd ui-src -yarn build -rm -rf ../static/* -cp -r dist/* ../static -``` diff --git a/charts/managed-identity-wallets/Chart.yaml b/charts/managed-identity-wallets/Chart.yaml index 3990790b..54aef7de 100644 --- a/charts/managed-identity-wallets/Chart.yaml +++ b/charts/managed-identity-wallets/Chart.yaml @@ -15,8 +15,8 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.6.9 -appVersion: 3.2.0 +version: 0.7.0 +appVersion: 3.3.0 dependencies: - name: postgresql diff --git a/charts/managed-identity-wallets/README.md b/charts/managed-identity-wallets/README.md index 15a12742..c11c160d 100644 --- a/charts/managed-identity-wallets/README.md +++ b/charts/managed-identity-wallets/README.md @@ -1,6 +1,6 @@ # managed-identity-wallets -![Version: 0.6.9](https://img.shields.io/badge/Version-0.6.9-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 3.2.0](https://img.shields.io/badge/AppVersion-3.2.0-informational?style=flat-square) +![Version: 0.7.0](https://img.shields.io/badge/Version-0.7.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 3.3.0](https://img.shields.io/badge/AppVersion-3.3.0-informational?style=flat-square) Managed Identity Wallets Service diff --git a/docs/openapi_v310.json b/docs/openapi_v330.json similarity index 99% rename from docs/openapi_v310.json rename to docs/openapi_v330.json index 47c206c4..acc69197 100644 --- a/docs/openapi_v310.json +++ b/docs/openapi_v330.json @@ -2,7 +2,7 @@ "openapi": "3.0.3", "info": { "title": "Managed Identity Wallets API", - "version": "3.1.0", + "version": "3.3.0", "description": "Managed Identity Wallets API", "termsOfService": "https://www.eclipse.org/legal/termsofuse.php", "contact": { @@ -122,7 +122,7 @@ "bpn": "bpn", "did": "did", "verKey": "verkey", - "createdAt": "2023-01-28T17:35:12.815638", + "createdAt": "2023-02-13T15:06:06.539270", "vcs": [ ], "pendingMembershipIssuance": false, @@ -342,7 +342,7 @@ "name": "name", "bpn": "bpn", "did": "did", - "createdAt": "2023-01-28T17:35:12.815728", + "createdAt": "2023-02-13T15:06:06.539342", "vcs": [ ], "pendingMembershipIssuance": false, @@ -2956,6 +2956,12 @@ "proof": { "$ref": "#/components/schemas/LdProofDto" }, + "provenanceProof": { + "items": { + "$ref": "#/components/schemas/Any" + }, + "type": "array" + }, "type": { "items": { "type": "string" @@ -2974,16 +2980,16 @@ }, "CredentialStatus": { "properties": { - "credentialType": { + "type": { "type": "string" }, - "index": { + "statusListIndex": { "type": "string" }, - "listUrl": { + "statusListCredential": { "type": "string" }, - "statusId": { + "id": { "type": "string" }, "statusPurpose": { @@ -2991,9 +2997,9 @@ } }, "required": [ - "statusId", - "index", - "listUrl" + "id", + "statusListIndex", + "statusListCredential" ], "type": "object" }, @@ -3686,10 +3692,10 @@ }, "ListCredentialSubject": { "properties": { - "credentialId": { + "id": { "type": "string" }, - "credentialType": { + "type": { "type": "string" }, "encodedList": { @@ -3700,7 +3706,7 @@ } }, "required": [ - "credentialId", + "id", "encodedList" ], "type": "object" @@ -3718,4 +3724,4 @@ ], "tags": [ ] -} +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 2c4b7197..f858bd42 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,6 +5,6 @@ acapy_java_library_version=0.7.33 kotlin.code.style=official kompendium_version=2.3.5 exposed_version=0.38.2 -version=3.2.0 +version=3.3.0 coverage_excludes=**/models/**,**/entities/**,**/Application*,**/services/IWalletService*,**/services/IAcaPyService*,**/services/AcaPyService*,**/services/IBusinessPartnerDataService*,**/services/IRevocationService*,**/services/RevocationService* diff --git a/src/main/kotlin/org/eclipse/tractusx/managedidentitywallets/Application.kt b/src/main/kotlin/org/eclipse/tractusx/managedidentitywallets/Application.kt index 4be8714b..d9843576 100644 --- a/src/main/kotlin/org/eclipse/tractusx/managedidentitywallets/Application.kt +++ b/src/main/kotlin/org/eclipse/tractusx/managedidentitywallets/Application.kt @@ -139,7 +139,7 @@ fun Application.module(testing: Boolean = false) { Services.revocationService = revocationService Services.webhookService = webhookService - configureRouting(walletService) + configureRouting() appRoutes(walletService, businessPartnerDataService, revocationService, webhookService, utilsService) configurePersistence() diff --git a/src/main/kotlin/org/eclipse/tractusx/managedidentitywallets/models/ssi/VerifiableCredentialDto.kt b/src/main/kotlin/org/eclipse/tractusx/managedidentitywallets/models/ssi/VerifiableCredentialDto.kt index 7abbd989..25df395e 100644 --- a/src/main/kotlin/org/eclipse/tractusx/managedidentitywallets/models/ssi/VerifiableCredentialDto.kt +++ b/src/main/kotlin/org/eclipse/tractusx/managedidentitywallets/models/ssi/VerifiableCredentialDto.kt @@ -144,11 +144,21 @@ data class VerifiableCredentialRequestWithoutIssuerDto( @Serializable data class CredentialStatus ( - @SerialName("id") @JsonProperty("id") var statusId: String, - @SerialName("type") @JsonProperty("type") var credentialType: String = "StatusList2021Entry", - @SerialName("statusPurpose") @JsonProperty("statusPurpose") var statusPurpose: String = "revocation", - @SerialName("statusListIndex") @JsonProperty("statusListIndex") var index: String, - @SerialName("statusListCredential") @JsonProperty("statusListCredential") var listUrl: String, + @SerialName("id") @JsonProperty("id") + @Field(description = "The ID of the credential status", name = "id") + var statusId: String, + @SerialName("type") @JsonProperty("type") + @Field(description = "The type of the credential status", name = "type") + var credentialType: String = "StatusList2021Entry", + @SerialName("statusPurpose") @JsonProperty("statusPurpose") + @Field(description = "The purpose of the status list", name = "statusPurpose") + var statusPurpose: String = "revocation", + @SerialName("statusListIndex") @JsonProperty("statusListIndex") + @Field(description = "The index of the credential in the status list", name = "statusListIndex") + var index: String, + @SerialName("statusListCredential") @JsonProperty("statusListCredential") + @Field(description = "The url to the status list credential", name = "statusListCredential") + var listUrl: String, ) { companion object { const val CREDENTIAL_TYPE = "StatusList2021Entry" @@ -164,8 +174,12 @@ data class ListCredentialRequestData ( @Serializable data class ListCredentialSubject ( - @SerialName("id") @JsonProperty("id") var credentialId: String, - @SerialName("type") @JsonProperty("type") var credentialType: String = "StatusList2021", + @SerialName("id") @JsonProperty("id") + @Field(name = "id") + var credentialId: String, + @SerialName("type") @JsonProperty("type") + @Field(name = "type") + var credentialType: String = "StatusList2021", var statusPurpose: String = "revocation", var encodedList: String ) { diff --git a/src/main/kotlin/org/eclipse/tractusx/managedidentitywallets/plugins/Routing.kt b/src/main/kotlin/org/eclipse/tractusx/managedidentitywallets/plugins/Routing.kt index f79d09a3..0ad55652 100644 --- a/src/main/kotlin/org/eclipse/tractusx/managedidentitywallets/plugins/Routing.kt +++ b/src/main/kotlin/org/eclipse/tractusx/managedidentitywallets/plugins/Routing.kt @@ -21,49 +21,15 @@ package org.eclipse.tractusx.managedidentitywallets.plugins import io.bkbn.kompendium.core.routes.redoc import io.ktor.application.* -import io.ktor.auth.* -import io.ktor.client.* -import io.ktor.client.engine.apache.* -import io.ktor.client.features.* -import io.ktor.client.request.* -import io.ktor.client.statement.* import io.ktor.http.* -import io.ktor.http.content.* import io.ktor.response.* import io.ktor.routing.* -import io.ktor.sessions.* import kotlinx.serialization.Serializable -import kotlinx.serialization.SerializationException -import kotlinx.serialization.json.Json -import org.eclipse.tractusx.managedidentitywallets.models.BadRequestException -import org.eclipse.tractusx.managedidentitywallets.services.IWalletService -import java.io.File -import java.io.IOException - -suspend fun retrieveBusinessPartnerInfo(bpdmDatapoolUrl: String, bpn: String, token: String): String { - - var stringBody = "" - HttpClient(Apache).use { client -> - val httpResponse: HttpResponse = client.get("$bpdmDatapoolUrl/$bpn") { - headers { - append(HttpHeaders.Accept, ContentType.Application.Json.toString()) - append(HttpHeaders.Authorization, "Bearer $token") - } - } - stringBody = httpResponse.readText() - } - - return stringBody -} @Serializable data class BusinessPartnerInfo(val bpn: String) -private val json = Json { ignoreUnknownKeys = true } - -fun Application.configureRouting(IWalletService: IWalletService) { - - val bpdmDatapoolUrl = environment.config.property("bpdm.datapoolUrl").getString() +fun Application.configureRouting() { routing { @@ -152,94 +118,11 @@ fun Application.configureRouting(IWalletService: IWalletService) {
The Managed Identity Wallets service implements the Self-Sovereign-Identity (SSI) readiness by providing a wallet hosting platform including a DID resolver, service endpoints and the company wallets itself.
-> Admin UI