Skip to content

Commit

Permalink
change allow_agent to False everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
atl committed Oct 2, 2012
1 parent 9150089 commit 37472c0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGES.rst
@@ -1,9 +1,10 @@
Changes
-------

0.1.3 (2012-05-03)
0.1.3 (2012-10-02)
~~~~~~~~~~~~~~~~~~

* Stop enabling `allow_agent` by default
* Changed logic around ssh-agent: if one key is available, don't bother with any other method
* Changed logic around key file usage: if decryption fails, prompt for password
* Introduce versioneer.py
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -38,7 +38,7 @@ Class initialization parameters

::

http_signature.Signer(secret='', algorithm='rsa-sha256', allow_agent=True)
http_signature.Signer(secret='', algorithm='rsa-sha256', allow_agent=False)

``secret``, in the case of an rsa signature, is a path to a private RSA pem file. In the case of an hmac, it is a secret password.
``algorithm`` is one of the six allowed signatures: ``rsa-sha1``, ``rsa-sha256``, ``rsa-sha512``, ``hmac-sha1``, ``hmac-sha256``,
Expand Down
2 changes: 1 addition & 1 deletion http_signature/requests_auth.py
Expand Up @@ -17,7 +17,7 @@ class HTTPSignatureAuth(AuthBase):
algorithm is one of the six specified algorithms
headers is a list of http headers to be included in the signing string, defaulting to "Date" alone.
'''
def __init__(self, key_id='', secret='', algorithm='rsa-sha256', headers=None, allow_agent=True):
def __init__(self, key_id='', secret='', algorithm='rsa-sha256', headers=None, allow_agent=False):
self.signer = Signer(secret=secret, algorithm=algorithm, allow_agent=allow_agent)
self.key_id = key_id
self.headers = headers
Expand Down
5 changes: 3 additions & 2 deletions http_signature/sign.py
Expand Up @@ -19,10 +19,11 @@
'sha512': SHA512}

class Signer(object):
def __init__(self, secret='~/.ssh/id_rsa', algorithm='rsa-sha256', allow_agent=True):
def __init__(self, secret='~/.ssh/id_rsa', algorithm='rsa-sha256', allow_agent=False):
assert algorithm in ALGORITHMS, "Unknown algorithm"
self._agent_key = False
self._rsa = False
self._hash = None
self.sign_algorithm, self.hash_algorithm = algorithm.split('-')
if allow_agent:
keys = ssh.Agent().get_keys()
Expand Down Expand Up @@ -93,7 +94,7 @@ class HeaderSigner(object):
headers is a list of http headers to be included in the signing string, defaulting to "Date" alone.
'''
def __init__(self, key_id='~/.ssh/id_rsa', secret='', algorithm='rsa-sha256',
headers=None, allow_agent=True):
headers=None, allow_agent=False):
self.signer = Signer(secret=secret, algorithm=algorithm, allow_agent=allow_agent)
self.key_id = key_id
self.headers = headers
Expand Down

0 comments on commit 37472c0

Please sign in to comment.