CZ-NIC / django-fido

Django application for FIDO protocol U2F
GNU General Public License v3.0
28 stars 11 forks source link

Support fido2==1.0.0 #165

Closed tpazderka closed 1 year ago

Frikster commented 2 years ago

This just broke our build. Explicitly setting fido2==0.9.3 in requirements.txt resolved the issue. The error message we would get is:

backend     | Traceback (most recent call last):
backend     |   File "/backend/manage.py", line 15, in <module>
backend     |     execute_from_command_line(sys.argv)
backend     |   File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
backend     |     utility.execute()
backend     |   File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 377, in execute
backend     |     django.setup()
backend     |   File "/usr/local/lib/python3.9/site-packages/django/__init__.py", line 24, in setup
backend     |     apps.populate(settings.INSTALLED_APPS)
backend     |   File "/usr/local/lib/python3.9/site-packages/django/apps/registry.py", line 114, in populate
backend     |     app_config.import_models()
backend     |   File "/usr/local/lib/python3.9/site-packages/django/apps/config.py", line 211, in import_models
backend     |     self.models_module = import_module(models_module_name)
backend     |   File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
backend     |     return _bootstrap._gcd_import(name[level:], package, level)
backend     |   File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
backend     |   File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
backend     |   File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
backend     |   File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
backend     |   File "<frozen importlib._bootstrap_external>", line 850, in exec_module
backend     |   File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
backend     |   File "/usr/local/lib/python3.9/site-packages/django_fido/models.py", line 21, in <module>
backend     |     from fido2.ctap2 import AttestationObject, AttestedCredentialData
backend     | ImportError: cannot import name 'AttestationObject' from 'fido2.ctap2' (/usr/local/lib/python3.9/site-packages/fido2/ctap2/__init__.py)

I'd strongly recommend explicitly setting django-fido to only depend on fido2 versions it is known to work with, rather than with the most recent version (which I assume caused this break?).

tpazderka commented 2 years ago

I'd strongly recommend explicitly setting django-fido to only depend on fido2 versions it is known to work with, rather than with the most recent version (which I assume caused this break?).

Already fixed on master.

stinovlas commented 2 years ago

Already fixed on master.

And also in django-fido==0.40. We restricted the dependency to fido2 ~= 0.9 as a quick fix. This issue is about adding support for the new backwards-incompatible version of fido2 library and it hasn't been implemented yet.

tpazderka commented 1 year ago

Closed via #175