From 6f66d99c8885749037fd7ebcb7b63168f47358b1 Mon Sep 17 00:00:00 2001 From: BenB196 <8277432+BenB196@users.noreply.github.com> Date: Sat, 6 Feb 2021 17:01:32 -0500 Subject: [PATCH] Removed no longer needed fields Corrected issue with formating --- VERSION | 2 +- eventOutput/fileHandler.go | 12 +++++++----- ffsEvent/ffsFetcher.go | 12 +++++++++++- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/VERSION b/VERSION index 79a2734..5d4294b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.5.0 \ No newline at end of file +0.5.1 \ No newline at end of file diff --git a/eventOutput/fileHandler.go b/eventOutput/fileHandler.go index a9052e7..655c3bf 100644 --- a/eventOutput/fileHandler.go +++ b/eventOutput/fileHandler.go @@ -34,7 +34,7 @@ type Code42 struct { Source string `json:"source,omitempty"` Url *URL `json:"url,omitempty"` Shared string `json:"shared,omitempty"` - SharedWith []ffs.SharedWith `json:"shared_with,omitempty"` + SharedWith []Code42SharedWith `json:"shared_with,omitempty"` SharingTypeAdded []string `json:"sharing_type_added,omitempty"` CloudDriveId string `json:"cloud_drive_id,omitempty"` DetectionSourceAlias string `json:"detection_source_alias,omitempty"` @@ -58,6 +58,10 @@ type Code42TabTab struct { Url *URL `json:"url,omitempty"` } +type Code42SharedWith struct { + CloudUsername *string `json:"cloud_username,omitempty"` +} + type Code42Event struct { Id string `json:"id,omitempty"` Type string `json:"type,omitempty"` @@ -77,8 +81,6 @@ type Code42File struct { CreateTimestamp *time.Time `json:"create_timestamp,omitempty"` ModifyTimestamp *time.Time `json:"modify_timestamp,omitempty"` Id string `json:"id,omitempty"` - IdentifiedExtensionMIMEType string `json:"identified_extension_mime_type,omitempty"` - CurrentExtensionMIMEType string `json:"current_extension_mime_type,omitempty"` MimeTypeMismatch *bool `json:"mime_type_mismatch,omitempty"` } @@ -88,8 +90,8 @@ type Code42Device struct { } type Code42Tab struct { - WindowTitle string `json:"window_title,omitempty"` - Url *URL `json:"url,omitempty"` + WindowTitle string `json:"window_title,omitempty"` + Url *URL `json:"url,omitempty"` } type Code42RemovableMedia struct { diff --git a/ffsEvent/ffsFetcher.go b/ffsEvent/ffsFetcher.go index 6143a01..cc76b89 100644 --- a/ffsEvent/ffsFetcher.go +++ b/ffsEvent/ffsFetcher.go @@ -396,6 +396,16 @@ func queryFetcher(query config.FFSQuery, inProgressQueries *[]eventOutput.InProg tabs = nil } + var sharedWith []eventOutput.Code42SharedWith + + if ffsEvent.SharedWith != nil && len(ffsEvent.SharedWith) != 0 { + for _, shared := range ffsEvent.SharedWith { + sharedWith = append(sharedWith, eventOutput.Code42SharedWith{CloudUsername: shared.CloudUsername}) + } + } else { + sharedWith = nil + } + code42 := &eventOutput.Code42{ Event: code42Event, InsertionTimestamp: &insertionTimestamp, @@ -410,7 +420,7 @@ func queryFetcher(query config.FFSQuery, inProgressQueries *[]eventOutput.InProg Source: ffsEvent.Source, Url: getUrlInfo(ffsEvent.Url), Shared: ffsEvent.Shared, - SharedWith: ffsEvent.SharedWith, + SharedWith: sharedWith, SharingTypeAdded: ffsEvent.SharingTypeAdded, CloudDriveId: ffsEvent.CloudDriveId, DetectionSourceAlias: ffsEvent.DetectionSourceAlias,