Skip to content

Commit

Permalink
Merge pull request #5 from romankh/2-print-getLogin
Browse files Browse the repository at this point in the history
#2: Adds conditional printing in method getLogins
  • Loading branch information
jobevers authored Feb 13, 2018
2 parents 85bdd2c + 39712a8 commit 319501a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions keepasshttp/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def testAssociate(id_, key, requestor=None):
return requestor(key, input_data, id_)


def getLogins(url, id_, key, requestor=None):
def getLogins(url, id_, key, requestor=None, print_output=False):
"""Query keepass for entries that match `url`"""
requestor = requestor or DEFAULT_REQUESTOR
iv = crypto.getRandomIV()
Expand All @@ -50,7 +50,8 @@ def getLogins(url, id_, key, requestor=None):
'Url': crypto.encrypt(url, key, iv)
}
output = requestor(key, input_data, id_, iv=iv)
print output
if print_output:
print output
decrypted = [
crypto.decryptDict(entry, key, output['Nonce'])
for entry in output.get('Entries', [])
Expand Down

0 comments on commit 319501a

Please sign in to comment.