summaryrefslogtreecommitdiff
path: root/src/leap/keymanager/__init__.py
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-12-17 14:57:59 -0300
committerTomás Touceda <chiiph@leap.se>2013-12-17 14:57:59 -0300
commit3d7d74fa5759b168eb57e4259ad56bcb71f9a4a0 (patch)
tree3ddbec84c37df60b0689f1053a7ec93a4421ecd2 /src/leap/keymanager/__init__.py
parent77e4e1d037a8eb796553b3f28f31e4f4d1ccee84 (diff)
parent27c25df5533f9312c93fa79af2d7a442b389b9b8 (diff)
Merge remote-tracking branch 'refs/remotes/kali/feature/memoize-calls' into develop
Diffstat (limited to 'src/leap/keymanager/__init__.py')
-rw-r--r--src/leap/keymanager/__init__.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/leap/keymanager/__init__.py b/src/leap/keymanager/__init__.py
index 6cfbf71..5b1d8d9 100644
--- a/src/leap/keymanager/__init__.py
+++ b/src/leap/keymanager/__init__.py
@@ -46,6 +46,7 @@ import requests
from leap.common.check import leap_assert, leap_assert_type
from leap.common.events import signal
from leap.common.events import events_pb2 as proto
+from leap.common.decorators import memoized_method
from leap.keymanager.errors import KeyNotFound
@@ -250,6 +251,7 @@ class KeyManager(object):
self._put(uri, data)
signal(proto.KEYMANAGER_DONE_UPLOADING_KEYS, self._address)
+ @memoized_method
def get_key(self, address, ktype, private=False, fetch_remote=True):
"""
Return a key of type C{ktype} bound to C{address}.
@@ -266,9 +268,10 @@ class KeyManager(object):
:return: A key of type C{ktype} bound to C{address}.
:rtype: EncryptionKey
- @raise KeyNotFound: If the key was not found both locally and in
- keyserver.
+ :raise KeyNotFound: If the key was not found both locally and in
+ keyserver.
"""
+ logger.debug("getting key for %s" % (address,))
leap_assert(
ktype in self._wrapper_map,
'Unkown key type: %s.' % str(ktype))