add audit trail

This commit is contained in:
Alex Turchyn
2023-09-10 19:25:57 +03:00
parent 8cabe31827
commit cf6cacdc92
11 changed files with 296 additions and 15 deletions
+2
View File
@@ -19,6 +19,7 @@ module Templates
if blob.content_type == PDF_CONTENT_TYPE && blob.metadata['pdf'].nil?
blob.metadata['pdf'] = { 'annotations' => Templates::BuildAnnotations.call(document_data) }
blob.metadata['sha256'] = Base64.urlsafe_encode64(Digest::SHA256.digest(document_data))
end
blob.save!
@@ -37,6 +38,7 @@ module Templates
if file.content_type == PDF_CONTENT_TYPE
metadata = { 'identified' => true, 'analyzed' => true,
'sha256' => Base64.urlsafe_encode64(Digest::SHA256.digest(data)),
'pdf' => { 'annotations' => Templates::BuildAnnotations.call(data) } }
end