[change] Improve endpoints to download firmware images #69
Labels
enhancement
New feature or request
Hacktoberfest
Easy issues for attracting Hacktoberfest participants.
Right now, the API endpoint which shows the image information, has a field, called "file", which links to the private-storage view.
But we also have an API endpoint to download the firmware, although it's implemented differently than the private storage view.
It also looks that the private storage view does not check if the user has "view permission" on the object. So it would be theoretically possible that a staff user without premissions to view firmware images can still download the firmware image, which is a problem.
Therefore, I think we should do the following things:
openwisp_firmware_upgrader.private_storage.views.FirmwareImageDownloadView
fromopenwisp_firmware_upgrader.api.views.FirmwareImageDownloadView
, to avoid duplicating logicfile
attribute ofFirmwareImageSerializer
to point to the API URL (because API supports token authentication (we need a test that ensures the new URL is not the one generated by private_storage)The text was updated successfully, but these errors were encountered: