quantranhong1999 commented on code in PR #2586:
URL: https://github.com/apache/james-project/pull/2586#discussion_r1906346086
##########
server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/MailboxSetDeletePerformer.scala:
##########
@@ -120,6 +124,16 @@ class MailboxSetDeletePerformer @Inject()(mailboxManager:
MailboxManager,
.`then`())
}
}))
+ .doOnSuccess(_ => auditTrail(mailboxSession, id))
+
+ private def auditTrail(mailboxSession: MailboxSession, id: MailboxId): Unit =
+ ReactorUtils.logAsMono(() => AuditTrail.entry
+ .username(() => mailboxSession.getUser.asString())
+ .protocol("JMAP")
+ .action("Mailbox/set delete")
Review Comment:
destroy, not delete
##########
server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/MailboxSetDeletePerformer.scala:
##########
@@ -120,6 +124,16 @@ class MailboxSetDeletePerformer @Inject()(mailboxManager:
MailboxManager,
.`then`())
}
}))
+ .doOnSuccess(_ => auditTrail(mailboxSession, id))
+
+ private def auditTrail(mailboxSession: MailboxSession, id: MailboxId): Unit =
+ ReactorUtils.logAsMono(() => AuditTrail.entry
+ .username(() => mailboxSession.getUser.asString())
+ .protocol("JMAP")
+ .action("Mailbox/set delete")
+ .parameters(() => ImmutableMap.of("loggedInUser",
mailboxSession.getLoggedInUser.toScala.map(_.asString()).getOrElse(""),
+ "mailboxId", id.serialize()))
Review Comment:
IMO we should audit trail by mailboxIds (which mailboxIds for Mailbox/set
destroy that client really requests to the server). Doing this would make the
impression that the client always requests Mailbox/set destroy one by one
mailbox.
See audit trail for Email/set destroy.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]