Skip to content
This repository was archived by the owner on Apr 13, 2024. It is now read-only.

Commit 60dbb7b

Browse files
committed
Fixed #2 and made Signer.sign public.
Really shouldn’t have been otherwise in the first place, honestly.
1 parent 343cab5 commit 60dbb7b

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

httpsig/sign.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def _sign_hmac(self, data):
6060
hmac.update(data)
6161
return hmac.digest()
6262

63-
def _sign(self, data):
63+
def sign(self, data):
6464
if isinstance(data, six.string_types):
6565
data = data.encode("ascii")
6666
signed = None
@@ -111,7 +111,7 @@ def sign(self, headers, host=None, method=None, path=None):
111111
signable = generate_message(
112112
required_headers, headers, host, method, path)
113113

114-
signature = self._sign(signable)
114+
signature = super(HeaderSigner, self).sign(signable)
115115
headers['authorization'] = self.signature_template % signature
116116

117117
return headers

httpsig/tests/test_verify.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def test_basic_sign(self):
5252
BAD = b"this is not the signature you were looking for..."
5353

5454
# generate signed string
55-
signature = signer._sign(GOOD)
55+
signature = signer.sign(GOOD)
5656
self.assertTrue(verifier._verify(data=GOOD, signature=signature))
5757
self.assertFalse(verifier._verify(data=BAD, signature=signature))
5858

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
setup(
1111
name='httpsig',
12-
# version=versioneer.get_version(),
1312
description="Secure HTTP request signing using the HTTP Signature draft specification",
1413
long_description=long_description,
1514
classifiers=[

0 commit comments

Comments
 (0)