diff options
-rw-r--r-- | CHANGELOG | 16 | ||||
-rw-r--r-- | client/changes/bug-7412_sync-status-broken | 1 | ||||
-rw-r--r-- | client/changes/refactor_improve_http_target | 3 | ||||
-rw-r--r-- | client/src/leap/soledad/client/secrets.py | 23 | ||||
-rw-r--r-- | common/changes/refactor_couch | 2 | ||||
-rw-r--r-- | server/changes/bug_badrequest | 1 |
6 files changed, 28 insertions, 18 deletions
@@ -1,3 +1,19 @@ +0.7.3 Sep 22, 2015: +Client: + o Bugfix: refactor code loss. Closes #7412. + o Bugfix: Set active secret before saving local file. + o Split http_target into 4 modules, separating those responsibilities. + o Refactor details of making an HTTP request body and headers out of the + send/fetch logic. This also makes it easier to enable batching. + +Server: + o Fix a bug where BadRequest could be raised after everything was persisted. + +Common: + o Refactor couch.py to separate persistence from logic while saving uploaded + documents. Also simplify logic while checking for conflicts. + + 0.7.2 Aug 26, 2015: Client: o Remove MAC from secrets file. Closes #6980. diff --git a/client/changes/bug-7412_sync-status-broken b/client/changes/bug-7412_sync-status-broken deleted file mode 100644 index b6800bc5..00000000 --- a/client/changes/bug-7412_sync-status-broken +++ /dev/null @@ -1 +0,0 @@ -o Fix refactor code loss. Closes #7412. diff --git a/client/changes/refactor_improve_http_target b/client/changes/refactor_improve_http_target deleted file mode 100644 index a8fe5f60..00000000 --- a/client/changes/refactor_improve_http_target +++ /dev/null @@ -1,3 +0,0 @@ - o Split http_target into 4 modules, separating those responsibilities. - o Refactor details of making an HTTP request body and headers out of the - send/fetch logic. This also makes it easier to enable batching. diff --git a/client/src/leap/soledad/client/secrets.py b/client/src/leap/soledad/client/secrets.py index 9aadd72a..c3c3dff5 100644 --- a/client/src/leap/soledad/client/secrets.py +++ b/client/src/leap/soledad/client/secrets.py @@ -261,6 +261,16 @@ class SoledadSecrets(object): logger.info("Could not find a secret in local storage.") return False + def _maybe_set_active_secret(self, active_secret): + """ + If no secret_id is already set, choose the passed active secret, or + just choose first secret available if none. + """ + if not self._secret_id: + if not active_secret: + active_secret = self._secrets.items()[0][0] + self.set_secret_id(active_secret) + def _load_secrets(self): """ Load storage secrets from local file. @@ -270,12 +280,7 @@ class SoledadSecrets(object): with open(self._secrets_path, 'r') as f: content = json.loads(f.read()) _, active_secret = self._import_recovery_document(content) - # choose first secret if no secret_id was given - if self._secret_id is None: - if active_secret is None: - self.set_secret_id(self._secrets.items()[0][0]) - else: - self.set_secret_id(active_secret) + self._maybe_set_active_secret(active_secret) # enlarge secret if needed enlarged = False if len(self._secrets[self._secret_id]) < self.GEN_SECRET_LENGTH: @@ -306,12 +311,8 @@ class SoledadSecrets(object): 'Found cryptographic secrets in shared recovery ' 'database.') _, active_secret = self._import_recovery_document(doc.content) + self._maybe_set_active_secret(active_secret) self._store_secrets() # save new secrets in local file - if self._secret_id is None: - if active_secret is None: - self.set_secret_id(self._secrets.items()[0][0]) - else: - self.set_secret_id(active_secret) else: # STAGE 3 - there are no secrets in server also, so # generate a secret and store it in remote db. diff --git a/common/changes/refactor_couch b/common/changes/refactor_couch deleted file mode 100644 index 2f36b97f..00000000 --- a/common/changes/refactor_couch +++ /dev/null @@ -1,2 +0,0 @@ - o Refactor couch.py to separate persistence from logic while saving uploaded - documents. Also simplify logic while checking for conflicts. diff --git a/server/changes/bug_badrequest b/server/changes/bug_badrequest deleted file mode 100644 index 74901476..00000000 --- a/server/changes/bug_badrequest +++ /dev/null @@ -1 +0,0 @@ - o Fix a bug where BadRequest could be raised after everything was persisted |