summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/leap/soledad/server/_blobs.py2
-rw-r--r--src/leap/soledad/server/interfaces.py6
2 files changed, 6 insertions, 2 deletions
diff --git a/src/leap/soledad/server/_blobs.py b/src/leap/soledad/server/_blobs.py
index 7648e18e..37247c9e 100644
--- a/src/leap/soledad/server/_blobs.py
+++ b/src/leap/soledad/server/_blobs.py
@@ -111,6 +111,8 @@ class FilesystemBlobsBackend(object):
blob_ids.sort(key=lambda x: os.path.getmtime(x))
elif order_by == '-date':
blob_ids.sort(key=lambda x: os.path.getmtime(x), reverse=True)
+ elif order_by:
+ raise Exception("Unsupported order_by parameter: %s" % order_by)
blob_ids = [os.path.basename(path) for path in blob_ids]
return json.dumps(blob_ids)
diff --git a/src/leap/soledad/server/interfaces.py b/src/leap/soledad/server/interfaces.py
index ccb2ffdc..ee73aac8 100644
--- a/src/leap/soledad/server/interfaces.py
+++ b/src/leap/soledad/server/interfaces.py
@@ -49,9 +49,11 @@ class IBlobsBackend(Interface):
Get the size of the given blob id.
"""
- def list_blobs(user, request, namespace=''):
+ def list_blobs(user, request, namespace='', order_by=None):
"""
- Returns a json-encoded list of ids from user's blob.
+ Returns a json-encoded list of ids from user's blobs storage,
+ optionally ordered by order_by parameter and optionally restricted by
+ namespace.
:returns: a deferred that fires upon finishing.
"""