diff options
author | Tomas Touceda <chiiph@leap.se> | 2013-04-23 17:02:55 -0300 |
---|---|---|
committer | Tomas Touceda <chiiph@leap.se> | 2013-04-23 17:02:55 -0300 |
commit | 046ef8b23c04333007276b560670f69d9011fb40 (patch) | |
tree | a2d89bc7d5883c5591d75c2c20206772d2cbe17e /src/leap/mx/couchdbhelper.py | |
parent | b216d5679680e1d7ed9c2cff7d15f43edff5c102 (diff) |
Add pubkey retrieving
Diffstat (limited to 'src/leap/mx/couchdbhelper.py')
-rw-r--r-- | src/leap/mx/couchdbhelper.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/leap/mx/couchdbhelper.py b/src/leap/mx/couchdbhelper.py index cbb087d..4e76be3 100644 --- a/src/leap/mx/couchdbhelper.py +++ b/src/leap/mx/couchdbhelper.py @@ -114,7 +114,8 @@ class ConnectedCouchDB(client.CouchDB): d = self.openView(docId="User", viewId="by_login_or_alias/", key=alias, - reduce=False) + reduce=False, + include_docs=True) d.addCallbacks(partial(self._get_uuid, alias), log.err) @@ -135,7 +136,7 @@ class ConnectedCouchDB(client.CouchDB): for row in result["rows"]: if row["key"] == alias: uuid = row["id"] - self._cache[uuid] = row["value"] + self._cache[uuid] = row["doc"]["public_key"] return uuid return None @@ -161,6 +162,7 @@ if __name__ == "__main__": @d.addCallback def right(result): print "Should be an actual uuid:", result + print "Public Key:" print cdb.getPubKey(result) d2 = cdb.queryByLoginOrAlias("asdjaoisdjoiqwjeoi") |