diff options
author | Kali Kaneko <kali@leap.se> | 2017-05-08 14:33:38 +0200 |
---|---|---|
committer | drebs <drebs@leap.se> | 2017-07-18 16:00:30 -0300 |
commit | 3135421cbfded2111328178505b98753b9644a65 (patch) | |
tree | 5563705f738c53e3800bc9b4fc97f463e9c41ab8 /src/leap | |
parent | 92a34ab8ad7c2373c9d607d0e3f21a687761c9fc (diff) |
[feat] toggle switch for blobs in the client
- Resolves: #8839
Diffstat (limited to 'src/leap')
-rw-r--r-- | src/leap/soledad/client/api.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/leap/soledad/client/api.py b/src/leap/soledad/client/api.py index c62b43f0..f7854158 100644 --- a/src/leap/soledad/client/api.py +++ b/src/leap/soledad/client/api.py @@ -109,7 +109,7 @@ class Soledad(object): def __init__(self, uuid, passphrase, secrets_path, local_db_path, server_url, cert_file, shared_db=None, - auth_token=None): + auth_token=None, with_blobs=False): """ Initialize configuration, cryptographic keys and dbs. @@ -146,6 +146,12 @@ class Soledad(object): Authorization token for accessing remote databases. :type auth_token: str + :param with_blobs: + A boolean that specifies if this soledad instance should enable + blobs storage when initialized. This will raise if it's not the + first initialization and the passed value is different from when + the database was first initialized. + :raise BootstrapSequenceError: Raised when the secret initialization sequence (i.e. retrieval from server or generation and storage on server) has failed for @@ -172,7 +178,6 @@ class Soledad(object): self._recovery_code = RecoveryCode() self._secrets = Secrets(self) self._crypto = SoledadCrypto(self._secrets.remote_secret) - self._init_blobmanager() try: # initialize database access, trap any problems so we can shutdown @@ -188,6 +193,11 @@ class Soledad(object): self._dbpool.close() raise + if with_blobs: + self._init_blobmanager() + else: + self.blobmanager = None + # # initialization/destruction methods # |