📎 Test the serving path rejects unconfigured storage targets

The read/serve path (get-object-data) must fail with
:invalid-storage-target when an object references a target id that is
not configured, matching get-object-url and bulk delete. Add the
missing test so removing a target id cannot silently serve from the
wrong place.

Closes #11630

AI-assisted-by: deepseek-flash
This commit is contained in:
Andrey Antukh 2026-09-11 07:29:26 +00:00
parent 6eece49f69
commit e96b8a4798

View File

@ -904,6 +904,17 @@
(t/is (some? ex))
(t/is (= :invalid-storage-target (:code (ex-data ex))))))
(t/deftest s3-get-object-data-rejects-unknown-target
(let [backend (fake-s3-backend-with-targets)
ex (try
(impl/get-object-data backend {:id (uuid/next)
:size 1
:storage-target "ghost"})
nil
(catch Throwable cause cause))]
(t/is (some? ex))
(t/is (= :invalid-storage-target (:code (ex-data ex))))))
(t/deftest s3-target-resolvable-checks-configured-targets
(let [backend (fake-s3-backend-with-targets)]
(t/is (true? (impl/target-resolvable? backend nil)))