diff --git a/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/agent/server/jobs/PresentBackgroundJobs.scala b/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/agent/server/jobs/PresentBackgroundJobs.scala index 7a1ba2aff1..c1177b2da2 100644 --- a/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/agent/server/jobs/PresentBackgroundJobs.scala +++ b/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/agent/server/jobs/PresentBackgroundJobs.scala @@ -2,7 +2,11 @@ package org.hyperledger.identus.agent.server.jobs import cats.syntax.all.* import org.hyperledger.identus.agent.server.config.AppConfig -import org.hyperledger.identus.agent.server.jobs.BackgroundJobError.{ErrorResponseReceivedFromPeerAgent, InvalidState, NotImplemented} +import org.hyperledger.identus.agent.server.jobs.BackgroundJobError.{ + ErrorResponseReceivedFromPeerAgent, + InvalidState, + NotImplemented +} import org.hyperledger.identus.agent.walletapi.model.error.{DIDSecretStorageError, GetManagedDIDError} import org.hyperledger.identus.agent.walletapi.service.ManagedDIDService import org.hyperledger.identus.agent.walletapi.storage.DIDNonSecretStorage @@ -21,7 +25,7 @@ import org.hyperledger.identus.pollux.core.model.presentation.Options import org.hyperledger.identus.pollux.core.service.{CredentialService, PresentationService} import org.hyperledger.identus.pollux.core.service.serdes.AnoncredCredentialProofsV1 import org.hyperledger.identus.pollux.sdjwt.{HolderPrivateKey, IssuerPublicKey, PresentationCompact, SDJWT} -import org.hyperledger.identus.pollux.vc.jwt.{JWT, JwtPresentation, DidResolver as JwtDidResolver, Issuer as JwtIssuer} +import org.hyperledger.identus.pollux.vc.jwt.{DidResolver as JwtDidResolver, Issuer as JwtIssuer, JWT, JwtPresentation} import org.hyperledger.identus.pollux.vc.jwt.CredentialSchemaAndTrustedIssuersConstraint import org.hyperledger.identus.resolvers.DIDResolver import org.hyperledger.identus.shared.http.* @@ -1100,7 +1104,8 @@ object PresentBackgroundJobs extends BackgroundJobsHelper { val maybePresentationOptions: Either[PresentationError, Option[Options]] = requestPresentation.attachments.headOption .map(attachment => - attachment.data.toJson.fromJson[JsonData] + attachment.data.toJson + .fromJson[JsonData] .leftMap(err => PresentationDecodingError(s"JsonData decoding error: $err")) .flatMap(data => org.hyperledger.identus.pollux.core.model.presentation.PresentationAttachment.given_JsonDecoder_PresentationAttachment diff --git a/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/agent/server/jobs/StatusListJobs.scala b/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/agent/server/jobs/StatusListJobs.scala index 9ef4c91468..3eb78b2d0b 100644 --- a/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/agent/server/jobs/StatusListJobs.scala +++ b/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/agent/server/jobs/StatusListJobs.scala @@ -16,8 +16,8 @@ import org.hyperledger.identus.shared.messaging.{Message, Producer, WalletIdAndR import org.hyperledger.identus.shared.models.{WalletAccessContext, WalletId} import org.hyperledger.identus.shared.utils.DurationOps.toMetricsSeconds import zio.* -import zio.json.DecoderOps import zio.json.ast.Json +import zio.json.DecoderOps import zio.metrics.Metric import java.util.UUID diff --git a/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/castor/controller/http/Service.scala b/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/castor/controller/http/Service.scala index 3c22f6a220..a58ed658ea 100644 --- a/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/castor/controller/http/Service.scala +++ b/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/castor/controller/http/Service.scala @@ -2,13 +2,13 @@ package org.hyperledger.identus.castor.controller.http import org.hyperledger.identus.api.http.Annotation import org.hyperledger.identus.castor.controller.http.Service.annotations +import org.hyperledger.identus.castor.core.model.{did as castorDomain, ProtoModelHelper} import org.hyperledger.identus.castor.core.model.did.w3c -import org.hyperledger.identus.castor.core.model.{ProtoModelHelper, did as castorDomain} import org.hyperledger.identus.shared.utils.Traverse.* import sttp.tapir.Schema import sttp.tapir.Schema.annotations.{description, encodedExample} -import zio.json.ast.Json import zio.json.{DeriveJsonDecoder, DeriveJsonEncoder, EncoderOps, JsonDecoder, JsonEncoder} +import zio.json.ast.Json import scala.language.implicitConversions diff --git a/cloud-agent/service/server/src/test/scala/org/hyperledger/identus/verification/controller/VcVerificationControllerImplSpec.scala b/cloud-agent/service/server/src/test/scala/org/hyperledger/identus/verification/controller/VcVerificationControllerImplSpec.scala index eb753af53e..5847996fa5 100644 --- a/cloud-agent/service/server/src/test/scala/org/hyperledger/identus/verification/controller/VcVerificationControllerImplSpec.scala +++ b/cloud-agent/service/server/src/test/scala/org/hyperledger/identus/verification/controller/VcVerificationControllerImplSpec.scala @@ -8,15 +8,15 @@ import org.hyperledger.identus.pollux.vc.jwt.* import org.hyperledger.identus.pollux.vc.jwt.CredentialPayload.Implicits.* import org.hyperledger.identus.shared.json.JsonInterop import org.hyperledger.identus.verification.controller.http.* -import sttp.client3.{DeserializationException, Response, UriContext, basicRequest} +import sttp.client3.{basicRequest, DeserializationException, Response, UriContext} import sttp.client3.ziojson.* import sttp.model.StatusCode import zio.* +import zio.json.ast.Json import zio.json.EncoderOps import zio.test.* import zio.test.Assertion.* import zio.Config.OffsetDateTime -import zio.json.ast.Json import java.time.Instant @@ -47,11 +47,13 @@ object VcVerificationControllerImplSpec extends ZIOSpecDefault with VcVerificati `type` = "JsonSchemaValidator2018" ) ), - credentialSubject = JsonInterop.toCirceJsonAst(Json.Obj( - "userName" -> Json.Str("Bob"), - "age" -> Json.Num(42), - "email" -> Json.Str("email") - )), + credentialSubject = JsonInterop.toCirceJsonAst( + Json.Obj( + "userName" -> Json.Str("Bob"), + "age" -> Json.Num(42), + "email" -> Json.Str("email") + ) + ), maybeCredentialStatus = Some( CredentialStatus( id = "did:work:MDP8AsFhHzhwUvGNuYkX7T;id=06e126d1-fa44-4882-a243-1e326fbe21db;version=1.0", diff --git a/mercury/protocol-issue-credential/src/test/scala/org/hyperledger/identus/mercury/protocol/anotherclasspath/UtilsCredentialSpec.scala b/mercury/protocol-issue-credential/src/test/scala/org/hyperledger/identus/mercury/protocol/anotherclasspath/UtilsCredentialSpec.scala index 2cae3e032a..7dfdb4f4e4 100644 --- a/mercury/protocol-issue-credential/src/test/scala/org/hyperledger/identus/mercury/protocol/anotherclasspath/UtilsCredentialSpec.scala +++ b/mercury/protocol-issue-credential/src/test/scala/org/hyperledger/identus/mercury/protocol/anotherclasspath/UtilsCredentialSpec.scala @@ -2,7 +2,17 @@ package org.hyperledger.identus.mercury.protocol.anotherclasspath import munit.* import org.hyperledger.identus.mercury.model.{AttachmentDescriptor, DidId} -import org.hyperledger.identus.mercury.protocol.issuecredential.{CredentialPreview, IssueCredential, IssueCredentialIssuedFormat, IssueCredentialOfferFormat, IssueCredentialProposeFormat, IssueCredentialRequestFormat, OfferCredential, ProposeCredential, RequestCredential} +import org.hyperledger.identus.mercury.protocol.issuecredential.{ + CredentialPreview, + IssueCredential, + IssueCredentialIssuedFormat, + IssueCredentialOfferFormat, + IssueCredentialProposeFormat, + IssueCredentialRequestFormat, + OfferCredential, + ProposeCredential, + RequestCredential +} import zio.json.{DeriveJsonDecoder, DeriveJsonEncoder, EncoderOps, JsonDecoder, JsonEncoder} private case class TestCredentialType(a: String, b: Int, x: Long, name: String, dob: String) @@ -37,8 +47,7 @@ class UtilsCredentialSpec extends ZSuite { .build( fromDID = DidId("did:prism:test123from"), toDID = DidId("did:prism:test123to"), - credentials = - Seq(IssueCredentialIssuedFormat.Unsupported(nameCredentialType) -> credential.toJson.getBytes()), + credentials = Seq(IssueCredentialIssuedFormat.Unsupported(nameCredentialType) -> credential.toJson.getBytes()), ) .makeMessage @@ -61,8 +70,7 @@ class UtilsCredentialSpec extends ZSuite { fromDID = DidId("did:prism:test123from"), toDID = DidId("did:prism:test123to"), credential_preview = credentialPreview, - credentials = - Seq(IssueCredentialOfferFormat.Unsupported(nameCredentialType) -> credential.toJson.getBytes()), + credentials = Seq(IssueCredentialOfferFormat.Unsupported(nameCredentialType) -> credential.toJson.getBytes()), ) .makeMessage @@ -85,8 +93,7 @@ class UtilsCredentialSpec extends ZSuite { fromDID = DidId("did:prism:test123from"), toDID = DidId("did:prism:test123to"), credential_preview = Some(credentialPreview), - credentials = - Seq(IssueCredentialProposeFormat.Unsupported(nameCredentialType) -> credential.toJson.getBytes()), + credentials = Seq(IssueCredentialProposeFormat.Unsupported(nameCredentialType) -> credential.toJson.getBytes()), ) .makeMessage @@ -107,8 +114,7 @@ class UtilsCredentialSpec extends ZSuite { .build( fromDID = DidId("did:prism:test123from"), toDID = DidId("did:prism:test123to"), - credentials = - Seq(IssueCredentialRequestFormat.Unsupported(nameCredentialType) -> credential.toJson.getBytes()), + credentials = Seq(IssueCredentialRequestFormat.Unsupported(nameCredentialType) -> credential.toJson.getBytes()), ) .makeMessage diff --git a/mercury/resolver/src/test/scala/org/hyperledger/identus/resolvers/PeerDidResolverSpec.scala b/mercury/resolver/src/test/scala/org/hyperledger/identus/resolvers/PeerDidResolverSpec.scala index 39df5840ef..ff1385ddab 100644 --- a/mercury/resolver/src/test/scala/org/hyperledger/identus/resolvers/PeerDidResolverSpec.scala +++ b/mercury/resolver/src/test/scala/org/hyperledger/identus/resolvers/PeerDidResolverSpec.scala @@ -1,8 +1,8 @@ package org.hyperledger.identus.resolvers import munit.* import org.didcommx.peerdid.* -import zio.json.DecoderOps import zio.json.ast.Json +import zio.json.DecoderOps import scala.jdk.CollectionConverters.* 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 01b7fb4c5c..f086bac1b9 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 @@ -11,8 +11,8 @@ import org.hyperledger.identus.pollux.core.model.schema.CredentialSchemaRef import org.hyperledger.identus.pollux.core.repository.CredentialRepository import org.hyperledger.identus.pollux.vc.jwt.Issuer import org.hyperledger.identus.shared.models.* -import zio.json.ast.Json import zio.{Duration, UIO, URIO, URLayer, ZIO, ZLayer} +import zio.json.ast.Json import java.util.UUID diff --git a/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/repository/PresentationExchangeRepositorySpecSuite.scala b/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/repository/PresentationExchangeRepositorySpecSuite.scala index fa96e3c063..2ec37a21c0 100644 --- a/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/repository/PresentationExchangeRepositorySpecSuite.scala +++ b/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/repository/PresentationExchangeRepositorySpecSuite.scala @@ -2,8 +2,8 @@ package org.hyperledger.identus.pollux.core.repository import org.hyperledger.identus.pollux.prex.PresentationDefinition import org.hyperledger.identus.shared.models.{WalletAccessContext, WalletId} +import zio.{durationInt, ZIO, ZLayer} import zio.json.{DecoderOps, DeriveJsonDecoder, JsonDecoder} -import zio.{ZIO, ZLayer, durationInt} import zio.test.* import zio.test.Assertion.* diff --git a/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/service/MockCredentialService.scala b/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/service/MockCredentialService.scala index fd0de8d5ec..32fbf4b8dc 100644 --- a/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/service/MockCredentialService.scala +++ b/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/service/MockCredentialService.scala @@ -9,8 +9,8 @@ import org.hyperledger.identus.pollux.core.model.error.CredentialServiceError.* import org.hyperledger.identus.pollux.core.model.schema.CredentialSchemaRef import org.hyperledger.identus.pollux.vc.jwt.Issuer import org.hyperledger.identus.shared.models.* +import zio.{mock, Duration, IO, UIO, URIO, URLayer, ZIO, ZLayer} import zio.json.ast.Json -import zio.{Duration, IO, UIO, URIO, URLayer, ZIO, ZLayer, mock} import zio.mock.{Mock, Proxy} import java.util.UUID diff --git a/pollux/vc-jwt/src/main/scala/org/hyperledger/identus/pollux/vc/jwt/DidResolver.scala b/pollux/vc-jwt/src/main/scala/org/hyperledger/identus/pollux/vc/jwt/DidResolver.scala index 20c15013a8..49a3230f3e 100644 --- a/pollux/vc-jwt/src/main/scala/org/hyperledger/identus/pollux/vc/jwt/DidResolver.scala +++ b/pollux/vc-jwt/src/main/scala/org/hyperledger/identus/pollux/vc/jwt/DidResolver.scala @@ -1,7 +1,15 @@ package org.hyperledger.identus.pollux.vc.jwt import io.circe.Json -import org.hyperledger.identus.castor.core.model.did.w3c.{DIDDocumentRepr, DIDResolutionErrorRepr, PublicKeyJwk, PublicKeyRepr, PublicKeyReprOrRef, ServiceRepr, makeW3CResolver} +import org.hyperledger.identus.castor.core.model.did.w3c.{ + makeW3CResolver, + DIDDocumentRepr, + DIDResolutionErrorRepr, + PublicKeyJwk, + PublicKeyRepr, + PublicKeyReprOrRef, + ServiceRepr +} import org.hyperledger.identus.castor.core.service.DIDService import org.hyperledger.identus.shared.json.JsonInterop import zio.*