Skip to content

Commit

Permalink
feat(prism-agent): update pollux from 0.33.0 to 0.35.0 (#410)
Browse files Browse the repository at this point in the history
  • Loading branch information
FabioPinheiro authored Mar 2, 2023
1 parent 7d1997c commit 59afe8c
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 25 deletions.
2 changes: 1 addition & 1 deletion prism-agent/service/project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ object Dependencies {
val akka = "2.6.20"
val akkaHttp = "10.2.9"
val castor = "0.8.1"
val pollux = "0.33.0"
val pollux = "0.35.0"
val connect = "0.11.0"
val bouncyCastle = "1.70"
val logback = "1.4.5"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,28 @@ object BackgroundJobs {
_ <- ZIO.logDebug(s"Running action with records => $record")
_ <- record match {
// Offer should be sent from Issuer to Holder
case IssueCredentialRecord(id, _, _, _, _, Role.Issuer, _, _, _, _, OfferPending, _, Some(offer), _, _, _, _) =>
case IssueCredentialRecord(
id,
_,
_,
_,
_,
Role.Issuer,
_,
_,
_,
_,
OfferPending,
_,
Some(offer),
_,
_,
_,
_,
_,
_,
_,
) =>
for {
_ <- ZIO.log(s"IssueCredentialRecord: OfferPending (START)")
didCommAgent <- buildDIDCommAgent(offer.from)
Expand Down Expand Up @@ -137,7 +158,10 @@ object BackgroundJobs {
Some(request),
_,
_,
_
_,
_,
_,
_,
) =>
for {
didCommAgent <- buildDIDCommAgent(request.from)
Expand Down Expand Up @@ -169,7 +193,10 @@ object BackgroundJobs {
_,
_,
_,
_
_,
_,
_,
_,
) =>
for {
credentialService <- ZIO.service[CredentialService]
Expand All @@ -194,7 +221,10 @@ object BackgroundJobs {
_,
Some(issue),
_,
Some(issuingDID)
Some(issuingDID),
_,
_,
_,
) =>
// Generate the JWT Credential and store it in DB as an attacment to IssueCredentialData
// Set ProtocolState to CredentialGenerated
Expand Down Expand Up @@ -236,7 +266,10 @@ object BackgroundJobs {
_,
Some(issue),
_,
_
_,
_,
_,
_,
) =>
for {
didCommAgent <- buildDIDCommAgent(issue.from)
Expand Down Expand Up @@ -268,6 +301,9 @@ object BackgroundJobs {
_,
Some(issue),
_,
_,
_,
_,
_
) =>
for {
Expand All @@ -280,8 +316,9 @@ object BackgroundJobs {
}
} yield ()

case IssueCredentialRecord(id, _, _, _, _, _, _, _, _, _, ProblemReportPending, _, _, _, _, _, _) => ???
case IssueCredentialRecord(id, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) => ZIO.unit
case IssueCredentialRecord(id, _, _, _, _, _, _, _, _, _, ProblemReportPending, _, _, _, _, _, _, _, _, _) =>
???
case IssueCredentialRecord(id, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) => ZIO.unit
}
} yield ()

Expand Down Expand Up @@ -394,12 +431,15 @@ object BackgroundJobs {
// ##########################
// ### PresentationRecord ###
// ##########################
case PresentationRecord(id, _, _, _, _, _, _, _, ProposalPending, _, _, _, _) => ZIO.fail(NotImplemented)
case PresentationRecord(id, _, _, _, _, _, _, _, ProposalSent, _, _, _, _) => ZIO.fail(NotImplemented)
case PresentationRecord(id, _, _, _, _, _, _, _, ProposalReceived, _, _, _, _) => ZIO.fail(NotImplemented)
case PresentationRecord(id, _, _, _, _, _, _, _, ProposalRejected, _, _, _, _) => ZIO.fail(NotImplemented)
case PresentationRecord(id, _, _, _, _, _, _, _, ProposalPending, _, _, _, _, _, _, _) =>
ZIO.fail(NotImplemented)
case PresentationRecord(id, _, _, _, _, _, _, _, ProposalSent, _, _, _, _, _, _, _) => ZIO.fail(NotImplemented)
case PresentationRecord(id, _, _, _, _, _, _, _, ProposalReceived, _, _, _, _, _, _, _) =>
ZIO.fail(NotImplemented)
case PresentationRecord(id, _, _, _, _, _, _, _, ProposalRejected, _, _, _, _, _, _, _) =>
ZIO.fail(NotImplemented)

case PresentationRecord(id, _, _, _, _, _, _, _, RequestPending, oRecord, _, _, _) => // Verifier
case PresentationRecord(id, _, _, _, _, _, _, _, RequestPending, oRecord, _, _, _, _, _, _) => // Verifier
oRecord match
case None => ZIO.fail(InvalidState("PresentationRecord 'RequestPending' with no Record"))
case Some(record) =>
Expand All @@ -415,15 +455,18 @@ object BackgroundJobs {
}
} yield ()

case PresentationRecord(id, _, _, _, _, _, _, _, RequestSent, _, _, _, _) => // Verifier
case PresentationRecord(id, _, _, _, _, _, _, _, RequestSent, _, _, _, _, _, _, _) => // Verifier
ZIO.logDebug("PresentationRecord: RequestSent") *> ZIO.unit
case PresentationRecord(id, _, _, _, _, _, _, _, RequestReceived, _, _, _, _) => // Prover
case PresentationRecord(id, _, _, _, _, _, _, _, RequestReceived, _, _, _, _, _, _, _) => // Prover
ZIO.logDebug("PresentationRecord: RequestReceived") *> ZIO.unit
case PresentationRecord(id, _, _, _, _, _, _, _, RequestRejected, _, _, _, _) => // Prover
case PresentationRecord(id, _, _, _, _, _, _, _, RequestRejected, _, _, _, _, _, _, _) => // Prover
ZIO.logDebug("PresentationRecord: RequestRejected") *> ZIO.unit
case PresentationRecord(id, _, _, _, _, _, _, _, ProblemReportPending, _, _, _, _) => ZIO.fail(NotImplemented)
case PresentationRecord(id, _, _, _, _, _, _, _, ProblemReportSent, _, _, _, _) => ZIO.fail(NotImplemented)
case PresentationRecord(id, _, _, _, _, _, _, _, ProblemReportReceived, _, _, _, _) => ZIO.fail(NotImplemented)
case PresentationRecord(id, _, _, _, _, _, _, _, ProblemReportPending, _, _, _, _, _, _, _) =>
ZIO.fail(NotImplemented)
case PresentationRecord(id, _, _, _, _, _, _, _, ProblemReportSent, _, _, _, _, _, _, _) =>
ZIO.fail(NotImplemented)
case PresentationRecord(id, _, _, _, _, _, _, _, ProblemReportReceived, _, _, _, _, _, _, _) =>
ZIO.fail(NotImplemented)
case PresentationRecord(
id,
_,
Expand All @@ -437,7 +480,10 @@ object BackgroundJobs {
oRequestPresentation,
_,
_,
credentialsToUse
credentialsToUse,
_,
_,
_
) => // Prover
for {
presentationService <- ZIO.service[PresentationService]
Expand Down Expand Up @@ -473,7 +519,7 @@ object BackgroundJobs {
_ <- presentationService.markPresentationGenerated(id, presentation)

} yield ()
case PresentationRecord(id, _, _, _, _, _, _, _, PresentationGenerated, _, _, presentation, _) =>
case PresentationRecord(id, _, _, _, _, _, _, _, PresentationGenerated, _, _, presentation, _, _, _, _) =>
ZIO.logDebug("PresentationRecord: PresentationGenerated") *> ZIO.unit
presentation match
case None => ZIO.fail(InvalidState("PresentationRecord in 'PresentationPending' with no Presentation"))
Expand All @@ -490,7 +536,7 @@ object BackgroundJobs {
else ZIO.logWarning(s"DIDComm sending error: [${resp.status}] - ${resp.bodyAsString}")
}
} yield ()
case PresentationRecord(id, _, _, _, _, _, _, _, PresentationSent, _, _, _, _) =>
case PresentationRecord(id, _, _, _, _, _, _, _, PresentationSent, _, _, _, _, _, _, _) =>
ZIO.logDebug("PresentationRecord: PresentationSent") *> ZIO.unit
case PresentationRecord(
id,
Expand All @@ -505,6 +551,9 @@ object BackgroundJobs {
mayBeRequestPresentation,
_,
presentation,
_,
_,
_,
_
) => // Verifier
ZIO.logDebug("PresentationRecord: PresentationReceived") *> ZIO.unit
Expand Down Expand Up @@ -578,11 +627,11 @@ object BackgroundJobs {
_ <- service.markPresentationVerified(id)
} yield ()
// TODO move the state to PresentationVerified
case PresentationRecord(id, _, _, _, _, _, _, _, PresentationVerified, _, _, _, _) =>
case PresentationRecord(id, _, _, _, _, _, _, _, PresentationVerified, _, _, _, _, _, _, _) =>
ZIO.logDebug("PresentationRecord: PresentationVerified") *> ZIO.unit
case PresentationRecord(id, _, _, _, _, _, _, _, PresentationAccepted, _, _, _, _) =>
case PresentationRecord(id, _, _, _, _, _, _, _, PresentationAccepted, _, _, _, _, _, _, _) =>
ZIO.logDebug("PresentationRecord: PresentationVerifiedAccepted") *> ZIO.unit
case PresentationRecord(id, _, _, _, _, _, _, _, PresentationRejected, _, _, _, _) =>
case PresentationRecord(id, _, _, _, _, _, _, _, PresentationRejected, _, _, _, _, _, _, _) =>
ZIO.logDebug("PresentationRecord: PresentationRejected") *> ZIO.unit
}
} yield ()
Expand Down

0 comments on commit 59afe8c

Please sign in to comment.