From fa83cfbdd1d683ed371420ab8f18ee7c72e1aec7 Mon Sep 17 00:00:00 2001 From: shannon Date: Wed, 31 May 2017 10:56:56 -0500 Subject: [PATCH 1/7] support for Python 3.4 --- rest_framework_httpsignature/authentication.py | 2 ++ rest_framework_httpsignature/tests.py | 4 +++- setup.py | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/rest_framework_httpsignature/authentication.py b/rest_framework_httpsignature/authentication.py index 5e31600..0386b73 100644 --- a/rest_framework_httpsignature/authentication.py +++ b/rest_framework_httpsignature/authentication.py @@ -1,3 +1,5 @@ +from __future__ import unicode_literals + from rest_framework import authentication from rest_framework import exceptions from httpsig import HeaderSigner diff --git a/rest_framework_httpsignature/tests.py b/rest_framework_httpsignature/tests.py index e2eda6e..e3fac24 100644 --- a/rest_framework_httpsignature/tests.py +++ b/rest_framework_httpsignature/tests.py @@ -1,3 +1,5 @@ +from __future__ import unicode_literals + from django.test import SimpleTestCase, TestCase, RequestFactory from django.contrib.auth import get_user_model from rest_framework_httpsignature.authentication import SignatureAuthentication @@ -137,7 +139,7 @@ def test_build_signature(self): signature_string = self.auth.build_signature( self.KEYID, SECRET, req) signature = re.match( - '.*signature="(.+)",?.*', signature_string).group(1) + r'.*signature="(.+)",?.*', signature_string).group(1) self.assertEqual(expected_signature, signature) diff --git a/setup.py b/setup.py index 3bdd684..409cfee 100644 --- a/setup.py +++ b/setup.py @@ -25,6 +25,7 @@ 'Framework :: Django', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.4', 'License :: OSI Approved :: MIT License', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Security', From 2ebe76a88412309d36b471f0afecef1fdcd51459 Mon Sep 17 00:00:00 2001 From: shannon Date: Wed, 31 May 2017 11:58:20 -0500 Subject: [PATCH 2/7] made match non-greedy so tests are more reliable --- rest_framework_httpsignature/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework_httpsignature/tests.py b/rest_framework_httpsignature/tests.py index e3fac24..9baa529 100644 --- a/rest_framework_httpsignature/tests.py +++ b/rest_framework_httpsignature/tests.py @@ -139,7 +139,7 @@ def test_build_signature(self): signature_string = self.auth.build_signature( self.KEYID, SECRET, req) signature = re.match( - r'.*signature="(.+)",?.*', signature_string).group(1) + r'.*signature="(.*?)",?.*', signature_string).group(1) self.assertEqual(expected_signature, signature) From 43e00a8d8c937cabe4074b784e8b3f03d92804ea Mon Sep 17 00:00:00 2001 From: shannon Date: Wed, 31 May 2017 11:58:49 -0500 Subject: [PATCH 3/7] tests pass in Python 3.5 --- setup.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/setup.py b/setup.py index 409cfee..c1fe38b 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,10 @@ 'Framework :: Django', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.2', + 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', 'License :: OSI Approved :: MIT License', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Security', From c5dc72bd18caffe26374bca40336af03f260002a Mon Sep 17 00:00:00 2001 From: shannon Date: Wed, 31 May 2017 12:42:59 -0500 Subject: [PATCH 4/7] remove ROOT_URLCONF to pass tests in Django 1.11 --- test_settings.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/test_settings.py b/test_settings.py index deb178e..c0d9d7d 100644 --- a/test_settings.py +++ b/test_settings.py @@ -12,6 +12,4 @@ 'rest_framework_httpsignature', ) -ROOT_URLCONF = 'rest_framework_httpsignature.tests' - SECRET_KEY = 'MY PRIVATE SECRET' From 25684c12ed54ae786804a43a22b75e0b3fa16b2e Mon Sep 17 00:00:00 2001 From: shannon Date: Wed, 31 May 2017 12:46:51 -0500 Subject: [PATCH 5/7] Travix config to test on Python 3.2-3.5 in addition to 2.7 --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index f0b3086..2136506 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,10 @@ language: python python: - "2.7" + - "3.2" + - "3.3" + - "3.4" + - "3.5" before_install: - "pip install --upgrade pip wheel" From 054ff26c8bf1cc5a1fe6876988fc3dddb1051626 Mon Sep 17 00:00:00 2001 From: shannon Date: Wed, 31 May 2017 13:09:50 -0500 Subject: [PATCH 6/7] drop explicit support for 3.2 and 3.3 because a specific version of Django would be required --- .travis.yml | 2 -- setup.py | 2 -- 2 files changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2136506..c4c6b62 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,6 @@ language: python python: - "2.7" - - "3.2" - - "3.3" - "3.4" - "3.5" diff --git a/setup.py b/setup.py index c1fe38b..fc0f116 100644 --- a/setup.py +++ b/setup.py @@ -25,8 +25,6 @@ 'Framework :: Django', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.2', - 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'License :: OSI Approved :: MIT License', From bebf5446025883920d71d124cae644a36cfa810f Mon Sep 17 00:00:00 2001 From: shannon Date: Fri, 20 Oct 2017 14:37:49 -0500 Subject: [PATCH 7/7] add python 3.6 support and a additional classifiers --- .travis.yml | 1 + setup.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index c4c6b62..3f47794 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ python: - "2.7" - "3.4" - "3.5" + - "3.6" before_install: - "pip install --upgrade pip wheel" diff --git a/setup.py b/setup.py index fc0f116..8748b99 100644 --- a/setup.py +++ b/setup.py @@ -24,9 +24,13 @@ 'Environment :: Web Environment', 'Framework :: Django', 'Operating System :: OS Independent', + 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: Implementation :: CPython', 'License :: OSI Approved :: MIT License', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Security',