Skip to content

Commit

Permalink
Add Support to Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
mkalioby committed Nov 9, 2023
1 parent 0e73f77 commit ed5db2d
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## v1.3.0
* Add Support for Python 3.12 and Django 5.0

## v1.2.7

* Fix: issue if the user isn't defined by username field #25.
Expand Down
2 changes: 1 addition & 1 deletion example/test_app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,6 @@

AUTHENTICATION_BACKENDS = ['passkeys.backend.PasskeyModelBackend']

FIDO_SERVER_ID="localhost" # Server rp id for FIDO2, it the full domain of your project
FIDO_SERVER_ID="mk.cgm" # Server rp id for FIDO2, it the full domain of your project
FIDO_SERVER_NAME="TestApp"
KEY_ATTACHMENT = passkeys.Attachment.PLATFORM # Set None to allow all authenticator attachment
2 changes: 2 additions & 0 deletions example/test_app/tests/test_current_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

class TestCurrentPlatform(TestCase):
def setUp(self) -> None:
if not getattr(self, "assertEquals", None):
self.assertEquals = self.assertEqual
self.request_factory = RequestFactory()

def check_platform(self,user_agent, platform):
Expand Down
4 changes: 3 additions & 1 deletion example/test_app/tests/test_fido.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ def setUp(self) -> None:
store.save(must_create=True)
self.session = store
self.client.cookies["sessionid"] = store.session_key

if not getattr(self,"assertEquals",None):
self.assertEquals = self.assertEqual
self.client.post("/auth/login", {"username": "test", "password": "test", 'passkeys': ''})
self.factory = RequestFactory()


def test_key_reg(self):

self.client.post('auth/login',{"usernaame":"test","password":"test","passkeys":""})
r = self.client.get(reverse('passkeys:reg_begin'))
self.assertEquals(r.status_code, 200)
Expand Down
2 changes: 2 additions & 0 deletions example/test_app/tests/test_passkeys.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ def setUp(self) -> None:
self.user_model = get_user_model()
self.user = self.user_model.objects.create_user(username="test",password="test")
self.client = Client()
if not getattr(self, "assertEquals", None):
self.assertEquals = self.assertEqual
self.factory = RequestFactory()

def test_raiseException(self):
Expand Down
2 changes: 2 additions & 0 deletions example/test_app/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ def setUp(self) -> None:
test = test_fido()
test.setUp()
self.authenticator = test.test_key_reg()
if not getattr(self, "assertEquals", None):
self.assertEquals = self.assertEqual
self.client.post("/auth/login", {"username": "test", "password": "test", 'passkeys': ''})
self.user = self.user_model.objects.get(username="test")

Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name='django-passkeys',
version='1.2.7',
version='1.3.0',
description='A Django Authentication Backend for Passkeys',
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
Expand Down Expand Up @@ -47,6 +47,7 @@
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Python Modules",
]
)
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
[tox]
envlist=
docs,
# docs,
py37-django{20,21,22,32},
py38-django{22,32,40,41,42},
py39-django{22,32,40,41,42},
py310-django{22,32,40,41,42},
py311-django{22,32,40,41,42,50},
py312-django{50},


[testenv]
Expand All @@ -21,6 +22,7 @@ deps =
ua-parser
user-agents
django-sslserver
build
-rrequirements_test.txt

setenv =
Expand Down

0 comments on commit ed5db2d

Please sign in to comment.