diff options
author | Ruben Pollan <meskio@sindominio.net> | 2014-09-15 14:07:58 -0500 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2014-09-16 11:41:06 -0500 |
commit | 7f36a336362a19fe5a426a08863ff4b05b003e31 (patch) | |
tree | 6d98d8057eca8efb59fc497802c42c472f12606c | |
parent | 792f8236e2fcdb8ba14867db2c1a527a2e5adb4b (diff) |
Remove refresh_keys
Never should be done a bulk upload of keys. The updating of the keys
should not be a task for the user of the keymanager. Keys will be updated
by the keymanager in a background worker one per one.
-rw-r--r-- | keymanager/src/leap/keymanager/__init__.py | 13 | ||||
-rw-r--r-- | keymanager/src/leap/keymanager/tests/test_keymanager.py | 17 |
2 files changed, 0 insertions, 30 deletions
diff --git a/keymanager/src/leap/keymanager/__init__.py b/keymanager/src/leap/keymanager/__init__.py index 65352a86..4563d804 100644 --- a/keymanager/src/leap/keymanager/__init__.py +++ b/keymanager/src/leap/keymanager/__init__.py @@ -324,19 +324,6 @@ class KeyManager(object): KEYMANAGER_KEY_TAG, '1' if private else '0')) - def refresh_keys(self): - """ - Fetch keys from nickserver and update them locally. - """ - addresses = set(map( - lambda doc: doc.address, - self.get_all_keys_in_local_db(private=False))) - for address in addresses: - # do not attempt to refresh our own key - if address == self._address: - continue - self._fetch_keys_from_server(address) - def gen_key(self, ktype): """ Generate a key of type C{ktype} bound to the user's address. diff --git a/keymanager/src/leap/keymanager/tests/test_keymanager.py b/keymanager/src/leap/keymanager/tests/test_keymanager.py index f89dcd9b..932f2602 100644 --- a/keymanager/src/leap/keymanager/tests/test_keymanager.py +++ b/keymanager/src/leap/keymanager/tests/test_keymanager.py @@ -437,23 +437,6 @@ class KeyManagerKeyManagementTestCase(KeyManagerWithSoledadTestCase): verify='cacertpath', ) - def test_refresh_keys_does_not_refresh_own_key(self): - """ - Test that refreshing keys will not attempt to refresh our own key. - """ - km = self._key_manager() - # we add 2 keys but we expect it to only refresh the second one. - km._wrapper_map[OpenPGPKey].put_ascii_key(PUBLIC_KEY) - km._wrapper_map[OpenPGPKey].put_ascii_key(PUBLIC_KEY_2) - # mock the key fetching - km._fetch_keys_from_server = Mock(return_value=[]) - km.ca_cert_path = '' # some bogus path so the km does not complain. - # do the refreshing - km.refresh_keys() - km._fetch_keys_from_server.assert_called_once_with( - ADDRESS_2 - ) - def test_get_key_fetches_from_server(self): """ Test that getting a key successfuly fetches from server. |