From a9f8f97d38d8fd510111c0aa4cbee9aee97659be Mon Sep 17 00:00:00 2001 From: Hyperledger Bot Date: Sun, 2 Jun 2024 00:18:11 +0000 Subject: [PATCH 1/2] Update apollo-jvm to 1.3.4 in main Signed-off-by: Hyperledger Bot --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index dbd0c329e6..b004c4338b 100644 --- a/build.sbt +++ b/build.sbt @@ -84,7 +84,7 @@ lazy val V = new { val jwtCirceVersion = "9.4.6" val zioPreludeVersion = "1.0.0-RC24" - val apollo = "1.2.16" + val apollo = "1.3.4" val jsonSchemaValidator = "1.3.2" // scala-steward:off //TODO 1.3.2 need to fix: // [error] org.hyperledger.identus.pollux.core.model.schema.AnoncredSchemaTypeSpec // [error] org.hyperledger.identus.pollux.core.model.schema.CredentialSchemaSpec From cf50dd3f9539adb349e1bd748e1fe0fb7babb686 Mon Sep 17 00:00:00 2001 From: Pat Losoponkul Date: Fri, 7 Jun 2024 14:47:18 +0700 Subject: [PATCH 2/2] chore: rename apollo pakcage after verion upgrade Signed-off-by: Pat Losoponkul --- .../agent/server/jobs/BackgroundJobsHelper.scala | 12 ++++++++---- .../controller/CredentialDefinitionController.scala | 1 - .../controller/CredentialSchemaController.scala | 1 - .../controller/http/VcVerificationRequest.scala | 3 +-- .../core/service/CredentialDefinitionService.scala | 1 - .../core/service/CredentialSchemaService.scala | 3 +-- .../pollux/core/service/CredentialServiceImpl.scala | 3 --- .../core/service/CredentialServiceNotifier.scala | 1 - .../pollux/core/service/MockCredentialService.scala | 1 - .../hyperledger/identus/pollux/vc/jwt/DidJWT.scala | 3 +-- .../identus/shared/crypto/KmpApollo.scala | 10 +++++----- 11 files changed, 16 insertions(+), 23 deletions(-) diff --git a/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/agent/server/jobs/BackgroundJobsHelper.scala b/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/agent/server/jobs/BackgroundJobsHelper.scala index 550c82257a..b97abae44b 100644 --- a/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/agent/server/jobs/BackgroundJobsHelper.scala +++ b/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/agent/server/jobs/BackgroundJobsHelper.scala @@ -12,14 +12,18 @@ import org.hyperledger.identus.pollux.core.model.error.PresentationError import org.hyperledger.identus.pollux.sdjwt.SDJWT.* import org.hyperledger.identus.pollux.vc.jwt.{DIDResolutionFailed, DIDResolutionSucceeded, ES256KSigner, EdSigner, *} import org.hyperledger.identus.pollux.vc.jwt.{DidResolver as JwtDidResolver, Issuer as JwtIssuer} -import org.hyperledger.identus.shared.crypto.{Ed25519KeyPair, Ed25519PublicKey, KmpEd25519KeyOps} -import org.hyperledger.identus.shared.crypto.KmpEd25519KeyOps -import org.hyperledger.identus.shared.crypto.Secp256k1KeyPair -import org.hyperledger.identus.shared.crypto.X25519KeyPair +import org.hyperledger.identus.shared.crypto.{ + Ed25519KeyPair, + Ed25519PublicKey, + KmpEd25519KeyOps, + Secp256k1KeyPair, + X25519KeyPair +} import org.hyperledger.identus.shared.models.WalletAccessContext import zio.{ZIO, ZLayer} import java.util.Base64 + trait BackgroundJobsHelper { def getLongForm( diff --git a/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/pollux/credentialdefinition/controller/CredentialDefinitionController.scala b/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/pollux/credentialdefinition/controller/CredentialDefinitionController.scala index 9437f907ef..3f3b8ffe31 100644 --- a/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/pollux/credentialdefinition/controller/CredentialDefinitionController.scala +++ b/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/pollux/credentialdefinition/controller/CredentialDefinitionController.scala @@ -2,7 +2,6 @@ package org.hyperledger.identus.pollux.credentialdefinition.controller import org.hyperledger.identus.api.http.* import org.hyperledger.identus.api.http.model.{Order, Pagination} -import org.hyperledger.identus.pollux.core.service.CredentialDefinitionServiceError import org.hyperledger.identus.pollux.credentialdefinition.http.{ CredentialDefinitionInput, CredentialDefinitionResponse, diff --git a/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/pollux/credentialschema/controller/CredentialSchemaController.scala b/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/pollux/credentialschema/controller/CredentialSchemaController.scala index e4ce6b7d91..938ddfaed1 100644 --- a/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/pollux/credentialschema/controller/CredentialSchemaController.scala +++ b/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/pollux/credentialschema/controller/CredentialSchemaController.scala @@ -2,7 +2,6 @@ package org.hyperledger.identus.pollux.credentialschema.controller import org.hyperledger.identus.api.http.* import org.hyperledger.identus.api.http.model.{Order, Pagination} -import org.hyperledger.identus.pollux.core.service.CredentialSchemaServiceError import org.hyperledger.identus.pollux.credentialschema.http.{ CredentialSchemaInput, CredentialSchemaResponse, diff --git a/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/verification/controller/http/VcVerificationRequest.scala b/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/verification/controller/http/VcVerificationRequest.scala index fe0bcdcb4c..3cbdb36f7f 100644 --- a/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/verification/controller/http/VcVerificationRequest.scala +++ b/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/verification/controller/http/VcVerificationRequest.scala @@ -4,9 +4,8 @@ import org.hyperledger.identus.api.http.{Annotation, ErrorResponse} import org.hyperledger.identus.pollux.core.service.verification.VcVerificationRequest as ServiceVcVerificationRequest import sttp.tapir.Schema import sttp.tapir.Schema.annotations.{description, encodedExample} -import zio.{IO, *} +import zio.* import zio.json.* -import zio.json.{DeriveJsonDecoder, DeriveJsonEncoder, JsonDecoder, JsonEncoder} import zio.json.ast.Json import zio.json.ast.Json.* diff --git a/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/CredentialDefinitionService.scala b/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/CredentialDefinitionService.scala index 17715d8839..da0e77416e 100644 --- a/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/CredentialDefinitionService.scala +++ b/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/CredentialDefinitionService.scala @@ -1,6 +1,5 @@ package org.hyperledger.identus.pollux.core.service -import org.hyperledger.identus.pollux.core.model.error.CredentialSchemaError import org.hyperledger.identus.pollux.core.model.schema.CredentialDefinition import org.hyperledger.identus.pollux.core.model.schema.CredentialDefinition.* import org.hyperledger.identus.shared.models.WalletAccessContext diff --git a/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/CredentialSchemaService.scala b/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/CredentialSchemaService.scala index da294118a6..f7de9c5663 100644 --- a/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/CredentialSchemaService.scala +++ b/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/CredentialSchemaService.scala @@ -1,9 +1,8 @@ package org.hyperledger.identus.pollux.core.service -import org.hyperledger.identus.pollux.core.model.error.CredentialSchemaError import org.hyperledger.identus.pollux.core.model.schema.CredentialSchema import org.hyperledger.identus.pollux.core.model.schema.CredentialSchema.* -import org.hyperledger.identus.shared.models.{Failure, StatusCode, WalletAccessContext} +import org.hyperledger.identus.shared.models.WalletAccessContext import zio.{IO, ZIO} import java.util.UUID diff --git a/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/CredentialServiceImpl.scala b/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/CredentialServiceImpl.scala index 7f77f74fc2..d544aa24f5 100644 --- a/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/CredentialServiceImpl.scala +++ b/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/CredentialServiceImpl.scala @@ -1,6 +1,5 @@ package org.hyperledger.identus.pollux.core.service -import com.nimbusds.jose.jwk.OctetKeyPair import io.circe.syntax.* import io.circe.Json import org.hyperledger.identus.agent.walletapi.model.{ManagedDIDState, PublicationState} @@ -39,7 +38,6 @@ import zio.prelude.ZValidation import java.net.URI import java.rmi.UnexpectedException import java.time.{Instant, ZoneId} -import java.time.temporal.ChronoUnit import java.util.UUID import scala.language.implicitConversions @@ -600,7 +598,6 @@ private class CredentialServiceImpl( for { ed25519keyPair <- getEd25519SigningKeyPair(jwtIssuerDID, verificationRelationship) } yield { - val octetKeyPair = ed25519keyPair.toOctetKeyPair JwtIssuer( org.hyperledger.identus.pollux.vc.jwt.DID(jwtIssuerDID.toString), EdSigner(ed25519keyPair), diff --git a/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/CredentialServiceNotifier.scala b/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/CredentialServiceNotifier.scala index 91571bd14c..ed51146123 100644 --- a/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/CredentialServiceNotifier.scala +++ b/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/CredentialServiceNotifier.scala @@ -9,7 +9,6 @@ import org.hyperledger.identus.pollux.core.model.{DidCommID, IssueCredentialReco import org.hyperledger.identus.pollux.core.model.error.CredentialServiceError import org.hyperledger.identus.shared.models.WalletAccessContext import zio.{Duration, IO, URLayer, ZIO, ZLayer} -import zio.{IO, URLayer, ZIO, ZLayer} import java.util.UUID diff --git a/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/MockCredentialService.scala b/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/MockCredentialService.scala index 553a46f672..dd3ebd9e27 100644 --- a/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/MockCredentialService.scala +++ b/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/MockCredentialService.scala @@ -8,7 +8,6 @@ import org.hyperledger.identus.pollux.core.model.{DidCommID, IssueCredentialReco import org.hyperledger.identus.pollux.core.model.error.CredentialServiceError import org.hyperledger.identus.shared.models.WalletAccessContext import zio.{mock, Duration, IO, URLayer, ZIO, ZLayer} -import zio.{mock, IO, URLayer, ZIO, ZLayer} import zio.mock.{Mock, Proxy} import java.util.UUID diff --git a/pollux/vc-jwt/src/main/scala/org/hyperledger/identus/pollux/vc/jwt/DidJWT.scala b/pollux/vc-jwt/src/main/scala/org/hyperledger/identus/pollux/vc/jwt/DidJWT.scala index c7bede146e..3e7f5bc815 100644 --- a/pollux/vc-jwt/src/main/scala/org/hyperledger/identus/pollux/vc/jwt/DidJWT.scala +++ b/pollux/vc-jwt/src/main/scala/org/hyperledger/identus/pollux/vc/jwt/DidJWT.scala @@ -3,14 +3,13 @@ package org.hyperledger.identus.pollux.vc.jwt import com.nimbusds.jose.{JWSAlgorithm, JWSHeader} import com.nimbusds.jose.crypto.{ECDSASigner, Ed25519Signer} import com.nimbusds.jose.crypto.bc.BouncyCastleProviderSingleton -import com.nimbusds.jose.jwk.{Curve, ECKey, OctetKeyPair} +import com.nimbusds.jose.jwk.{Curve, ECKey} import com.nimbusds.jwt.{JWTClaimsSet, SignedJWT} import io.circe.* import org.hyperledger.identus.shared.crypto.Ed25519KeyPair import zio.* import java.security.* -import java.util.Base64 opaque type JWT = String diff --git a/shared/crypto/src/main/scala/org/hyperledger/identus/shared/crypto/KmpApollo.scala b/shared/crypto/src/main/scala/org/hyperledger/identus/shared/crypto/KmpApollo.scala index 3df7157a04..1b7b5e464f 100644 --- a/shared/crypto/src/main/scala/org/hyperledger/identus/shared/crypto/KmpApollo.scala +++ b/shared/crypto/src/main/scala/org/hyperledger/identus/shared/crypto/KmpApollo.scala @@ -1,10 +1,10 @@ package org.hyperledger.identus.shared.crypto -import io.iohk.atala.prism.apollo.derivation -import io.iohk.atala.prism.apollo.derivation.MnemonicHelper -import io.iohk.atala.prism.apollo.secp256k1.Secp256k1Lib -import io.iohk.atala.prism.apollo.securerandom.SecureRandom -import io.iohk.atala.prism.apollo.utils.{ +import org.hyperledger.identus.apollo.derivation +import org.hyperledger.identus.apollo.derivation.MnemonicHelper +import org.hyperledger.identus.apollo.secp256k1.Secp256k1Lib +import org.hyperledger.identus.apollo.securerandom.SecureRandom +import org.hyperledger.identus.apollo.utils.{ KMMECSecp256k1PrivateKey, KMMECSecp256k1PublicKey, KMMEdKeyPair,