From d022428a695ba5c499fcd0c8a9681962c006b8e8 Mon Sep 17 00:00:00 2001 From: drebs Date: Fri, 24 May 2013 12:59:21 -0300 Subject: Add action validation in server. * Use routes for validating user actions when interacting with server. * Also add tests for action validation. * Add changes file. * Closes #2356. --- src/leap/soledad/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/leap/soledad/__init__.py') diff --git a/src/leap/soledad/__init__.py b/src/leap/soledad/__init__.py index 94a21447..c9bf3f76 100644 --- a/src/leap/soledad/__init__.py +++ b/src/leap/soledad/__init__.py @@ -71,6 +71,7 @@ Path to the certificate file used to certify the SSL connection between Soledad client and server. """ +SECRETS_DOC_ID_HASH_PREFIX = 'uuid-' # # Exceptions @@ -522,7 +523,10 @@ class Soledad(object): @return: the hash @rtype: str """ - return sha256('uuid-%s' % self._uuid).hexdigest() + return sha256( + '%s%s' % ( + SECRETS_DOC_ID_HASH_PREFIX, + self._uuid)).hexdigest() def _shared_db(self): """ -- cgit v1.2.3 From fdb52571378d1e6d522a74ad29833114a7eccd2e Mon Sep 17 00:00:00 2001 From: drebs Date: Sat, 25 May 2013 10:34:14 -0300 Subject: Remove unneeded exceptions. --- src/leap/soledad/__init__.py | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'src/leap/soledad/__init__.py') diff --git a/src/leap/soledad/__init__.py b/src/leap/soledad/__init__.py index c9bf3f76..b847364f 100644 --- a/src/leap/soledad/__init__.py +++ b/src/leap/soledad/__init__.py @@ -73,27 +73,6 @@ Soledad client and server. SECRETS_DOC_ID_HASH_PREFIX = 'uuid-' -# -# Exceptions -# - -class KeyDoesNotExist(Exception): - """ - Soledad attempted to find a key that does not exist locally. - """ - - -class KeyAlreadyExists(Exception): - """ - Soledad attempted to create a key that already exists locally. - """ - - -class NotADirectory(Exception): - """ - Expected a path for a directory but got some other thing. - """ - # # Soledad: local encrypted storage and remote encrypted sync. -- cgit v1.2.3