Expand description
Handlers for HTTP requests to /api/v0/files.
Re-exportsยง
pub use crate::domain::models_requests::UploadClaim;
Structsยง
- Answer
Upload ๐Destination - Who an answer upload is bound to, and where its objects are stored.
- Authorization
Token - Proof that an authorization check passed.
- CmsFiles
ApiDoc ๐ - The upload routes the CMS may call. Only the unbound slug route belongs here: files a teacher
attaches in the exercise editor are referenced from a spec, which never produces an
exercise_task_submission_filesrow, so an answer-upload binding would have them reaped. - Download
Claim ๐Query - The download claim as it rides in the URL the host puts in a grading request.
- Exercise
Upload ๐Binary - OpenAPI-only representation of an arbitrary multipart binary part.
- Files
ApiDoc ๐
Functionsยง
- _add_
routes - Add a route for each controller in this module.
- redirect_
claimed_ ๐file - GET
/api/v0/files/claimed/:file_upload_id?download-claim=:jwtRedirects to one host-stored file, authorized by a claim naming that file. - redirect_
to_ ๐storage_ service - GET
/api/v0/files/\*Redirects the request to a file storage service. - serve_
upload ๐ - GET
/api/v0/files/uploads/\*Serve local uploaded file, mostly for development. - store_
answer_ ๐uploads - Stores the multipart parts and binds them to the exercise and user, so that a failure to record the binding cannot leave uploads the reaper is unable to find.
- upload_
answer_ ๐files - POST
/api/v0/files/answer-uploads/:exercise_task_idUsed to upload the files a student is attaching to an answer for the given exercise task. - upload_
from_ ๐exercise_ service - POST
/api/v0/files/:exercise_service_slugUsed to upload data from exercise service iframes.