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 <[email protected]>
  • Loading branch information
mineme0110 authored Sep 7, 2023
1 parent 761d422 commit 40c5d06
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 40c5d06

Please sign in to comment.