Skip to content

Commit

Permalink
fix: Added DidSubject to report problem when not enrolled (#111)
Browse files Browse the repository at this point in the history
fix(mediator): Added didsubject to  reprrt problem on the event of not enrolled did is used

Signed-off-by: Shailesh Patil <shailesh.patil@iohk.io>
Signed-off-by: Shailesh <Patil>
  • Loading branch information
mineme0110 authored and Shailesh committed Apr 30, 2024
1 parent 3c10602 commit da56d94
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,15 @@ object ForwardMessageExecuter
from = agent.id,
pthid = plaintextMessage.id,
piuri = plaintextMessage.`type`,
didNotEnrolled = m.next,
)
case None =>
Problems.notEnroledError(
to = None,
from = agent.id,
pthid = plaintextMessage.id,
piuri = plaintextMessage.`type`,
didNotEnrolled = m.next,
)
}
} yield Reply(problem.toPlaintextMessage)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ object PickupExecuter
to = Some(m.from.asTO),
pthid = m.id, // TODO CHECK pthid
piuri = m.piuri,
didNotEnrolled = didRequestingMessages.asFROM.toDIDSubject,
)
.toPlaintextMessage
case Some(didAccount) =>
Expand Down Expand Up @@ -106,6 +107,7 @@ object PickupExecuter
to = Some(m.from.asTO),
pthid = m.id, // TODO CHECK pthid
piuri = m.piuri,
didNotEnrolled = didRequestingMessages.asFROM.toDIDSubject,
)
.toPlaintextMessage
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ object Problems {
from: FROM,
pthid: MsgID,
piuri: PIURI,
didNotEnrolled: DIDSubject
) = ProblemReport(
// id: MsgID = MsgID(),
to = to.toSet,
Expand All @@ -107,7 +108,7 @@ object Problems {
ack = None,
code = ProblemCode.ErroFail("req", "not_enroll"),
comment = Some("The DID '{1}' is not enroled."),
args = Some(to.map(_.value).toSeq),
args = Some(Seq(didNotEnrolled.did)),
escalate_to = email,
)

Expand Down

0 comments on commit da56d94

Please sign in to comment.