add token to LinkAccessedEvent
Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
@@ -202,7 +202,7 @@ func ReceivedShareUpdated(ev events.ReceivedShareUpdated) AuditEventReceivedShar
|
||||
// LinkAccessed converts a LinkAccessed event to an AuditEventLinkAccessed
|
||||
func LinkAccessed(ev events.LinkAccessed) AuditEventLinkAccessed {
|
||||
uid := ev.Sharer.OpaqueId
|
||||
base := BasicAuditEvent(uid, formatTime(ev.CTime), MessageLinkAccessed(ev.ShareID.GetOpaqueId(), true), ActionLinkAccessed)
|
||||
base := BasicAuditEvent(uid, formatTime(ev.CTime), MessageLinkAccessed(ev.Token, true), ActionLinkAccessed)
|
||||
return AuditEventLinkAccessed{
|
||||
AuditEventSharing: SharingAuditEvent(ev.ShareID.GetOpaqueId(), ev.ItemID.OpaqueId, uid, base),
|
||||
ShareToken: ev.Token,
|
||||
@@ -215,7 +215,7 @@ func LinkAccessed(ev events.LinkAccessed) AuditEventLinkAccessed {
|
||||
|
||||
// LinkAccessFailed converts a LinkAccessFailed event to an AuditEventLinkAccessed
|
||||
func LinkAccessFailed(ev events.LinkAccessFailed) AuditEventLinkAccessed {
|
||||
base := BasicAuditEvent("", formatTime(ev.Timestamp), MessageLinkAccessed(ev.ShareID.GetOpaqueId(), false), ActionLinkAccessed)
|
||||
base := BasicAuditEvent("", formatTime(ev.Timestamp), MessageLinkAccessed(ev.Token, false), ActionLinkAccessed)
|
||||
return AuditEventLinkAccessed{
|
||||
AuditEventSharing: SharingAuditEvent(ev.ShareID.GetOpaqueId(), "", "", base),
|
||||
ShareToken: ev.Token,
|
||||
|
||||
@@ -94,8 +94,8 @@ func MessageShareDeclined(userid, shareid, sharerid string) string {
|
||||
}
|
||||
|
||||
// MessageLinkAccessed returns the human readable string that describes the action
|
||||
func MessageLinkAccessed(linkid string, success bool) string {
|
||||
return fmt.Sprintf("link '%s' was accessed. Success: %v", linkid, success)
|
||||
func MessageLinkAccessed(token string, success bool) string {
|
||||
return fmt.Sprintf("link with token '%s' was accessed. Success: %v", token, success)
|
||||
}
|
||||
|
||||
// MessageContainerCreated returns the human readable string that describes the action
|
||||
|
||||
Reference in New Issue
Block a user