Add file structure validation on binfile import

This commit is contained in:
Andrey Antukh 2023-11-11 00:07:58 +01:00
parent 19c5d32a89
commit 31c46a90b4

View file

@ -12,6 +12,7 @@
[app.common.features :as cfeat] [app.common.features :as cfeat]
[app.common.files.defaults :as cfd] [app.common.files.defaults :as cfd]
[app.common.files.migrations :as pmg] [app.common.files.migrations :as pmg]
[app.common.files.validate :as fval]
[app.common.fressian :as fres] [app.common.fressian :as fres]
[app.common.logging :as l] [app.common.logging :as l]
[app.common.spec :as us] [app.common.spec :as us]
@ -743,7 +744,13 @@
(update :pages-index relink-shapes) (update :pages-index relink-shapes)
(update :components relink-shapes) (update :components relink-shapes)
(update :media relink-media) (update :media relink-media)
(pmg/migrate-data)))) (pmg/migrate-data)
(d/without-nils))))
;; Without providing all libs, here we just
;; peform a structural file data validation,
;; full referential check is omited.
(fval/validate-file!)
(postprocess-file) (postprocess-file)
(update :features #(db/create-array conn "text" %)) (update :features #(db/create-array conn "text" %))
(update :data blob/encode))] (update :data blob/encode))]