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): centralize isDate util fn and use in all adapters #10872

Merged
merged 15 commits into from May 14, 2024

Conversation

ndom91
Copy link
Member

@ndom91 ndom91 commented May 10, 2024

☕️ Reasoning

  • Each adapter had (the same) isDate function and isoDate regexp
  • Centralized in @auth/core/adapters and imported in each adapter
    • This creates the first non-type export from core/adapters, therefore it needed a new entry in the export map. Cool with yall?

🧢 Checklist

  • Documentation
  • Tests
  • Ready to be merged

🎫 Affected issues

📌 Resources

Copy link

vercel bot commented May 10, 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 14, 2024 9:55am
2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
next-auth-docs ⬜️ Ignored (Inspect) Visit Preview May 14, 2024 9:55am
proxy ⬜️ Ignored (Inspect) Visit Preview May 14, 2024 9:55am

@github-actions github-actions bot added adapters Changes related to the core code concerning database adapters core Refers to `@auth/core` dynamodb @auth/dynamodb-adapter dgraph @auth/dgraph-adapter neo4j @auth/neo4j-adapter upstash-redis @auth/upstash-redis-adapter kysely hasura unstorage labels May 10, 2024
Copy link

socket-security bot commented May 10, 2024

Copy link

codecov bot commented May 10, 2024

Codecov Report

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

Project coverage is 38.35%. Comparing base (30cb59a) to head (b9f2f22).

Files Patch % Lines
packages/core/src/adapters.ts 0.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10872      +/-   ##
==========================================
- Coverage   38.47%   38.35%   -0.12%     
==========================================
  Files         175      175              
  Lines       27476    27437      -39     
  Branches     1218     1206      -12     
==========================================
- Hits        10571    10524      -47     
- Misses      16905    16913       +8     

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

@ndom91 ndom91 requested review from ThangHuuVu and removed request for ThangHuuVu May 10, 2024 12:02
@ndom91 ndom91 changed the title fix(core): centralize isDate fn and use in all adapters fix(core): centralize isDate util fn and use in all adapters May 14, 2024
@ndom91 ndom91 requested a review from ubbe-xyz as a code owner May 14, 2024 09:52
@github-actions github-actions bot added supabase @auth/supabase-adapter d1 labels May 14, 2024
Copy link

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSource
Install scripts npm/svelte-preprocess@5.1.4
  • Install script: postinstall
  • Source: echo "[svelte-preprocess] Don't forget to install the preprocessors packages that will be used: sass, stylus, less, postcss & postcss-load-config, coffeescript, pug, etc..."
Install scripts npm/@sveltejs/kit@2.5.7
  • Install script: postinstall
  • Source: node postinstall.js
  • orphan: npm/@sveltejs/kit@2.5.7

View full report↗︎

Next steps

What is an install script?

Install scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.

Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/foo@1.0.0 or ignore all packages with @SocketSecurity ignore-all

  • @SocketSecurity ignore npm/svelte-preprocess@5.1.4
  • @SocketSecurity ignore npm/@sveltejs/kit@2.5.7

@ndom91 ndom91 merged commit e2eacc2 into main May 14, 2024
13 of 15 checks passed
@ndom91 ndom91 deleted the ndom91/centralize-adapter-date-methods branch May 14, 2024 09:57
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` d1 dgraph @auth/dgraph-adapter dynamodb @auth/dynamodb-adapter hasura kysely neo4j @auth/neo4j-adapter supabase @auth/supabase-adapter unstorage upstash-redis @auth/upstash-redis-adapter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant