8000 Update for httpsig 1.1 · ahknight/drf-httpsig@cd47fea · GitHub
[go: up one dir, main page]

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

Commit cd47fea

Browse files
committed
Update for httpsig 1.1
1 parent 73fda4a commit cd47fea

File tree

6 files changed

+43
-9
lines changed

6 files changed

+43
-9
lines changed

.python-version

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2.7.6
2+
3.2.5
3+
3.3.5
4+
3.4.2

CHANGELOG.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
drf-httpsig Changes
22
===================
33

4+
v1.1.0 (2015-Feb-11)
5+
--------------------
6+
7+
* Updated to support and require httpsig 1.1.
8+
* Updated requirements to simply Django<1.7 and DRF<3.0. Last version for those, I suspect.
9+
10+
v1.0.2 (2014-Jul-24)
11+
--------------------
12+
13+
* Updated authentication return value to set request.auth to the key_id used.
14+
415
v1.0.1 (2014-Jul-03)
516
--------------------
617

drf_httpsig/tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def test_invalid_signature(self):
9696
Same test as `valid` but with the headers in a different order.
9797
"""
9898
headers = ['(request-target)', 'accept', 'host', 'date']
99-
expected_signature = 'kIPZjqxzSlODPqdhbZqnjNK9b9pUkyKhe1boKZZ4gbk='
99+
expected_signature = 'SelruOP39OWoJrSopfYJ99zOLoswmpyGXyDPdebeELc='
100100

101101
expected_signature_string = build_signature(
102102
headers,
@@ -117,7 +117,7 @@ def test_valid_signature(self):
117117
A perfectly valid signature.
118118
"""
119119
headers = ['(request-target)', 'accept', 'date', 'host']
120-
expected_signature = 'kIPZjqxzSlODPqdhbZqnjNK9b9pUkyKhe1boKZZ4gbk='
120+
expected_signature = 'SelruOP39OWoJrSopfYJ99zOLoswmpyGXyDPdebeELc='
121121
expected_signature_string = build_signature(
122122
headers,
123123
key_id=KEYID,

generate_test_data.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env python3
2+
3+
from httpsig import HeaderSigner
4+
5+
ENDPOINT = '/api'
6+
METHOD = 'GET'
7+
KEYID = 'some-key'
8+
SECRET = 'my secret string'
9+
SIGNATURE = 'some.signature'
10+
11+
headers = ['(request-target)', 'accept', 'date', 'host']
12+
hs = HeaderSigner(KEYID, SECRET, "hmac-sha256", headers)
13+
14+
unsigned = {
15+
'Host': 'localhost:8000',
16+
'Date': 'Mon, 17 Feb 2014 06:11:05 GMT',
17+
'Accept': 'application/json',
18+
}
19+
signed = hs.sign(unsigned, method="GET", path='/packages/measures/')
20+
print(signed)

requirements.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# Known to work with these versions. Versions bracketed for safety.
2-
django>=1.6,<1.7
3-
djangorestframework>=2.3,<2.4
4-
httpsig>=1.1,<1.2
1+
django<1.7
2+
djangorestframework<3.0
3+
httpsig>=1.1

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ def run_tests(self):
6565
packages=find_packages(),
6666
zip_safe=True,
6767
install_requires=[
68-
'django>=1.6,<1.7',
69-
'djangorestframework>=2.3,<2.4',
70-
'httpsig>=1.1,<1.2'
68+
'django<1.7',
69+
'djangorestframework<3.0',
70+
'httpsig>=1.1'
7171
],
7272
tests_require=['tox'],
7373
)

0 commit comments

Comments
 (0)
0