summaryrefslogtreecommitdiff
path: root/client/src/leap
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/leap')
-rw-r--r--client/src/leap/soledad/client/_secrets/__init__.py7
-rw-r--r--client/src/leap/soledad/client/_secrets/storage.py12
-rw-r--r--client/src/leap/soledad/client/_secrets/util.py7
3 files changed, 13 insertions, 13 deletions
diff --git a/client/src/leap/soledad/client/_secrets/__init__.py b/client/src/leap/soledad/client/_secrets/__init__.py
index 42fe5a2d..26294364 100644
--- a/client/src/leap/soledad/client/_secrets/__init__.py
+++ b/client/src/leap/soledad/client/_secrets/__init__.py
@@ -24,7 +24,7 @@ from leap.soledad.common.log import getLogger
from leap.soledad.client._secrets.storage import SecretsStorage
from leap.soledad.client._secrets.crypto import SecretsCrypto
-from leap.soledad.client._secrets.util import emit
+from leap.soledad.client._secrets.util import emit, EmitMixin
logger = getLogger(__name__)
@@ -33,7 +33,7 @@ logger = getLogger(__name__)
SecretLength = namedtuple('SecretLength', 'name length')
-class Secrets(object):
+class Secrets(EmitMixin):
# remote secret is used
@@ -45,9 +45,10 @@ class Secrets(object):
def __init__(self, uuid, passphrase, url, local_path, creds, userid,
shared_db=None):
+ self._uuid = uuid
self._passphrase = passphrase
+ self._userid = userid
self._secrets = {}
- self._user_data = {'uuid': uuid, 'userid': userid}
self.crypto = SecretsCrypto(self.get_passphrase)
self.storage = SecretsStorage(
uuid, self.get_passphrase, url, local_path, creds, userid,
diff --git a/client/src/leap/soledad/client/_secrets/storage.py b/client/src/leap/soledad/client/_secrets/storage.py
index da3aa9d7..730926ee 100644
--- a/client/src/leap/soledad/client/_secrets/storage.py
+++ b/client/src/leap/soledad/client/_secrets/storage.py
@@ -25,13 +25,13 @@ from leap.soledad.common.log import getLogger
from leap.soledad.common.document import SoledadDocument
from leap.soledad.client.shared_db import SoledadSharedDatabase
-from leap.soledad.client._secrets.util import emit
+from leap.soledad.client._secrets.util import emit, EmitMixin
logger = getLogger(__name__)
-class SecretsStorage(object):
+class SecretsStorage(EmitMixin):
def __init__(self, uuid, get_pass, url, local_path, creds, userid,
shared_db=None):
@@ -44,14 +44,6 @@ class SecretsStorage(object):
self.__remote_doc = None
#
- # properties
- #
-
- @property
- def _user_data(self):
- return {'uuid': self._uuid, 'userid': self._userid}
-
- #
# local storage
#
diff --git a/client/src/leap/soledad/client/_secrets/util.py b/client/src/leap/soledad/client/_secrets/util.py
index f75b2bb6..0dcdd3af 100644
--- a/client/src/leap/soledad/client/_secrets/util.py
+++ b/client/src/leap/soledad/client/_secrets/util.py
@@ -23,6 +23,13 @@ class SecretsError(Exception):
pass
+class EmitMixin(object):
+
+ @property
+ def _user_data(self):
+ return {'uuid': self._uuid, 'userid': self._userid}
+
+
def emit(verb):
def _decorator(method):
def _decorated(self, *args, **kwargs):