diff --git a/backend/test/backend_tests/rpc_binfile_test.clj b/backend/test/backend_tests/rpc_binfile_test.clj index 5ebf83bf18..536a980339 100644 --- a/backend/test/backend_tests/rpc_binfile_test.clj +++ b/backend/test/backend_tests/rpc_binfile_test.clj @@ -17,26 +17,18 @@ (t/use-fixtures :once th/state-init) (t/use-fixtures :each th/database-reset) -(t/deftest import-binfile-schema-rejects-file-id +(t/deftest import-binfile-schema-omits-file-id ;; N1-06: file-id parameter must be removed from schema for security - ;; The schema should not accept file-id as a valid parameter (let [schema @#'binfile/schema:import-binfile validator (sm/lazy-validator schema) - ;; Valid params without file-id valid-params {:name "test" :project-id (uuid/random) :version 3 - :upload-id (uuid/random)} + :upload-id (uuid/random)}] - ;; Params with file-id (should be rejected after fix) - params-with-file-id (assoc valid-params :file-id (uuid/random))] - - ;; Valid params without file-id should pass (t/is (true? (validator valid-params)) "params without file-id should be valid") - ;; Params with file-id should fail validation after fix - ;; (Currently this will fail because file-id is still in schema) - (t/is (false? (validator params-with-file-id)) - "params with file-id should be rejected"))) + (t/is (not (contains? (sm/keys (second schema)) :file-id)) + "file-id should not be a declared parameter")))