mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-05-24 16:41:35 -04:00
add token to LinkAccessedEvent
Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
7
changelog/unreleased/add-token-to-linkAccessed-event.md
Normal file
7
changelog/unreleased/add-token-to-linkAccessed-event.md
Normal 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
|
||||
@@ -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