Merge pull request #5927 from kobergj/AddParametersToNotifications

Add Parameters for av and po events
This commit is contained in:
kobergj
2023-03-24 16:00:43 +01:00
committed by GitHub
2 changed files with 23 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
Enhancement: Add MessageRichParameters
Adds the messageRichParameters to virus and policies notifications
https://github.com/owncloud/ocis/pull/5927

View File

@@ -249,6 +249,16 @@ func (c *Converter) virusMessage(eventid string, nt NotificationTemplate, execut
return OC10Notification{}, err
}
dets := map[string]interface{}{
"resource": map[string]string{
"name": filename,
},
"virus": map[string]interface{}{
"name": virus,
"scandate": ts,
},
}
return OC10Notification{
EventID: eventid,
Service: c.serviceName,
@@ -260,7 +270,7 @@ func (c *Converter) virusMessage(eventid string, nt NotificationTemplate, execut
SubjectRaw: subjraw,
Message: msg,
MessageRaw: msgraw,
MessageDetails: generateDetails(nil, nil, nil, nil),
MessageDetails: dets,
}, nil
}
@@ -272,6 +282,12 @@ func (c *Converter) policiesMessage(eventid string, nt NotificationTemplate, exe
return OC10Notification{}, err
}
dets := map[string]interface{}{
"resource": map[string]string{
"name": filename,
},
}
return OC10Notification{
EventID: eventid,
Service: c.serviceName,
@@ -282,7 +298,7 @@ func (c *Converter) policiesMessage(eventid string, nt NotificationTemplate, exe
SubjectRaw: subjraw,
Message: msg,
MessageRaw: msgraw,
MessageDetails: generateDetails(nil, nil, nil, nil),
MessageDetails: dets,
}, nil
}