summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2017-05-02 00:08:27 -0300
committerVictor Shyba <victor1984@riseup.net>2017-05-02 00:18:32 -0300
commit8a6c8274c37b045d1a6198b6ff585940811da18a (patch)
treee9f9cbaf6ed77d1cc5c643df949cc904aafaaeeb /server/src
parent03617fc9378b9f8cf6fec77bd53c573131ade75b (diff)
[feature] add and integrate DELETE to blobs server
Add a DELETE method for blobs server and integrate it into client's BlobManager. - Resolves: #8846
Diffstat (limited to 'server/src')
-rw-r--r--server/src/leap/soledad/server/_blobs.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/server/src/leap/soledad/server/_blobs.py b/server/src/leap/soledad/server/_blobs.py
index 1595a549..44abeb44 100644
--- a/server/src/leap/soledad/server/_blobs.py
+++ b/server/src/leap/soledad/server/_blobs.py
@@ -157,8 +157,9 @@ class FilesystemBlobsBackend(object):
def get_total_storage(self, user):
return self._get_disk_usage(self._get_path(user))
- def delete_blob(user, blob_id):
- raise NotImplementedError
+ def delete_blob(self, user, blob_id):
+ blob_path = self._get_path(user, blob_id)
+ os.unlink(blob_path)
def get_blob_size(user, blob_id):
raise NotImplementedError
@@ -219,6 +220,12 @@ class BlobsResource(resource.Resource):
self._handler.tag_header(user, blob_id, request)
return self._handler.read_blob(user, blob_id, request)
+ def render_DELETE(self, request):
+ logger.info("http put: %s" % request.path)
+ user, blob_id = self._validate(request)
+ self._handler.delete_blob(user, blob_id)
+ return ''
+
def render_PUT(self, request):
logger.info("http put: %s" % request.path)
user, blob_id = self._validate(request)