Documentation ¶
Index ¶
- Constants
- func MessageContainerCreated(executant, item string) string
- func MessageFileCreated(executant, item string) string
- func MessageFilePurged(executant, item string) string
- func MessageFileRead(executant, item string) string
- func MessageFileRenamed(executant, item, oldpath, newpath string) string
- func MessageFileRestored(executant, item, path string) string
- func MessageFileTrashed(executant, item string) string
- func MessageFileVersionRestored(executant, item, version string) string
- func MessageGroupCreated(executant, groupID string) string
- func MessageGroupDeleted(executant, groupID string) string
- func MessageGroupMemberAdded(executant, userID, groupID string) string
- func MessageGroupMemberRemoved(executant, userID, groupID string) string
- func MessageLinkAccessed(linkid string, success bool) string
- func MessageLinkCreated(sharer, item, shareid string) string
- func MessageLinkRemoved(executant, 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(executant, spaceID, name string) string
- func MessageSpaceDeleted(executant, spaceID string) string
- func MessageSpaceDisabled(executant, spaceID string) string
- func MessageSpaceEnabled(executant, spaceID string) string
- func MessageSpaceRenamed(executant, spaceID, name string) string
- func MessageUserCreated(executant, userID string) string
- func MessageUserDeleted(executant, userID string) string
- func MessageUserFeatureChanged(executant, userID string, features []events.UserFeature) string
- func RegisteredEvents() []events.Unmarshaller
- type AuditEvent
- type AuditEventContainerCreated
- 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 ActionContainerCreated = "container_create" 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 MessageContainerCreated ¶
MessageContainerCreated returns the human readable string that describes the action
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 ¶
MessageGroupCreated returns the human readable string that describes the action
func MessageGroupDeleted ¶
MessageGroupDeleted returns the human readable string that describes the action
func MessageGroupMemberAdded ¶
MessageGroupMemberAdded returns the human readable string that describes the action
func MessageGroupMemberRemoved ¶
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 ¶
MessageUserCreated returns the human readable string that describes the action
func MessageUserDeleted ¶
MessageUserDeleted returns the human readable string that describes the action
func MessageUserFeatureChanged ¶
func MessageUserFeatureChanged(executant, 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 AuditEventContainerCreated ¶
type AuditEventContainerCreated struct {
AuditEventFiles
}
AuditEventContainerCreated is the event logged when a container is created
func ContainerCreated ¶
func ContainerCreated(ev events.ContainerCreated) AuditEventContainerCreated
ContainerCreated converts a ContainerCreated event to an AuditEventContainerCreated
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 ¶
type AuditEventGroupCreated struct { AuditEvent GroupID string }
AuditEventGroupCreated is the event logged when a group is created
func GroupCreated ¶
func GroupCreated(ev events.GroupCreated) AuditEventGroupCreated
GroupCreated converts a GroupCreated event to an AuditEventGroupCreated
type AuditEventGroupDeleted ¶
type AuditEventGroupDeleted struct { AuditEvent GroupID string }
AuditEventGroupDeleted is the event logged when a group is deleted
func GroupDeleted ¶
func GroupDeleted(ev events.GroupDeleted) AuditEventGroupDeleted
GroupDeleted converts a GroupDeleted event to an AuditEventGroupDeleted
type AuditEventGroupMemberAdded ¶
type AuditEventGroupMemberAdded struct { AuditEvent GroupID string UserID string }
AuditEventGroupMemberAdded is the event logged when a group member is added
func GroupMemberAdded ¶
func GroupMemberAdded(ev events.GroupMemberAdded) AuditEventGroupMemberAdded
GroupMemberAdded converts a GroupMemberAdded event to an AuditEventGroupMemberAdded
type AuditEventGroupMemberRemoved ¶
type AuditEventGroupMemberRemoved struct { AuditEvent GroupID string UserID string }
AuditEventGroupMemberRemoved is the event logged when a group member is removed
func GroupMemberRemoved ¶
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 ¶
type AuditEventUserCreated struct { AuditEvent UserID string }
AuditEventUserCreated is the event logged when a user is created
func UserCreated ¶
func UserCreated(ev events.UserCreated) AuditEventUserCreated
UserCreated converts a UserCreated event to an AuditEventUserCreated
type AuditEventUserDeleted ¶
type AuditEventUserDeleted struct { AuditEvent UserID string }
AuditEventUserDeleted is the event logged when a user is deleted
func UserDeleted ¶
func UserDeleted(ev events.UserDeleted) AuditEventUserDeleted
UserDeleted converts a UserDeleted event to an AuditEventUserDeleted
type AuditEventUserFeatureChanged ¶
type AuditEventUserFeatureChanged struct { AuditEvent UserID string Features []events.UserFeature }
AuditEventUserFeatureChanged is the event logged when a user feature is changed
func UserFeatureChanged ¶
func UserFeatureChanged(ev events.UserFeatureChanged) AuditEventUserFeatureChanged
UserFeatureChanged converts a UserFeatureChanged event to an AuditEventUserFeatureChanged