add token to LinkAccessedEvent

Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
Christian Richter
2023-06-19 13:51:44 +02:00
parent a4ba746b88
commit 14a66a98f1
3 changed files with 11 additions and 4 deletions

View File

@@ -0,0 +1,7 @@
Bugfix: Add token to LinkAccessedEvent
We added the link token to the LinkAccessedEvent
https://github.com/owncloud/ocis/pull/6554
https://github.com/cs3org/reva/pull/3993
https://github.com/owncloud/ocis/issues/3753

View File

@@ -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,

View File

@@ -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