summaryrefslogtreecommitdiff
path: root/src/leap/soledad
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2017-08-07 19:37:48 -0300
committerKali Kaneko <kali@leap.se>2017-08-11 18:41:20 -0400
commit0942f91b1f09f2ee69d88aa51edfb83cb2b6a7be (patch)
tree37c97a51ebb698acb1643addcc6d5c6bd1c4716b /src/leap/soledad
parent02e4200b34b80544f6a627d4744218990aa86a39 (diff)
[refactor] add IIncomingBoxBackend
IIncomingBoxBackend holds backend specific methods used for IncomingBox implementation. - Resolves: #8888
Diffstat (limited to 'src/leap/soledad')
-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.
+ """