summaryrefslogtreecommitdiff
path: root/src/leap
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap')
-rw-r--r--src/leap/soledad/server/_blobs.py1
-rw-r--r--src/leap/soledad/server/interfaces.py28
2 files changed, 29 insertions, 0 deletions
diff --git a/src/leap/soledad/server/_blobs.py b/src/leap/soledad/server/_blobs.py
index b6323906..7d51e1b5 100644
--- a/src/leap/soledad/server/_blobs.py
+++ b/src/leap/soledad/server/_blobs.py
@@ -59,6 +59,7 @@ VALID_STRINGS = re.compile('^[a-zA-Z0-9_-]+$')
@implementer(interfaces.IBlobsBackend)
+@implementer(interfaces.IIncomingBoxBackend)
class FilesystemBlobsBackend(object):
def __init__(self, blobs_path='/tmp/blobs/', quota=200 * 1024):
diff --git a/src/leap/soledad/server/interfaces.py b/src/leap/soledad/server/interfaces.py
index 1f97624b..5e586ade 100644
--- a/src/leap/soledad/server/interfaces.py
+++ b/src/leap/soledad/server/interfaces.py
@@ -77,3 +77,31 @@ class IBlobsBackend(Interface):
:returns: a deferred that fires upon finishing.
"""
+
+
+class IIncomingBoxBackend(Interface):
+
+ """
+ An interface for an IncomingBoxBackend implementation.
+ """
+
+ def get_flags(user, blob_id, request, namespace=''):
+ """
+ Given a blob_id, return it's associated flags.
+
+ :returns: a JSON encoded string with a list of flags.
+ """
+
+ def set_flags(self, user, blob_id, request, namespace=''):
+ """
+ Set flags for a blob_id.
+ """
+
+ def list_blobs(self, user, request, namespace='', order_by=None,
+ filter_flag=False):
+ """
+ Blobs listing with flags support. Accepts a filter_flag parameter,
+ which is a flag that can be used to filter results matching it.
+
+ :returns: a deferred that fires upon finishing.
+ """