summaryrefslogtreecommitdiff
path: root/soledad/src
diff options
context:
space:
mode:
Diffstat (limited to 'soledad/src')
-rw-r--r--soledad/src/leap/soledad/__init__.py11
-rw-r--r--soledad/src/leap/soledad/tests/test_soledad.py7
2 files changed, 17 insertions, 1 deletions
diff --git a/soledad/src/leap/soledad/__init__.py b/soledad/src/leap/soledad/__init__.py
index 00ac21f8..638ead8a 100644
--- a/soledad/src/leap/soledad/__init__.py
+++ b/soledad/src/leap/soledad/__init__.py
@@ -238,7 +238,7 @@ class Soledad(object):
MINIMUM_PASSPHRASE_LENGTH = 6
"""
The minimum length for a passphrase. The passphrase length is only checked
- when the user changes her passphras, not when she instantiates Soledad.
+ when the user changes her passphrase, not when she instantiates Soledad.
"""
IV_SEPARATOR = ":"
@@ -1120,6 +1120,14 @@ class Soledad(object):
_get_storage_secret,
doc='The secret used for symmetric encryption.')
+ def _get_passphrase(self):
+ return self._passphrase
+
+ passphrase = property(
+ _get_passphrase,
+ doc='The passphrase for locking and unlocking encryption secrets for '
+ 'local and remote storage.')
+
#-----------------------------------------------------------------------------
# Monkey patching u1db to be able to provide a custom SSL cert
@@ -1128,6 +1136,7 @@ class Soledad(object):
# We need a more reasonable timeout (in seconds)
SOLEDAD_TIMEOUT = 10
+
class VerifiedHTTPSConnection(httplib.HTTPSConnection):
"""HTTPSConnection verifying server side certificates."""
# derived from httplib.py
diff --git a/soledad/src/leap/soledad/tests/test_soledad.py b/soledad/src/leap/soledad/tests/test_soledad.py
index 875ecc56..63ab5551 100644
--- a/soledad/src/leap/soledad/tests/test_soledad.py
+++ b/soledad/src/leap/soledad/tests/test_soledad.py
@@ -140,6 +140,13 @@ class AuxMethodsTestCase(BaseSoledadTest):
soledad.PassphraseTooShort,
sol.change_passphrase, '54321')
+ def test_get_passphrase(self):
+ """
+ Assert passphrase getter works fine.
+ """
+ sol = self._soledad_instance()
+ self.assertEqual('123', sol.passphrase)
+
class SoledadSharedDBTestCase(BaseSoledadTest):
"""