Implement the entire file upload as an API view wherein the user uploads a file, and in the backend the file gets split into horcruxes and gets uploaded to various file storage platforms like Google Drive and Dropbox.
The Google Drive API requires the user to be authenticated via Google OAuth. Also, the user will have to provide access to the application to access their Google Drive. For this, Google OAuth needs to be set up.
Right now, there is no error handling implemented for the case when due to some reason, a horcrux is not found on one of user's file storage services (for example in case the user deletes a horcrux by mistake).
Implement the error handling for uploads, downloads and delete API. In case the exception handling is triggered, delete the file record from the database as well, and then return a valid response in the form of {"message": "Horcrux not found on user's account. The file is no longer readable. Deleting from the chamber."}
Create RSA public-private key pair generation module in the authenticate app. This module will be required for generating the asymmetric keys at the time of user signup.
Implement a GET API endpoint in the backend that gets all the files that were uploaded by the user. The user can then decide which file they want to download.
Integrate the download file API workflow, where horcruxes are downloaded from various file storages, then recombination and decrypted into the original file, which is then sent to the client as an HTTP response.
This table stores the info such as the owner of the file, the name of the file, and the links/urls of the uploaded horcruxes.
This table should have a 1:n relationship with the User model, i.e., one user (owner) can have multiple files.
Implement server-flow OAuth for OneDrive with read-write access to the user's OneDrive storage so that the horcruxes can be uploaded, downloaded and deleted from the storage.
For this, you need to also implement the GET method to generate the authentication URI and the POST method to authenticate the user using the authentication token.
Refer to the authenticate/google_auth.py , authenticate/dropbox_auth.py and authenticate/views.py files for insights on the implementation.
Right now both the first and third horcruxes are getting uploaded to the user's Google Drive. Same with the downloads and deletes. Instead, once the OneDrive OAuth is implemented, make it so that the third horcrux goes on the user's OneDrive.