Skip to content

Commit

Permalink
address the pr comments
Browse files Browse the repository at this point in the history
Signed-off-by: Shailesh Patil <[email protected]>
  • Loading branch information
Shailesh Patil committed Dec 20, 2022
1 parent 22494ed commit 53a69d0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -555,12 +555,15 @@ private class CredentialServiceImpl(
)
// TODO: get schema when schema registry is available if schema ID is provided
credential = W3cCredentialPayload(
`@context` = Set("https://www.w3.org/2018/credentials/v1"), // TODO: his information should come from Schema registry by record.schemaId
`@context` = Set(
"https://www.w3.org/2018/credentials/v1"
), // TODO: his information should come from Schema registry by record.schemaId
maybeId = None,
`type` = Set("PassportVC"), // TODO: This information should come from Schema registry by record.schemaId
`type` =
Set("VerifiableCredential"), // TODO: This information should come from Schema registry by record.schemaId
issuer = issuer.did,
issuanceDate = issuanceDate,
maybeExpirationDate =None,
maybeExpirationDate = record.validityPeriod.map(sec => issuanceDate.plusSeconds(sec.toLong)),
maybeCredentialSchema = None,
credentialSubject = claims.updated("id", record.subjectId).asJson,
maybeCredentialStatus = None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,10 @@ private class PresentationServiceImpl(

val verifiableCredentials = issuedCredentials.map { issuedCredential =>
decode[io.iohk.atala.mercury.model.Base64](issuedCredential.signedCredential)
.map(x => new String(java.util.Base64.getDecoder().decode(x.base64)))
.map(_.drop(1).dropRight(1))
.map( x =>
JwtVerifiableCredentialPayload(JWT(x))
).getOrElse(???)
.map(x => new String(java.util.Base64.getDecoder().decode(x.base64)))
.map(_.drop(1).dropRight(1))
.map(x => JwtVerifiableCredentialPayload(JWT(x)))
.getOrElse(???)
}.toVector

val w3cPresentationPayload =
Expand Down Expand Up @@ -319,7 +318,7 @@ private class PresentationServiceImpl(
record <- presentationRepository
.getPresentationRecord(record.id)
.mapError(RepositoryError.apply)

} yield record
}

Expand Down Expand Up @@ -431,14 +430,6 @@ private class PresentationServiceImpl(
} yield record
}

// override def verifyPresentation(presentation: Presentation): IO[PresentationError, Option[PresentationRecord]] = {
// for {
// presentation
// _ <- ZIO.log(s"Verifying Presentation.......")

// } yield ()
// }

private[this] def createDidCommRequestPresentation(
proofTypes: Seq[ProofType],
thid: UUID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ object JWTVerification {
curve <- publicKeyJwk.crv
x <- publicKeyJwk.x.map(Base64URL.from)
y <- publicKeyJwk.y.map(Base64URL.from)
// d <- publicKeyJwk.d.map(Base64URL.from)
} yield new ECKey.Builder(Curve.parse(curve), x, y).build().toPublicKey
Validation.fromOptionWith("Unable to parse Public Key")(maybePublicKey)
}
Expand Down

0 comments on commit 53a69d0

Please sign in to comment.