From e96b8a4798fa962fe1280cf5c7f6d0c1f13a58f8 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Fri, 11 Sep 2026 07:29:26 +0000 Subject: [PATCH] :paperclip: 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 --- backend/test/backend_tests/storage_test.clj | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/backend/test/backend_tests/storage_test.clj b/backend/test/backend_tests/storage_test.clj index 1bf3d1ce45..21a77c9111 100644 --- a/backend/test/backend_tests/storage_test.clj +++ b/backend/test/backend_tests/storage_test.clj @@ -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)))