Documentation ¶
Index ¶
- Constants
- func MessageFileCreated(item string) string
- func MessageFilePurged(item string) string
- func MessageFileRead(item string) string
- func MessageFileRenamed(item, oldpath, newpath string) string
- func MessageFileRestored(item, path string) string
- func MessageFileTrashed(item string) string
- func MessageFileVersionRestored(item string, version string) string
- func MessageGroupCreated(groupID string) string
- func MessageGroupDeleted(groupID string) string
- func MessageGroupMemberAdded(userID, groupID string) string
- func MessageGroupMemberRemoved(userID, groupID string) string
- func MessageLinkAccessed(linkid string, success bool) string
- func MessageLinkCreated(sharer, item, shareid string) string
- func MessageLinkRemoved(shareid string) string
- func MessageLinkUpdated(sharer, shareid, fieldUpdated string) string
- func MessageShareAccepted(userid, shareid, sharerid string) string
- func MessageShareCreated(sharer, item, grantee string) string
- func MessageShareDeclined(userid, shareid, sharerid string) string
- func MessageShareRemoved(sharer, shareid, itemid string) string
- func MessageShareUpdated(sharer, shareID, fieldUpdated string) string
- func MessageSpaceCreated(spaceID string, name string) string
- func MessageSpaceDeleted(spaceID string) string
- func MessageSpaceDisabled(spaceID string) string
- func MessageSpaceEnabled(spaceID string) string
- func MessageSpaceRenamed(spaceID string, name string) string
- func MessageUserCreated(userID string) string
- func MessageUserDeleted(userID string) string
- func MessageUserFeatureChanged(userID string, features []events.UserFeature) string
- func RegisteredEvents() []events.Unmarshaller
- type AuditEvent
- type AuditEventFileCopied
- type AuditEventFileCreated
- type AuditEventFileDeleted
- type AuditEventFilePurged
- type AuditEventFileRead
- type AuditEventFileRenamed
- type AuditEventFileRestored
- type AuditEventFileUpdated
- type AuditEventFileVersionDeleted
- type AuditEventFileVersionRestored
- type AuditEventFiles
- type AuditEventGroupCreated
- type AuditEventGroupDeleted
- type AuditEventGroupMemberAdded
- type AuditEventGroupMemberRemoved
- type AuditEventLinkAccessed
- type AuditEventReceivedShareUpdated
- type AuditEventShareCreated
- type AuditEventShareRemoved
- type AuditEventShareUpdated
- type AuditEventSharing
- type AuditEventSpaceCreated
- type AuditEventSpaceDeleted
- type AuditEventSpaceDisabled
- type AuditEventSpaceEnabled
- type AuditEventSpaceRenamed
- type AuditEventSpaces
- type AuditEventUserCreated
- type AuditEventUserDeleted
- type AuditEventUserFeatureChanged
Constants ¶
const ( // Sharing ActionLinkAccessed = "public_link_accessed" // Files ActionFileCreated = "file_create" ActionFileRead = "file_read" ActionFileTrashed = "file_delete" ActionFileRenamed = "file_rename" ActionFilePurged = "file_trash_delete" ActionFileRestored = "file_trash_restore" ActionFileVersionRestored = "file_version_restore" // Spaces ActionSpaceCreated = "space_created" ActionSpaceRenamed = "space_renamed" ActionSpaceDisabled = "space_disabled" ActionSpaceEnabled = "space_enabled" ActionSpaceDeleted = "space_deleted" // Users ActionUserCreated = "user_created" ActionUserDeleted = "user_deleted" ActionUserFeatureChanged = "user_feature_changed" // Groups ActionGroupCreated = "group_created" ActionGroupDeleted = "group_deleted" ActionGroupMemberAdded = "group_member_added" ActionGroupMemberRemoved = "group_member_removed" )
short identifiers for audit actions
Variables ¶
This section is empty.
Functions ¶
func MessageFileCreated ¶
MessageFileCreated returns the human readable string that describes the action
func MessageFilePurged ¶
MessageFilePurged returns the human readable string that describes the action
func MessageFileRead ¶
MessageFileRead returns the human readable string that describes the action
func MessageFileRenamed ¶
MessageFileRenamed returns the human readable string that describes the action
func MessageFileRestored ¶
MessageFileRestored returns the human readable string that describes the action
func MessageFileTrashed ¶
MessageFileTrashed returns the human readable string that describes the action
func MessageFileVersionRestored ¶
MessageFileVersionRestored returns the human readable string that describes the action
func MessageGroupCreated ¶ added in v1.20.0
MessageGroupCreated returns the human readable string that describes the action
func MessageGroupDeleted ¶ added in v1.20.0
MessageGroupDeleted returns the human readable string that describes the action
func MessageGroupMemberAdded ¶ added in v1.20.0
MessageGroupMemberAdded returns the human readable string that describes the action
func MessageGroupMemberRemoved ¶ added in v1.20.0
MessageGroupMemberRemoved returns the human readable string that describes the action
func MessageLinkAccessed ¶
MessageLinkAccessed returns the human readable string that describes the action
func MessageLinkCreated ¶
MessageLinkCreated returns the human readable string that describes the action
func MessageLinkRemoved ¶
MessageLinkRemoved returns the human readable string that describes the action
func MessageLinkUpdated ¶
MessageLinkUpdated returns the human readable string that describes the action
func MessageShareAccepted ¶
MessageShareAccepted returns the human readable string that describes the action
func MessageShareCreated ¶
MessageShareCreated returns the human readable string that describes the action
func MessageShareDeclined ¶
MessageShareDeclined returns the human readable string that describes the action
func MessageShareRemoved ¶
MessageShareRemoved returns the human readable string that describes the action
func MessageShareUpdated ¶
MessageShareUpdated returns the human readable string that describes the action
func MessageSpaceCreated ¶
MessageSpaceCreated returns the human readable string that describes the action
func MessageSpaceDeleted ¶
MessageSpaceDeleted returns the human readable string that describes the action
func MessageSpaceDisabled ¶
MessageSpaceDisabled returns the human readable string that describes the action
func MessageSpaceEnabled ¶
MessageSpaceEnabled returns the human readable string that describes the action
func MessageSpaceRenamed ¶
MessageSpaceRenamed returns the human readable string that describes the action
func MessageUserCreated ¶ added in v1.20.0
MessageUserCreated returns the human readable string that describes the action
func MessageUserDeleted ¶ added in v1.20.0
MessageUserDeleted returns the human readable string that describes the action
func MessageUserFeatureChanged ¶ added in v1.20.0
func MessageUserFeatureChanged(userID string, features []events.UserFeature) string
MessageUserFeatureChanged returns the human readable string that describes the action
func RegisteredEvents ¶
func RegisteredEvents() []events.Unmarshaller
RegisteredEvents returns the events the service is registered for
Types ¶
type AuditEvent ¶
type AuditEvent struct { RemoteAddr string // the remote client IP User string // the UID of the user performing the action. Or "IP x.x.x.x.", "cron", "CLI", "unknown" URL string // the process request URI Method string // the HTTP request method UserAgent string // the HTTP request user agent Time string // the time of the event eg: 2018-05-08T08:26:00+00:00 App string // always 'admin_audit' Message string // sentence explaining the action Action string // unique action identifier eg: file_delete or public_link_created CLI bool // if the action was performed from the CLI Level int // the log level of the entry (usually 1 for audit events) }
AuditEvent is the basic audit event
func BasicAuditEvent ¶
func BasicAuditEvent(uid string, ctime string, msg string, action string) AuditEvent
BasicAuditEvent creates an AuditEvent from given values
type AuditEventFileCopied ¶
type AuditEventFileCopied struct {
AuditEventFiles
}
AuditEventFileCopied is the event logged when a file is copied TODO: copy is a download&upload for now. How to know it was a copy? FIXME: implement
type AuditEventFileCreated ¶
type AuditEventFileCreated struct {
AuditEventFiles
}
AuditEventFileCreated is the event logged when a file is created
func FileUploaded ¶
func FileUploaded(ev events.FileUploaded) AuditEventFileCreated
FileUploaded converts a FileUploaded event to an AuditEventFileCreated
type AuditEventFileDeleted ¶
type AuditEventFileDeleted struct {
AuditEventFiles
}
AuditEventFileDeleted is the event logged when a file is deleted (aka trashed)
func ItemTrashed ¶
func ItemTrashed(ev events.ItemTrashed) AuditEventFileDeleted
ItemTrashed converts a ItemTrashed event to an AuditEventFileDeleted
type AuditEventFilePurged ¶
type AuditEventFilePurged struct {
AuditEventFiles
}
AuditEventFilePurged is the event logged when a file is purged (deleted from trashbin)
func ItemPurged ¶
func ItemPurged(ev events.ItemPurged) AuditEventFilePurged
ItemPurged converts a ItemPurged event to an AuditEventFilePurged
type AuditEventFileRead ¶
type AuditEventFileRead struct {
AuditEventFiles
}
AuditEventFileRead is the event logged when a file is read (aka downloaded)
func FileDownloaded ¶
func FileDownloaded(ev events.FileDownloaded) AuditEventFileRead
FileDownloaded converts a FileDownloaded event to an AuditEventFileRead
type AuditEventFileRenamed ¶
type AuditEventFileRenamed struct { AuditEventFiles OldPath string }
AuditEventFileRenamed is the event logged when a file is renamed (moved)
func ItemMoved ¶
func ItemMoved(ev events.ItemMoved) AuditEventFileRenamed
ItemMoved converts a ItemMoved event to an AuditEventFileRenamed
type AuditEventFileRestored ¶
type AuditEventFileRestored struct { AuditEventFiles OldPath string }
AuditEventFileRestored is the event logged when a file is restored (from trashbin)
func ItemRestored ¶
func ItemRestored(ev events.ItemRestored) AuditEventFileRestored
ItemRestored converts a ItemRestored event to an AuditEventFileRestored
type AuditEventFileUpdated ¶
type AuditEventFileUpdated struct {
AuditEventFiles
}
AuditEventFileUpdated is the event logged when a file is updated TODO: How to differentiate between new uploads and new version uploads? FIXME: implement
type AuditEventFileVersionDeleted ¶
type AuditEventFileVersionDeleted struct {
AuditEventFiles
}
AuditEventFileVersionDeleted is the event logged when a file version is deleted TODO: is this even possible?
type AuditEventFileVersionRestored ¶
type AuditEventFileVersionRestored struct { AuditEventFiles Key string }
AuditEventFileVersionRestored is the event logged when a file version is restored
func FileVersionRestored ¶
func FileVersionRestored(ev events.FileVersionRestored) AuditEventFileVersionRestored
FileVersionRestored converts a FileVersionRestored event to an AuditEventFileVersionRestored
type AuditEventFiles ¶
type AuditEventFiles struct { AuditEvent Path string // The full path to the create file. Owner string // The UID of the owner of the file. FileID string // The newly created files identifier. }
AuditEventFiles is the basic audit event for files
func FilesAuditEvent ¶
func FilesAuditEvent(base AuditEvent, itemid, owner, path string) AuditEventFiles
FilesAuditEvent creates an AuditEventFiles from the given values
type AuditEventGroupCreated ¶ added in v1.20.0
type AuditEventGroupCreated struct { AuditEvent GroupID string }
AuditEventGroupCreated is the event logged when a group is created
func GroupCreated ¶ added in v1.20.0
func GroupCreated(ev events.GroupCreated) AuditEventGroupCreated
GroupCreated converts a GroupCreated event to an AuditEventGroupCreated
type AuditEventGroupDeleted ¶ added in v1.20.0
type AuditEventGroupDeleted struct { AuditEvent GroupID string }
AuditEventGroupDeleted is the event logged when a group is deleted
func GroupDeleted ¶ added in v1.20.0
func GroupDeleted(ev events.GroupDeleted) AuditEventGroupDeleted
GroupDeleted converts a GroupDeleted event to an AuditEventGroupDeleted
type AuditEventGroupMemberAdded ¶ added in v1.20.0
type AuditEventGroupMemberAdded struct { AuditEvent GroupID string UserID string }
AuditEventGroupMemberAdded is the event logged when a group member is added
func GroupMemberAdded ¶ added in v1.20.0
func GroupMemberAdded(ev events.GroupMemberAdded) AuditEventGroupMemberAdded
GroupMemberAdded converts a GroupMemberAdded event to an AuditEventGroupMemberAdded
type AuditEventGroupMemberRemoved ¶ added in v1.20.0
type AuditEventGroupMemberRemoved struct { AuditEvent GroupID string UserID string }
AuditEventGroupMemberRemoved is the event logged when a group member is removed
func GroupMemberRemoved ¶ added in v1.20.0
func GroupMemberRemoved(ev events.GroupMemberRemoved) AuditEventGroupMemberRemoved
GroupMemberRemoved converts a GroupMemberRemoved event to an AuditEventGroupMemberRemove
type AuditEventLinkAccessed ¶
type AuditEventLinkAccessed struct { AuditEventSharing Success bool // If the request was successful. ItemType string // file or folder }
AuditEventLinkAccessed is the event logged when a link is accessed
func LinkAccessFailed ¶
func LinkAccessFailed(ev events.LinkAccessFailed) AuditEventLinkAccessed
LinkAccessFailed converts a LinkAccessFailed event to an AuditEventLinkAccessed
func LinkAccessed ¶
func LinkAccessed(ev events.LinkAccessed) AuditEventLinkAccessed
LinkAccessed converts a LinkAccessed event to an AuditEventLinkAccessed
type AuditEventReceivedShareUpdated ¶
type AuditEventReceivedShareUpdated struct {}
AuditEventReceivedShareUpdated is the event logged when a share is accepted or declined
func ReceivedShareUpdated ¶
func ReceivedShareUpdated(ev events.ReceivedShareUpdated) AuditEventReceivedShareUpdated
ReceivedShareUpdated converts a ReceivedShareUpdated event to an AuditEventReceivedShareUpdated
type AuditEventShareCreated ¶
type AuditEventShareCreated struct {}
AuditEventShareCreated is the event logged when a share is created
func LinkCreated ¶
func LinkCreated(ev events.LinkCreated) AuditEventShareCreated
LinkCreated converts a ShareCreated Event to an AuditEventShareCreated
func ShareCreated ¶
func ShareCreated(ev events.ShareCreated) AuditEventShareCreated
ShareCreated converts a ShareCreated Event to an AuditEventShareCreated
type AuditEventShareRemoved ¶
type AuditEventShareRemoved struct {}
AuditEventShareRemoved is the event logged when a share is removed
func LinkRemoved ¶
func LinkRemoved(ev events.LinkRemoved) AuditEventShareRemoved
LinkRemoved converts a LinkRemoved event to an AuditEventShareRemoved
func ShareRemoved ¶
func ShareRemoved(ev events.ShareRemoved) AuditEventShareRemoved
ShareRemoved converts a ShareRemoved event to an AuditEventShareRemoved
type AuditEventShareUpdated ¶
type AuditEventShareUpdated struct {}
AuditEventShareUpdated is the event logged when a share is updated
func LinkUpdated ¶
func LinkUpdated(ev events.LinkUpdated) AuditEventShareUpdated
LinkUpdated converts a LinkUpdated event to an AuditEventShareUpdated
func ShareUpdated ¶
func ShareUpdated(ev events.ShareUpdated) AuditEventShareUpdated
ShareUpdated converts a ShareUpdated event to an AuditEventShareUpdated
type AuditEventSharing ¶
type AuditEventSharing struct { AuditEvent FileID string // The file identifier for the item shared. Owner string // The UID of the owner of the shared item. Path string // The path to the shared item. }
AuditEventSharing is the basic audit event for shares
func SharingAuditEvent ¶
func SharingAuditEvent(shareid string, fileid string, uid string, base AuditEvent) AuditEventSharing
SharingAuditEvent creates an AuditEventSharing from given values
type AuditEventSpaceCreated ¶
type AuditEventSpaceCreated struct { AuditEventSpaces Owner string RootItem string Name string Type string }
AuditEventSpaceCreated is the event logged when a space is created
func SpaceCreated ¶
func SpaceCreated(ev events.SpaceCreated) AuditEventSpaceCreated
SpaceCreated converts a SpaceCreated event to an AuditEventSpaceCreated
type AuditEventSpaceDeleted ¶
type AuditEventSpaceDeleted struct {
AuditEventSpaces
}
AuditEventSpaceDeleted is the event logged when a space is deleted
func SpaceDeleted ¶
func SpaceDeleted(ev events.SpaceDeleted) AuditEventSpaceDeleted
SpaceDeleted converts a SpaceDeleted event to an AuditEventSpaceDeleted
type AuditEventSpaceDisabled ¶
type AuditEventSpaceDisabled struct {
AuditEventSpaces
}
AuditEventSpaceDisabled is the event logged when a space is disabled
func SpaceDisabled ¶
func SpaceDisabled(ev events.SpaceDisabled) AuditEventSpaceDisabled
SpaceDisabled converts a SpaceDisabled event to an AuditEventSpaceDisabled
type AuditEventSpaceEnabled ¶
type AuditEventSpaceEnabled struct {
AuditEventSpaces
}
AuditEventSpaceEnabled is the event logged when a space is (re-)enabled
func SpaceEnabled ¶
func SpaceEnabled(ev events.SpaceEnabled) AuditEventSpaceEnabled
SpaceEnabled converts a SpaceEnabled event to an AuditEventSpaceEnabled
type AuditEventSpaceRenamed ¶
type AuditEventSpaceRenamed struct { AuditEventSpaces NewName string }
AuditEventSpaceRenamed is the event logged when a space is renamed
func SpaceRenamed ¶
func SpaceRenamed(ev events.SpaceRenamed) AuditEventSpaceRenamed
SpaceRenamed converts a SpaceRenamed event to an AuditEventSpaceRenamed
type AuditEventSpaces ¶
type AuditEventSpaces struct { AuditEvent SpaceID string }
AuditEventSpaces is the basic audit event for spaces
func SpacesAuditEvent ¶
func SpacesAuditEvent(base AuditEvent, spaceID string) AuditEventSpaces
SpacesAuditEvent creates an AuditEventSpaces from the given values
type AuditEventUserCreated ¶ added in v1.20.0
type AuditEventUserCreated struct { AuditEvent UserID string }
AuditEventUserCreated is the event logged when a user is created
func UserCreated ¶ added in v1.20.0
func UserCreated(ev events.UserCreated) AuditEventUserCreated
UserCreated converts a UserCreated event to an AuditEventUserCreated
type AuditEventUserDeleted ¶ added in v1.20.0
type AuditEventUserDeleted struct { AuditEvent UserID string }
AuditEventUserDeleted is the event logged when a user is deleted
func UserDeleted ¶ added in v1.20.0
func UserDeleted(ev events.UserDeleted) AuditEventUserDeleted
UserDeleted converts a UserDeleted event to an AuditEventUserDeleted
type AuditEventUserFeatureChanged ¶ added in v1.20.0
type AuditEventUserFeatureChanged struct { AuditEvent UserID string Features []events.UserFeature }
AuditEventUserFeatureChanged is the event logged when a user feature is changed
func UserFeatureChanged ¶ added in v1.20.0
func UserFeatureChanged(ev events.UserFeatureChanged) AuditEventUserFeatureChanged
UserFeatureChanged converts a UserFeatureChanged event to an AuditEventUserFeatureChanged