aksiksi / vaulty

A service that allows users to send email directly to a cloud storage service.
https://vaulty.net
4 stars 0 forks source link

Implement GDrive storage backend #28

Open aksiksi opened 4 years ago

aksiksi commented 4 years ago

Links

Notes

Endpoints

File upload/create: https://developers.google.com/drive/api/v3/reference/files/create

Example curl request to upload file to a folder (two steps):

$ curl -i --request POST "https://www.googleapis.com/upload/drive/v3/files?uploadType=resumable&key=YOUR_KEY" --header 'Content-Type: application/json' --header 'Authorization: Bearer YOUR_TOKEN' --data '{"name": "hello.txt", "parents": ["0B9bIgbhJcgN1VkhESjRqR1F4Q3c"]}'

HEADERS:
location: LOCATION_URL
$ curl -i --request PUT "LOCATION_URL" -H "Content-Type: text/plain" -H "Content-Length: 14" --data-binary "@/home/work/Downloads/hello.txt"
RETURNS:
{
 "kind": "drive#file",
 "id": "167IzkdvqywxEfbU_b6wwQJ1ErNCe4rsm",
 "name": "hello.txt",
 "mimeType": "text/plain"
}

TODO

Related to #17.