From ee22c873f9224d31bbeca803e0dc6444aa56b49f Mon Sep 17 00:00:00 2001 From: Bassam Riman Date: Mon, 16 Sep 2024 10:26:49 -0400 Subject: [PATCH] ATL-7666: Preserve Presentation Format Signed-off-by: Bassam Riman --- .../server/jobs/PresentBackgroundJobs.scala | 11 +++- .../PresentProofControllerImpl.scala | 7 ++- .../http/RequestPresentationInput.scala | 20 +++++++ .../presentproof/PresentFormats.scala | 11 ++-- .../core/service/PresentationService.scala | 3 ++ .../service/PresentationServiceImpl.scala | 52 +++++++++++++------ .../service/PresentationServiceNotifier.scala | 13 ++--- .../service/MockPresentationService.scala | 10 ++++ .../PresentationServiceNotifierSpec.scala | 1 + .../service/PresentationServiceSpec.scala | 2 + .../PresentationServiceSpecHelper.scala | 4 +- 11 files changed, 106 insertions(+), 28 deletions(-) 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 85106e084f..307e974088 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 @@ -706,11 +706,18 @@ object PresentBackgroundJobs extends BackgroundJobsHelper { goal_code = requestPresentation.body.goal_code, comment = requestPresentation.body.comment ), - attachments = Seq( + attachments = requestPresentation.attachments.map(attachment => AttachmentDescriptor .buildBase64Attachment( payload = signedJwtPresentation.value.getBytes(), - mediaType = Some(PresentCredentialFormat.JWT.name) + mediaType = attachment.media_type, + format = attachment.format.map { + case PresentCredentialRequestFormat.JWT.name => PresentCredentialFormat.JWT.name + case format => + throw throw RuntimeException( + s"Unexpected PresentCredentialRequestFormat=$format. Expecting: ${PresentCredentialRequestFormat.JWT.name}" + ) + } ) ), thid = requestPresentation.thid.orElse(Some(requestPresentation.id)), diff --git a/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/presentproof/controller/PresentProofControllerImpl.scala b/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/presentproof/controller/PresentProofControllerImpl.scala index 11adbd36f6..0d1a8ff81b 100644 --- a/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/presentproof/controller/PresentProofControllerImpl.scala +++ b/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/presentproof/controller/PresentProofControllerImpl.scala @@ -8,7 +8,7 @@ import org.hyperledger.identus.api.http.model.PaginationInput import org.hyperledger.identus.connect.core.model.error.ConnectionServiceError import org.hyperledger.identus.connect.core.service.ConnectionService import org.hyperledger.identus.mercury.model.DidId -import org.hyperledger.identus.mercury.protocol.presentproof.ProofType +import org.hyperledger.identus.mercury.protocol.presentproof.{PresentCredentialRequestFormat, ProofType} import org.hyperledger.identus.pollux.core.model.{CredentialFormat, DidCommID, PresentationRecord} import org.hyperledger.identus.pollux.core.model.error.PresentationError import org.hyperledger.identus.pollux.core.model.presentation.Options @@ -80,6 +80,7 @@ class PresentProofControllerImpl( request.options.map(o => Options(o.challenge, o.domain)), request.claims, request.anoncredPresentationRequest, + request.presentationFormat, request.goalCode, request.goal, expirationDuration @@ -95,6 +96,7 @@ class PresentProofControllerImpl( options: Option[Options], claims: Option[zio.json.ast.Json.Obj], anoncredPresentationRequest: Option[AnoncredPresentationRequestV1], + presentationFormat: Option[PresentCredentialRequestFormat], goalCode: Option[String], goal: Option[String], expirationDuration: Option[Duration], @@ -115,6 +117,7 @@ class PresentProofControllerImpl( ) }, options = options, + presentationFormat = presentationFormat.getOrElse(PresentCredentialRequestFormat.JWT), goalCode = goalCode, goal = goal, expirationDuration = expirationDuration, @@ -136,6 +139,7 @@ class PresentProofControllerImpl( }, claimsToDisclose = claimsToDisclose, options = options, + presentationFormat = presentationFormat.getOrElse(PresentCredentialRequestFormat.SDJWT), goalCode = goalCode, goal = goal, expirationDuration = expirationDuration, @@ -156,6 +160,7 @@ class PresentProofControllerImpl( thid = DidCommID(), connectionId = connectionId, presentationRequest = presentationRequest, + presentationFormat = presentationFormat.getOrElse(PresentCredentialRequestFormat.Anoncred), goalCode = goalCode, goal = goal, expirationDuration = expirationDuration, diff --git a/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/presentproof/controller/http/RequestPresentationInput.scala b/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/presentproof/controller/http/RequestPresentationInput.scala index acf486f33d..695094e2e1 100644 --- a/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/presentproof/controller/http/RequestPresentationInput.scala +++ b/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/presentproof/controller/http/RequestPresentationInput.scala @@ -1,6 +1,7 @@ package org.hyperledger.identus.presentproof.controller.http import org.hyperledger.identus.api.http.Annotation +import org.hyperledger.identus.mercury.protocol.presentproof.PresentCredentialRequestFormat import org.hyperledger.identus.pollux.core.service.serdes.* import org.hyperledger.identus.presentproof.controller.http.RequestPresentationInput.annotations import sttp.tapir.{Schema, Validator} @@ -29,6 +30,9 @@ final case class RequestPresentationInput( @description(annotations.anoncredPresentationRequest.description) @encodedExample(annotations.anoncredPresentationRequest.example) anoncredPresentationRequest: Option[AnoncredPresentationRequestV1], + @description(annotations.presentationFormat.description) + @encodedExample(annotations.presentationFormat.example) + presentationFormat: Option[PresentCredentialRequestFormat], @description(annotations.claims.description) @encodedExample(annotations.claims.example) claims: Option[zio.json.ast.Json.Obj], @@ -128,6 +132,20 @@ object RequestPresentationInput { ) ) ) + + object presentationFormat + extends Annotation[Option[String]]( + description = + "The presentation format to display in Didcomm messages (default to 'prism/jwt', vc+sd-jwt or anoncreds/proof-request@v1.0)", + example = Some("prism/jwt"), + validator = Validator.enumeration( + List( + Some("prism/jwt"), + Some("vc+sd-jwt"), + Some("anoncreds/proof-request@v1.0") + ) + ) + ) object claims extends Annotation[Option[zio.json.ast.Json.Obj]]( description = """ @@ -163,6 +181,8 @@ object RequestPresentationInput { import AnoncredPresentationRequestV1.given + given Schema[PresentCredentialRequestFormat] = Schema.derivedEnumeration.defaultStringBased + given Schema[AnoncredPresentationRequestV1] = Schema.derived given Schema[AnoncredRequestedAttributeV1] = Schema.derived diff --git a/mercury/protocol-present-proof/src/main/scala/org/hyperledger/identus/mercury/protocol/presentproof/PresentFormats.scala b/mercury/protocol-present-proof/src/main/scala/org/hyperledger/identus/mercury/protocol/presentproof/PresentFormats.scala index 602d46a479..c7dda85da6 100644 --- a/mercury/protocol-present-proof/src/main/scala/org/hyperledger/identus/mercury/protocol/presentproof/PresentFormats.scala +++ b/mercury/protocol-present-proof/src/main/scala/org/hyperledger/identus/mercury/protocol/presentproof/PresentFormats.scala @@ -2,6 +2,7 @@ package org.hyperledger.identus.mercury.protocol.presentproof import io.circe.{Decoder, Encoder} import io.circe.generic.semiauto.* +import zio.json.{DeriveJsonDecoder, DeriveJsonEncoder, JsonDecoder, JsonEncoder} /* Present Credential Formats: @@ -72,8 +73,6 @@ object PresentCredentialProposeFormat { * - dif/presentation-exchange/definitions@v1.0 */ enum PresentCredentialRequestFormat(val name: String) { - case Unsupported(other: String) extends PresentCredentialRequestFormat(other) - // case JWT extends PresentCredentialRequestFormat("jwt/proof-request@v1.0") // TODO FOLLOW specs for JWT VC case JWT extends PresentCredentialRequestFormat("prism/jwt") // TODO REMOVE case SDJWT extends PresentCredentialRequestFormat("vc+sd-jwt") case Anoncred extends PresentCredentialRequestFormat("anoncreds/proof-request@v1.0") @@ -82,6 +81,13 @@ enum PresentCredentialRequestFormat(val name: String) { object PresentCredentialRequestFormat { given Encoder[PresentCredentialRequestFormat] = deriveEncoder[PresentCredentialRequestFormat] given Decoder[PresentCredentialRequestFormat] = deriveDecoder[PresentCredentialRequestFormat] + + given JsonEncoder[PresentCredentialRequestFormat] = + DeriveJsonEncoder.gen[PresentCredentialRequestFormat] + + given JsonDecoder[PresentCredentialRequestFormat] = + DeriveJsonDecoder.gen[PresentCredentialRequestFormat] + } /** Present Credential: @@ -98,7 +104,6 @@ object PresentCredentialRequestFormat { * - dif/presentation-exchange/submission@v1.0 */ enum PresentCredentialFormat(val name: String) { - case Unsupported(other: String) extends PresentCredentialFormat(other) // case JWT extends PresentCredentialFormat("jwt/proof-request@v1.0") // TODO FOLLOW specs for JWT VC case JWT extends PresentCredentialFormat("prism/jwt") // TODO REMOVE case SDJWT extends PresentCredentialFormat("vc+sd-jwt") diff --git a/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/PresentationService.scala b/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/PresentationService.scala index d3c3781cf2..94aa1af79b 100644 --- a/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/PresentationService.scala +++ b/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/PresentationService.scala @@ -26,6 +26,7 @@ trait PresentationService { connectionId: Option[String], proofTypes: Seq[ProofType], options: Option[org.hyperledger.identus.pollux.core.model.presentation.Options], + presentationFormat: PresentCredentialRequestFormat, goalCode: Option[String], goal: Option[String], expirationDuration: Option[Duration], @@ -39,6 +40,7 @@ trait PresentationService { proofTypes: Seq[ProofType], claimsToDisclose: ast.Json.Obj, options: Option[org.hyperledger.identus.pollux.core.model.presentation.Options], + presentationFormat: PresentCredentialRequestFormat, goalCode: Option[String], goal: Option[String], expirationDuration: Option[Duration], @@ -50,6 +52,7 @@ trait PresentationService { thid: DidCommID, connectionId: Option[String], presentationRequest: AnoncredPresentationRequestV1, + presentationFormat: PresentCredentialRequestFormat, goalCode: Option[String], goal: Option[String], expirationDuration: Option[Duration], diff --git a/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/PresentationServiceImpl.scala b/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/PresentationServiceImpl.scala index edecea22e8..67d68b928c 100644 --- a/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/PresentationServiceImpl.scala +++ b/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/PresentationServiceImpl.scala @@ -189,11 +189,18 @@ private class PresentationServiceImpl( goal_code = requestPresentation.body.goal_code, comment = requestPresentation.body.comment ), - attachments = Seq( + attachments = requestPresentation.attachments.map(attachment => AttachmentDescriptor .buildBase64Attachment( - payload = presentationPayload.compact.getBytes, - mediaType = Some(PresentCredentialFormat.SDJWT.name) + payload = presentationPayload.compact.getBytes(), + mediaType = attachment.media_type, + format = attachment.format.map { + case PresentCredentialRequestFormat.SDJWT.name => PresentCredentialFormat.SDJWT.name + case format => + throw throw RuntimeException( + s"Unexpected PresentCredentialRequestFormat=$format. Expecting: ${PresentCredentialRequestFormat.SDJWT.name}" + ) + } ) ), thid = requestPresentation.thid.orElse(Some(requestPresentation.id)), @@ -259,12 +266,18 @@ private class PresentationServiceImpl( goal_code = requestPresentation.body.goal_code, comment = requestPresentation.body.comment ), - attachments = Seq( + attachments = requestPresentation.attachments.map(attachment => AttachmentDescriptor .buildBase64Attachment( payload = presentationPayload.data.getBytes(), - mediaType = Some(PresentCredentialFormat.Anoncred.name), - format = Some(PresentCredentialFormat.Anoncred.name), + mediaType = attachment.media_type, + format = attachment.format.map { + case PresentCredentialRequestFormat.Anoncred.name => PresentCredentialFormat.Anoncred.name + case format => + throw throw RuntimeException( + s"Unexpected PresentCredentialRequestFormat=$format. Expecting: ${PresentCredentialRequestFormat.Anoncred.name}" + ) + } ) ), thid = requestPresentation.thid.orElse(Some(requestPresentation.id)), @@ -310,6 +323,7 @@ private class PresentationServiceImpl( connectionId: Option[String], proofTypes: Seq[ProofType], options: Option[org.hyperledger.identus.pollux.core.model.presentation.Options], + presentationFormat: PresentCredentialRequestFormat, goalCode: Option[String] = None, goal: Option[String] = None, expirationDuration: Option[Duration] = None, @@ -321,7 +335,7 @@ private class PresentationServiceImpl( connectionId, CredentialFormat.JWT, proofTypes, - options.map(o => Seq(toJWTAttachment(o))).getOrElse(Seq.empty), + options.map(o => Seq(toJWTAttachment(o, presentationFormat))).getOrElse(Seq.empty), goalCode, goal, expirationDuration @@ -336,6 +350,7 @@ private class PresentationServiceImpl( proofTypes: Seq[ProofType], claimsToDisclose: ast.Json.Obj, options: Option[org.hyperledger.identus.pollux.core.model.presentation.Options], + presentationFormat: PresentCredentialRequestFormat, goalCode: Option[String] = None, goal: Option[String] = None, expirationDuration: Option[Duration] = None, @@ -347,7 +362,7 @@ private class PresentationServiceImpl( connectionId, CredentialFormat.SDJWT, proofTypes, - attachments = Seq(toSDJWTAttachment(options, claimsToDisclose)), + attachments = Seq(toSDJWTAttachment(options, claimsToDisclose, presentationFormat)), goalCode, goal, expirationDuration @@ -360,6 +375,7 @@ private class PresentationServiceImpl( thid: DidCommID, connectionId: Option[String], presentationRequest: AnoncredPresentationRequestV1, + presentationFormat: PresentCredentialRequestFormat, goalCode: Option[String] = None, goal: Option[String] = None, expirationDuration: Option[Duration] = None, @@ -371,7 +387,7 @@ private class PresentationServiceImpl( connectionId, CredentialFormat.AnonCreds, Seq.empty, - Seq(toAnoncredAttachment(presentationRequest)), + Seq(toAnoncredAttachment(presentationRequest, presentationFormat)), goalCode, goal, expirationDuration @@ -1160,30 +1176,36 @@ private class PresentationServiceImpl( } yield record } - private def toJWTAttachment(options: Options): AttachmentDescriptor = { + private def toJWTAttachment( + options: Options, + presentationFormat: PresentCredentialRequestFormat + ): AttachmentDescriptor = { AttachmentDescriptor.buildJsonAttachment( payload = PresentationAttachment.build(Some(options)), - format = Some(PresentCredentialRequestFormat.JWT.name) + format = Some(presentationFormat.name), + mediaType = Some("application/json") ) } private def toSDJWTAttachment( options: Option[Options], - claimsToDsiclose: ast.Json.Obj + claimsToDsiclose: ast.Json.Obj, + presentationFormat: PresentCredentialRequestFormat ): AttachmentDescriptor = { AttachmentDescriptor.buildBase64Attachment( mediaType = Some("application/json"), - format = Some(PresentCredentialRequestFormat.SDJWT.name), + format = Some(presentationFormat.name), payload = SDJwtPresentation(options, claimsToDsiclose).toJson.getBytes ) } private def toAnoncredAttachment( - presentationRequest: AnoncredPresentationRequestV1 + presentationRequest: AnoncredPresentationRequestV1, + presentationFormat: PresentCredentialRequestFormat ): AttachmentDescriptor = { AttachmentDescriptor.buildBase64Attachment( mediaType = Some("application/json"), - format = Some(PresentCredentialRequestFormat.Anoncred.name), + format = Some(presentationFormat.name), payload = AnoncredPresentationRequestV1.schemaSerDes.serializeToJsonString(presentationRequest).getBytes() ) } diff --git a/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/PresentationServiceNotifier.scala b/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/PresentationServiceNotifier.scala index ce4b3ab333..80d358cdbf 100644 --- a/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/PresentationServiceNotifier.scala +++ b/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/PresentationServiceNotifier.scala @@ -2,12 +2,7 @@ package org.hyperledger.identus.pollux.core.service import org.hyperledger.identus.event.notification.{Event, EventNotificationService} import org.hyperledger.identus.mercury.model.DidId -import org.hyperledger.identus.mercury.protocol.presentproof.{ - Presentation, - ProofType, - ProposePresentation, - RequestPresentation -} +import org.hyperledger.identus.mercury.protocol.presentproof.* import org.hyperledger.identus.pollux.anoncreds.AnoncredPresentation import org.hyperledger.identus.pollux.core.model.{DidCommID, PresentationRecord} import org.hyperledger.identus.pollux.core.model.error.PresentationError @@ -38,6 +33,7 @@ class PresentationServiceNotifier( connectionId: Option[String], proofTypes: Seq[ProofType], options: Option[Options], + presentationFormat: PresentCredentialRequestFormat, goalCode: Option[String], goal: Option[String], expirationTime: Option[Duration], @@ -50,6 +46,7 @@ class PresentationServiceNotifier( connectionId, proofTypes, options, + presentationFormat, goalCode, goal, expirationTime @@ -64,6 +61,7 @@ class PresentationServiceNotifier( proofTypes: Seq[ProofType], claimsToDisclose: ast.Json.Obj, options: Option[org.hyperledger.identus.pollux.core.model.presentation.Options], + presentationFormat: PresentCredentialRequestFormat, goalCode: Option[String], goal: Option[String], expirationTime: Option[Duration], @@ -77,6 +75,7 @@ class PresentationServiceNotifier( proofTypes, claimsToDisclose, options, + presentationFormat, goalCode, goal, expirationTime @@ -89,6 +88,7 @@ class PresentationServiceNotifier( thid: DidCommID, connectionId: Option[String], presentationRequest: AnoncredPresentationRequestV1, + presentationFormat: PresentCredentialRequestFormat, goalCode: Option[String], goal: Option[String], expirationTime: Option[Duration], @@ -100,6 +100,7 @@ class PresentationServiceNotifier( thid, connectionId, presentationRequest, + presentationFormat, goalCode, goal, expirationTime diff --git a/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/service/MockPresentationService.scala b/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/service/MockPresentationService.scala index ba9549a691..4f58c2f570 100644 --- a/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/service/MockPresentationService.scala +++ b/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/service/MockPresentationService.scala @@ -2,6 +2,7 @@ package org.hyperledger.identus.pollux.core.service import org.hyperledger.identus.mercury.model.DidId import org.hyperledger.identus.mercury.protocol.presentproof.{ + PresentCredentialRequestFormat, Presentation, ProofType, ProposePresentation, @@ -33,6 +34,7 @@ object MockPresentationService extends Mock[PresentationService] { Option[String], Seq[ProofType], Option[Options], + PresentCredentialRequestFormat, Option[String], Option[String], Option[Duration] @@ -50,6 +52,7 @@ object MockPresentationService extends Mock[PresentationService] { Seq[ProofType], ast.Json.Obj, Option[Options], + PresentCredentialRequestFormat, Option[String], Option[String], Option[Duration] @@ -66,6 +69,7 @@ object MockPresentationService extends Mock[PresentationService] { DidCommID, Option[String], AnoncredPresentationRequestV1, + PresentCredentialRequestFormat, Option[String], Option[String], Option[Duration] @@ -129,6 +133,7 @@ object MockPresentationService extends Mock[PresentationService] { connectionId: Option[String], proofTypes: Seq[ProofType], options: Option[Options], + presentationFormat: PresentCredentialRequestFormat, goalCode: Option[String], goal: Option[String], expirationTime: Option[Duration] @@ -142,6 +147,7 @@ object MockPresentationService extends Mock[PresentationService] { connectionId, proofTypes, options, + presentationFormat, goalCode, goal, expirationTime @@ -156,6 +162,7 @@ object MockPresentationService extends Mock[PresentationService] { proofTypes: Seq[ProofType], claimsToDisclose: ast.Json.Obj, options: Option[org.hyperledger.identus.pollux.core.model.presentation.Options], + presentationFormat: PresentCredentialRequestFormat, goalCode: Option[String], goal: Option[String], expirationTime: Option[Duration] @@ -170,6 +177,7 @@ object MockPresentationService extends Mock[PresentationService] { proofTypes, claimsToDisclose, options, + presentationFormat, goalCode, goal, expirationTime @@ -182,6 +190,7 @@ object MockPresentationService extends Mock[PresentationService] { thid: DidCommID, connectionId: Option[String], presentationRequest: AnoncredPresentationRequestV1, + presentationFormat: PresentCredentialRequestFormat, goalCode: Option[String], goal: Option[String], expirationTime: Option[Duration] @@ -194,6 +203,7 @@ object MockPresentationService extends Mock[PresentationService] { thid, connectionId, presentationRequest, + presentationFormat, goalCode, goal, expirationTime diff --git a/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/service/PresentationServiceNotifierSpec.scala b/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/service/PresentationServiceNotifierSpec.scala index eeb66d593d..8f4197a57a 100644 --- a/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/service/PresentationServiceNotifierSpec.scala +++ b/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/service/PresentationServiceNotifierSpec.scala @@ -117,6 +117,7 @@ object PresentationServiceNotifierSpec extends ZIOSpecDefault with PresentationS None, Seq.empty, None, + PresentCredentialRequestFormat.JWT, None, None, None diff --git a/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/service/PresentationServiceSpec.scala b/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/service/PresentationServiceSpec.scala index 1b84f45743..b1feb03cd2 100644 --- a/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/service/PresentationServiceSpec.scala +++ b/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/service/PresentationServiceSpec.scala @@ -75,6 +75,7 @@ object PresentationServiceSpec extends ZIOSpecDefault with PresentationServiceSp Some(connectionId), proofTypes, options, + PresentCredentialRequestFormat.JWT, None, None, None, @@ -143,6 +144,7 @@ object PresentationServiceSpec extends ZIOSpecDefault with PresentationServiceSp thid, Some(connectionId), anoncredPresentationRequestV1, + PresentCredentialRequestFormat.Anoncred, None, None, None diff --git a/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/service/PresentationServiceSpecHelper.scala b/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/service/PresentationServiceSpecHelper.scala index e6ea65d26c..8e08c6445f 100644 --- a/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/service/PresentationServiceSpecHelper.scala +++ b/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/service/PresentationServiceSpecHelper.scala @@ -171,6 +171,7 @@ trait PresentationServiceSpecHelper { connectionId = Some("connectionId"), proofTypes = Seq(proofType), options = options, + presentationFormat = PresentCredentialRequestFormat.JWT, goalCode = None, goal = None, expirationDuration = None @@ -215,7 +216,8 @@ trait PresentationServiceSpecHelper { pairwiseVerifierDID = pairwiseVerifierDID, pairwiseProverDID = Some(pairwiseProverDID), connectionId = Some("connectionId"), - anoncredPresentationRequestV1, + presentationRequest = anoncredPresentationRequestV1, + presentationFormat = PresentCredentialRequestFormat.Anoncred, goalCode = None, goal = None, expirationDuration = None