Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is needed to upgrade to webauthn 2.0.0+? #701

Closed
sergei-maertens opened this issue Jan 30, 2024 · 1 comment · Fixed by #702
Closed

What is needed to upgrade to webauthn 2.0.0+? #701

sergei-maertens opened this issue Jan 30, 2024 · 1 comment · Fixed by #702

Comments

@sergei-maertens
Copy link
Contributor

While investigating some conflicts in tooling in their Pydantic versions used, I noticed that webauthn 2.0.0 was released a couple weeks ago which dropped their dependency on Pydantic (which would solve my tooling issue). However, django-two-factor-auth pins webauthn on <1.99.

Does anyone have an idea what's needed to support webauthn 2.0.0 and could they provide some guidance? I can probably allocate some $dayjob time as it would make our setup/needs simpler to achieve.

Expected Behavior

Use django-two-factor-auth with webauthn 2.0.0

Current Behavior

Only v1 of webauthn is supported.

Possible Solution

See if/how the breaking changes affect the usage in django-two-factor-auth and if necessary:

  • add a compatibility layer or
  • require webauthn v2.0.0+

The latter option should be safe for project that use Pydantic themselves, they will now only need to explicitly declare their dependency.

Steps to Reproduce (for bugs)

n/a

Context

I'm trying to use the bump-my-version tool and django-two-factor-auth[webauthn] in the same virtualenv, but they have incompatible pydantic requirements.

As a workaround, I can install/run bump-my-version from a different venv.

Your Environment

  • Browser and version: Brave Version 1.62.153 Chromium: 121.0.6167.85 (Official Build) (64-bit)
  • Python version: 3.10, 3.11, 3.12
  • Django version: 4.2
  • django-otp version: 1.3.0
  • django-two-factor-auth version: 1.15.5
  • Link to your project: https://github.com/maykinmedia/maykin-2fa
@claudep
Copy link
Contributor

claudep commented Jan 31, 2024

Hi Sergei, it would be nice if you could explore that and run tests with webauthn 2. I'm sure @jpaniagualaconich can help if you encounter serious issues.

sergei-maertens added a commit that referenced this issue Feb 3, 2024
WebAuthn 2.0 refactored pydantic usage out of the codebase.

For simplicity's sake, the minimum version is now set to 2.0
so that no compat layer is required.

It appears that wat used to be Pydantic validation errors are
now raised as InvalidJSONStructure exceptions, the form validation
code is updated to reflect that.
sergei-maertens added a commit that referenced this issue Feb 3, 2024
This has changed in webauthn 2.0+ compared to 1.x
sergei-maertens added a commit that referenced this issue Feb 3, 2024
WebAuthn 2.0 refactored pydantic usage out of the codebase.

For simplicity's sake, the minimum version is now set to 2.0
so that no compat layer is required.

It appears that wat used to be Pydantic validation errors are
now raised as InvalidJSONStructure exceptions, the form validation
code is updated to reflect that.
sergei-maertens added a commit that referenced this issue Feb 3, 2024
This has changed in webauthn 2.0+ compared to 1.x
claudep pushed a commit that referenced this issue Feb 3, 2024
WebAuthn 2.0 refactored pydantic usage out of the codebase.

For simplicity's sake, the minimum version is now set to 2.0
so that no compat layer is required.

It appears that wat used to be Pydantic validation errors are
now raised as InvalidJSONStructure exceptions, the form validation
code is updated to reflect that.
claudep pushed a commit that referenced this issue Feb 3, 2024
This has changed in webauthn 2.0+ compared to 1.x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants