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

fix(core): update WebAuthn authenticator schemas and types #10861

Merged
merged 16 commits into from May 10, 2024

Conversation

ndom91
Copy link
Member

@ndom91 ndom91 commented May 9, 2024

☕️ Reasoning

  • Loosen up authenticator.transports type to also accept null
    • Removes the need for each adapter to have an extra method to just coerce transports to undefined if they're missing
    • This then led to the following cleanup in the pre-existing webauthn implementations in unstorage and prisma adapters
  • Fix prisma adapter
    • Cleanup authenticator method implementations
    • Remove unnecessary transports coercion methods
    • Cleanup recommended db schemas in docs
  • Fix unstorage adapter
    • listAuthenticatorsByUserId wasn't fully implemented, this is fixed here
    • All other authenticator-realted methods are cleaned up as well
    • Cleanup authenticator method implementations
    • Clean up multiple types
    • Enable almost all tests again

🧢 Checklist

  • Documentation
  • Tests
  • Ready to be merged

🎫 Affected issues

📌 Resources

@ndom91 ndom91 requested a review from ubbe-xyz as a code owner May 9, 2024 10:07
Copy link

vercel bot commented May 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
auth-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 10, 2024 1:52pm
2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
next-auth-docs ⬜️ Ignored (Inspect) Visit Preview May 10, 2024 1:52pm
proxy ⬜️ Ignored (Inspect) Visit Preview May 10, 2024 1:52pm

@github-actions github-actions bot added the core Refers to `@auth/core` label May 9, 2024
@ndom91 ndom91 mentioned this pull request May 9, 2024
3 tasks
@ndom91 ndom91 marked this pull request as draft May 9, 2024 10:07
@github-actions github-actions bot added adapters Changes related to the core code concerning database adapters prisma @auth/prisma-adapter labels May 9, 2024
@ndom91 ndom91 marked this pull request as ready for review May 9, 2024 10:29
@ndom91 ndom91 requested a review from ThangHuuVu as a code owner May 9, 2024 10:29
Copy link

codecov bot commented May 9, 2024

Codecov Report

Attention: Patch coverage is 97.43590% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 37.51%. Comparing base (4bec046) to head (94285ab).

Files Patch % Lines
packages/core/src/types.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10861      +/-   ##
==========================================
+ Coverage   37.48%   37.51%   +0.02%     
==========================================
  Files         173      173              
  Lines       27026    26983      -43     
  Branches     1174     1176       +2     
==========================================
- Hits        10131    10122       -9     
+ Misses      16895    16861      -34     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

packages/adapter-prisma/src/index.ts Outdated Show resolved Hide resolved
packages/adapter-prisma/src/index.ts Outdated Show resolved Hide resolved
Co-authored-by: Julius Marminge <julius0216@outlook.com>
@ndom91 ndom91 changed the title fix(core): loosen authenticator type fix(core): update Authenticator schema and types May 9, 2024
Copy link

socket-security bot commented May 9, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher

View full report↗︎

Copy link

socket-security bot commented May 9, 2024

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report↗︎

@ndom91 ndom91 changed the title fix(core): update Authenticator schema and types fix(core): update WebAuthn authenticator schemas and types May 10, 2024
@ndom91 ndom91 merged commit 5e55331 into main May 10, 2024
12 of 15 checks passed
@ndom91 ndom91 deleted the ndom91/loosen-up-authenticator-types branch May 10, 2024 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adapters Changes related to the core code concerning database adapters core Refers to `@auth/core` prisma @auth/prisma-adapter unstorage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants