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

Commit 7cf459c

Browse files
committed
Prep for release
1 parent b27cd2c commit 7cf459c

File tree

5 files changed

+29
-19
lines changed

5 files changed

+29
-19
lines changed

MANIFEST

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# file GENERATED by distutils, do NOT edit
2+
CHANGES.rst
3+
README.rst
4+
setup.cfg
5+
setup.py
6+
versioneer.py
7+
httpsig/__init__.py
8+
httpsig/_version.py
9+
httpsig/requests_auth.py
10+
httpsig/sign.py
11+
httpsig/utils.py
12+
httpsig/verify.py
13+
tests/__init__.py
14+
tests/test_signature.py
15+
tests/test_utils.py
16+
tests/test_verify.py

README.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ Usage
2727

2828
for simple raw signing::
2929

30-
import http_signature
30+
import httpsig
3131
32-
sig_maker = http_signature.Signer(secret='test.pem', algorithm='rsa-sha256')
32+
sig_maker = httpsig.Signer(secret='test.pem', algorithm='rsa-sha256')
3333
sig_maker.sign('hello world!')
3434

3535
for use with requests::
3636

3737
import json
3838
import requests
39-
from http_signature.requests_auth import HTTPSignatureAuth
39+
from httpsig.requests_auth import HTTPSignatureAuth
4040
4141
auth = HTTPSignatureAuth(key_id='Test', secret='test.pem')
4242
z = requests.get('https://api.joyentcloud.com/my/packages/Small+1GB',
@@ -47,7 +47,7 @@ Class initialization parameters
4747

4848
::
4949

50-
http_signature.Signer(secret='', algorithm='rsa-sha256', allow_agent=False)
50+
httpsig.Signer(secret='', algorithm='rsa-sha256', allow_agent=False)
5151

5252
``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.
5353
``algorithm`` is one of the six allowed signatures: ``rsa-sha1``, ``rsa-sha256``, ``rsa-sha512``, ``hmac-sha1``, ``hmac-sha256``,
@@ -56,7 +56,7 @@ Class initialization parameters
5656

5757
::
5858

59-
http_signature.requests_auth.HTTPSignatureAuth(key_id='', secret='', algorithm='rsa-sha256', headers=None, allow_agent=False)
59+
httpsig.requests_auth.HTTPSignatureAuth(key_id='', secret='', algorithm='rsa-sha256', headers=None, allow_agent=False)
6060

6161
``key_id`` is the label by which the server system knows your RSA signature or password.
6262
``headers`` is the list of HTTP headers that are concatenated and used as signing objects. By default it is the specification's minimum, the ``Date`` HTTP header.

httpsig/sign.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -154,22 +154,14 @@ def sign(self, headers, host=None, method=None, path=None):
154154
path is the HTTP path (used for '(request-line)').
155155
"""
156156
headers = CaseInsensitiveDict(headers)
157-
158-
# AK: Possible problem here if the client and server's dates are off
159-
# by even one second, this will fail miserably. This is also not
160-
# in the spec. Should probably be removed.
161-
# if 'date' not in headers:
162-
# now = datetime.now()
163-
# stamp = mktime(now.timetuple())
164-
# headers['date'] = format_date_time(stamp)
165-
157+
166158
required_headers = self.headers or ['date']
167159
signable_list = []
168160
for h in required_headers:
169161
if h == '(request-line)':
170162
if not method or not path:
171163
raise Exception('method and path arguments required when using "(request-line)"')
172-
signable_list.append('%s %s' % (method.lower(), path))
164+
signable_list.append('%s: %s %s' % (h, method.lower(), path))
173165

174166
elif h == 'host':
175167
# 'host' special case due to requests lib restrictions

setup.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[bdist_wheel]
2+
universal = True

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
from setuptools import setup, find_packages
22
import versioneer
3-
versioneer.versionfile_source = 'http_signature/_version.py'
4-
versioneer.versionfile_build = 'http_signature/_version.py'
3+
versioneer.versionfile_source = 'httpsig/_version.py'
4+
versioneer.versionfile_build = 'httpsig/_version.py'
55
versioneer.tag_prefix = 'v' # tags are like 1.2.0
6-
versioneer.parentdir_prefix = 'http_signature-' # dirname like 'myproject-1.2.0'
6+
versioneer.parentdir_prefix = 'httpsig-' # dirname like 'myproject-1.2.0'
77

88
with open('README.rst') as file:
99
long_description = file.read()
1010
with open('CHANGES.rst') as file:
1111
long_description += '\n\n' + file.read()
1212

1313
setup(
14-
name='http_signature',
14+
name='httpsig',
1515
version=versioneer.get_version(),
1616
cmdclass=versioneer.get_cmdclass(),
1717
description="Simple secure signing for HTTP requests using http-signature",

0 commit comments

Comments
 (0)