mirror of
https://github.com/penpot/penpot.git
synced 2026-10-30 06:20:32 +00:00
📎 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:
parent
6eece49f69
commit
e96b8a4798
@ -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)))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user