Skip to content

Commit

Permalink
fix mapping the claims
Browse files Browse the repository at this point in the history
Signed-off-by: mineme0110 <shailesh.patil@iohk.io>
  • Loading branch information
mineme0110 committed Dec 13, 2024
1 parent 248ba5f commit 28f6291
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ object CredentialService {
case Some("application/json") =>
val jsonBytes = java.util.Base64.getUrlDecoder.decode(attr.value.getBytes(StandardCharsets.UTF_8))
new String(jsonBytes, StandardCharsets.UTF_8).fromJson[Json] match
case Right(value) => ZIO.succeed(Json.Obj().add(attr.name, value))
case Right(value) => ZIO.succeed(jsonObject.add(attr.name, value))
case Left(error) => ZIO.fail(VCClaimsValueParsingError(error))

case Some(media_type) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,10 @@ class CredentialServiceImpl(
.fromOption(record.offerCredentialData)
.orElse(ZIO.dieMessage(s"Offer credential data not found in record: ${recordId.value}"))
preview = offerCredentialData.body.credential_preview
_ = println(s"+++++++++++++++++++++$preview")
claims <- CredentialService.convertAttributesToJsonClaims(preview.body.attributes).orDieAsUnmanagedFailure
_ = println(s"+++++++++++++++++++++$claims")

jwtPresentation <- validateRequestCredentialDataProof(maybeOfferOptions, requestJwt)
.tapError(error =>
credentialRepository
Expand Down

0 comments on commit 28f6291

Please sign in to comment.