From 9b899aa21d4d0fe2935577c9ffa4fd367d7d0f7e Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Mon, 26 Aug 2013 15:35:17 +0200 Subject: add crate icon and link --- README.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index f542214..8aedfb4 100644 --- a/README.rst +++ b/README.rst @@ -1,6 +1,8 @@ LEAP's Key Manager ================== +.. image:: https://pypip.in/v/leap.keymanager/badge.png + :target: https://crate.io/packages/leap.keymanager -The Key Manager is a Nicknym agent for LEAP client: +The Key Manager is a Nicknym agent for the LEAP project: https://leap.se/pt/docs/design/nicknym -- cgit v1.2.3 From 97d72aeda6ea094590069ba0d671c00404409d83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Thu, 29 Aug 2013 17:41:43 -0300 Subject: Do not raise on not 2XX error codes Also accept unicode ascii keys --- changes/bug_minor_issues | 4 ++++ src/leap/keymanager/__init__.py | 15 ++++++++++----- src/leap/keymanager/openpgp.py | 4 ++-- 3 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 changes/bug_minor_issues diff --git a/changes/bug_minor_issues b/changes/bug_minor_issues new file mode 100644 index 0000000..91a69ed --- /dev/null +++ b/changes/bug_minor_issues @@ -0,0 +1,4 @@ + o Do not raise exception when a GET request doesn't return 2XX + code. Nickserver uses error codes for more verbosity in the + result. + o Accept unicode ascii keys along with str. \ No newline at end of file diff --git a/src/leap/keymanager/__init__.py b/src/leap/keymanager/__init__.py index 05cbcca..2f39ad9 100644 --- a/src/leap/keymanager/__init__.py +++ b/src/leap/keymanager/__init__.py @@ -127,11 +127,16 @@ class KeyManager(object): self._ca_cert_path is not None, 'We need the CA certificate path!') res = self._fetcher.get(uri, data=data, verify=self._ca_cert_path) - # assert that the response is valid - res.raise_for_status() - leap_assert( - res.headers['content-type'].startswith('application/json'), - 'Content-type is not JSON.') + # Nickserver now returns 404 for key not found and 500 for + # other cases (like key too small), so we are skipping this + # check for the time being + # res.raise_for_status() + + # Responses are now text/plain, although it's json anyway, but + # this will fail when it shouldn't + # leap_assert( + # res.headers['content-type'].startswith('application/json'), + # 'Content-type is not JSON.') return res def _put(self, uri, data=None): diff --git a/src/leap/keymanager/openpgp.py b/src/leap/keymanager/openpgp.py index aa04ed0..7946db8 100644 --- a/src/leap/keymanager/openpgp.py +++ b/src/leap/keymanager/openpgp.py @@ -301,9 +301,9 @@ class OpenPGPScheme(EncryptionScheme): Put key contained in ascii-armored C{key_data} in local storage. :param key_data: The key data to be stored. - :type key_data: str + :type key_data: str or unicode """ - leap_assert_type(key_data, str) + leap_assert_type(key_data, (str, unicode)) # TODO: add more checks for correct key data. leap_assert(key_data is not None, 'Data does not represent a key.') -- cgit v1.2.3 From 701632bfd4fcb2c2d0e3231ad8dd5f188333df13 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Mon, 2 Sep 2013 01:04:51 +0200 Subject: assert nonnull soledad --- src/leap/keymanager/keys.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/leap/keymanager/keys.py b/src/leap/keymanager/keys.py index 1c33745..b8e88d4 100644 --- a/src/leap/keymanager/keys.py +++ b/src/leap/keymanager/keys.py @@ -219,6 +219,8 @@ class EncryptionScheme(object): """ Initialize the database indexes. """ + leap_assert(self._soledad is not None, + "Cannot init indexes with null soledad") # Ask the database for currently existing indexes. db_indexes = dict(self._soledad.list_indexes()) # Loop through the indexes we expect to find. -- cgit v1.2.3 From 53bdad6a6bb43113754f2cdf137abeea27bf8507 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Fri, 6 Sep 2013 15:27:18 -0300 Subject: Fold in changes. --- CHANGELOG | 6 ++++++ changes/bug_minor_issues | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) delete mode 100644 changes/bug_minor_issues diff --git a/CHANGELOG b/CHANGELOG index d2e45aa..9cd53b3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,9 @@ +0.3.2 Sep 6: + o Do not raise exception when a GET request doesn't return 2XX + code. Nickserver uses error codes for more verbosity in the + result. + o Accept unicode ascii keys along with str. + 0.3.1 Aug 23: o Signal different key related events, like key generation, key upload. diff --git a/changes/bug_minor_issues b/changes/bug_minor_issues deleted file mode 100644 index 91a69ed..0000000 --- a/changes/bug_minor_issues +++ /dev/null @@ -1,4 +0,0 @@ - o Do not raise exception when a GET request doesn't return 2XX - code. Nickserver uses error codes for more verbosity in the - result. - o Accept unicode ascii keys along with str. \ No newline at end of file -- cgit v1.2.3