Skip to content

Commit 618fb08

Browse files
committed
#1865 Add organisation (ID and name) in webhook message
1 parent 61057cc commit 618fb08

File tree

1 file changed

+5
-1
lines changed
  • thehive/app/org/thp/thehive/services/notification/notifiers

1 file changed

+5
-1
lines changed

thehive/app/org/thp/thehive/services/notification/notifiers/Webhook.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,11 @@ class Webhook(
258258
else {
259259
val ws = new ProxyWS(config.wsConfig, mat)
260260
val async = for {
261-
message <- Future.fromTry(buildMessage(config.version, audit))
261+
message <- Future.fromTry(
262+
buildMessage(config.version, audit).map(
263+
_ + ("organisationId" -> JsString(organisation._id.toString)) + ("organisation" -> JsString(organisation.name))
264+
)
265+
)
262266
_ = logger.debug(s"Request webhook with message $message")
263267
resp <- config.auth(ws.url(config.url)).post(message)
264268
} yield if (resp.status >= 400) logger.warn(s"Webhook call on ${config.url} returns ${resp.status} ${resp.statusText}") else ()

0 commit comments

Comments
 (0)