Skip to content

Commit

Permalink
Merge pull request #219 from skiwichu/upgrade-dependencies-cryptography
Browse files Browse the repository at this point in the history
Upgrade dependencies cryptography
  • Loading branch information
tpazderka authored Apr 15, 2024
2 parents 7c53b77 + b22e233 commit 1933074
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 23 deletions.
29 changes: 22 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,34 @@ Django-fido provides basic components for FIDO 2 authentication - model to store
- [License](#license)

## Dependencies ##
* Python 3.5 and higher
* Django >= 3.0
* Python 3.8 and higher
* Django >= 4.0

## Configuration ##

1. Add `django_fido` to `INSTALLED_APPS`.
``` py
# <django_project>/settings.py
INSTALLED_APPS = [
...
'django_fido',
]
```
2. Add `django_fido.backends.Fido2AuthenticationBackend` to `AUTHENTICATION_BACKENDS`.
``` py
# <django_project>/settings.py
AUTHENTICATION_BACKENDS = [
'django.contrib.auth.backends.ModelBackend',
'django_fido.backends.Fido2AuthenticationBackend',
]
```
3. Link django-fido URLs into your `urls.py`:

urlpatterns += [
url(r'', include('django_fido.urls')),
]

``` py
# <django_project>/urls.py
urlpatterns += [
path('', include('django_fido.urls')),
]
```
4. If you wish, set string variable `DJANGO_FIDO_RP_NAME`.

### Extra configuration ###
Expand Down
6 changes: 6 additions & 0 deletions django_fido/locale/cs/LC_MESSAGES/djangojs.po
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,9 @@ msgstr "Bezpečnostní token (FIDO 2) nepodporuje požadovanou akci."

msgid "Unknown FIDO 2 request."
msgstr "Neznámý FIDO 2 požadavek."

msgid "Wrong length"
msgstr "Chybná délka"

msgid "Wrong offset"
msgstr "Chybný posun"
12 changes: 9 additions & 3 deletions django_fido/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,15 @@ def test_anonymous(self):
self.assertRedirects(response, '/login/?next={}'.format(self.url), fetch_redirect_response=False)

def _get_fido2_request(self, challenge, credentials, *, resident=False):
credential_params = [{'alg': -7, 'type': 'public-key'}, {'alg': -8, 'type': 'public-key'},
{'alg': -35, 'type': 'public-key'}, {'alg': -36, 'type': 'public-key'},
{'alg': -37, 'type': 'public-key'}, {'alg': -257, 'type': 'public-key'}]
credential_params = [
{'alg': -7, 'type': 'public-key'},
{'alg': -8, 'type': 'public-key'},
{'alg': -35, 'type': 'public-key'},
{'alg': -36, 'type': 'public-key'},
{'alg': -37, 'type': 'public-key'},
{'alg': -257, 'type': 'public-key'},
{'alg': -47, 'type': 'public-key'},
]
rp_data = {
'id': HOSTNAME,
'name': HOSTNAME,
Expand Down
3 changes: 2 additions & 1 deletion django_fido/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
from django.views.generic import TemplateView
from django.views.i18n import JavaScriptCatalog

from .apps import DjangoFidoConfig
from .views import (Fido2AuthenticationRequestView, Fido2AuthenticationView, Fido2RegistrationRequestView,
Fido2RegistrationView)

app_name = 'django_fido'
app_name = DjangoFidoConfig.name
urlpatterns = [
re_path('^registration/$', Fido2RegistrationView.as_view(), name='registration'),
re_path('^registration/request/$', Fido2RegistrationRequestView.as_view(), name='registration_request'),
Expand Down
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@
CLASSIFIERS = ['Development Status :: 4 - Beta',
'License :: OSI Approved :: MIT License',
'Framework :: Django',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.0',
'Framework :: Django :: 4.1',
'Framework :: Django :: 4.2',
'Framework :: Django :: 5.0',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
Expand Down Expand Up @@ -69,7 +68,7 @@ def run(self):
url='https://github.com/CZ-NIC/django-fido',
packages=find_packages(),
include_package_data=True,
python_requires='~=3.7',
python_requires='~=3.8',
install_requires=INSTALL_REQUIRES,
extras_require=EXTRAS_REQUIRE,
keywords=['django', 'fido', 'u2f', 'fido2'],
Expand Down
16 changes: 7 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
minversion = 3.15
isolated_build = True
envlist =
py{37,38,39,310}-quality
py37-django{32}-fido{11}
py{38,39}-django{32,40,41,42}-fido{11}
py310-django{32,40,41,42}-fido{11}
py311-django{41,42}-fido{11}
py{38,39,310,311}-quality
py{38,39}-django{40,41,42}-fido{11}
py310-django{40,41,42,50}-fido{11}
py311-django{41,42,50}-fido{11}
skip_missing_interpreters = True

[testenv]
Expand All @@ -18,21 +17,20 @@ setenv =
extras = test
deps =
coverage
django32: django == 3.2.*
django40: django == 4.0.*
django41: django == 4.1.*
django42: django == 4.2.*
django50: django == 5.0.*
fido11: fido2==1.1.*
commands =
coverage run --source=django_fido --branch -m django test {posargs:django_fido}

[testenv:py{37,38,39,310}-quality]
[testenv:py{38,39,310,311}-quality]
# Do not fail on first error, but run all the checks
ignore_errors = True
allowlist_externals = msgcmp
deps =
py{37,38,39}: django==3.0.* # Lowest supported version for migrations
py310: django==3.2.* # Lowest supported version for migrations
py{38,39,310,311}: django==4.0.* # Lowest supported version for migrations
extras =
quality
types
Expand Down

0 comments on commit 1933074

Please sign in to comment.