24ecdbd251
Add the first upload API endpoint from PLAN.md. POST /api/uploads now validates the requested file name, generates a server-owned upload id, creates the staging and complete directory layout, and writes durable meta.json before returning chunk scheduling details to the browser. Keep filesystem layout knowledge in storage.rs so later chunk upload and completion work can reuse the same boundary. API handlers translate storage errors into JSON HTTP responses without leaking layout details into the router. Document the new modules and UPL_DATA_DIR configuration, and extend TESTS.md with the automated creation coverage. Test Plan: - just check Refs: PLAN.md milestone 2
1.0 KiB
1.0 KiB
Test Scenarios
Keep this file as the reusable verification checklist while implementing
PLAN.md.
Automated
just check- Runs formatting, all Rust tests, and clippy.
- Current coverage:
GET /serves the static browser page.GET /healthzreportsok.POST /api/uploadscreatesmeta.jsonand chunk directories.POST /api/uploadsrejects an empty file name.
Manual
These scenarios come from PLAN.md and should be retested as the matching
features land.
- Upload a small file in one pass.
- Upload a file larger than one chunk.
- Kill the browser tab mid-upload and resume.
- Restart the Rust server mid-upload and resume.
- Interrupt the network and resume.
- Retry a duplicate chunk and confirm it is accepted idempotently.
- Attempt an invalid chunk index and confirm it is rejected.
- Attempt a wrong-size non-final chunk and confirm it is rejected.
- Complete an upload and compare the final file with the source file:
sha256sum source-file data/complete/uploaded-file