tanishqgandhi1908 opened a new pull request, #9099:
URL: https://github.com/apache/texera/pull/9099

   ### What changes were proposed in this PR?
   
   Two dataset endpoints skipped input checks the model endpoints already make, 
so bad input produced a 500:
   
   1. **A version from another dataset.** The version file-list endpoints 
(owner and public) and `versionZip` checked access on `did` but loaded version 
`dvid` without checking it belongs to `did`. `getDatasetVersionByID` now 
filters on `did` as well, like `getModelVersionByID`, so a version from another 
dataset returns 404.
   2. **No `type` on multipart upload.** `POST /dataset/multipart-upload` 
called `toLowerCase` on a missing `type`. The model endpoint's check is now a 
shared `ResourceUploadService.multipartOperationOrThrow`, used by both, which 
returns 400 for a missing or unknown `type`.
   
   ```
                                                                       before   
after
   GET  /dataset/215/publicVersion/16/rootFileNodes   (16 belongs to 216)   500 
     404
   GET  /dataset/215/publicVersion/15/rootFileNodes   (its own version)     200 
     200
   POST /dataset/multipart-upload  (no type)                                500 
     400
   ```
   
   ### Any related issues, documentation, discussions?
   
   Closes #9098
   
   ### How was this PR tested?
   
   Added three cases to `DatasetResourceSpec`: another dataset's version 
returns 404 from the public and owner file-list endpoints and from 
`versionZip`, and a missing `type` returns 400. All fail without the fix.
   
   ```
   sbt "FileService/testOnly *DatasetResourceSpec *ModelResourceSpec 
*ModelUploadResourceSpec"
   # Tests: succeeded 197, failed 0
   ```
   
   Also checked against a local stack with `curl` (table above).
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Claude Opus 5.5)
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to