18903: keep-web: when logging a file upload or download, if the
[arvados.git] / services / keep-web / handler.go
index 97ec95e3aac3f96111ab49014635ae742073b4e8..ef61b06873c50661bb29f622bfb1b5e9a1097495 100644 (file)
@@ -913,6 +913,14 @@ func (h *handler) logUploadOrDownload(
                        WithField("collection_file_path", filepath)
                props["collection_uuid"] = collection.UUID
                props["collection_file_path"] = filepath
+               // h.determineCollection populates the collection_uuid prop with the PDH, if
+               // this collection is being accessed via PDH. In that case, blank the
+               // collection_uuid field so that consumers of the log entries can rely on it
+               // being a UUID, or blank. The PDH remains available via the
+               // portable_data_hash property.
+               if props["collection_uuid"] == collection.PortableDataHash {
+                       props["collection_uuid"] = ""
+               }
        }
        if r.Method == "PUT" || r.Method == "POST" {
                log.Info("File upload")