Debian repository: dedicated upload route for direct uploads
🔥 Problem
In !101838 (merged), the Debian Repository was updated to support direct uploads of *.deb
and *.udeb
files.
The upload route for that, was the existing one: PUT projects/:id/packages/debian/:file_name
.
As we can see, the :file_name
needs to be supplied by users. We end up with a command like:
$ curl -T file.deb "http://<username>:<password>@<host+port>/api/v4/projects/<project_id>/packages/debian/<mandatory_file_name>.deb?distribution=$codename&component=main"
It would be a nicer UX to have
$ curl -T file.deb "http://<username>:<password>@<host+port>/api/v4/projects/<project_id>/packages/debian?distribution=$codename&component=main"
🚒 Solution
- Implement a new route for
PUT
with no filename. - Add support for that route in workhorse.
- Handle the file the exact same way that !101838 (merged) handles it.
- Update the documentation. See !114951 (merged).
Doubts:
- In the
/authorize
endpoint, is there a way to get the filename? I doubt it since it's a body upload.- This means we can't have a check on the filename.
Edited by David Fernandez