parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

feat: new auth adapter (continuation)

Open dblythy opened this issue 2 years ago • 5 comments

New Pull Request Checklist

  • [x] I am not disclosing a vulnerability.
  • [x] I am creating this PR in reference to an issue.

Issue Description

Continues on from #7079.

Related issue: #7079

Approach

  • Adds ability to throw errors from
  • cleans up code
  • removes parameter options as it can be accessed on the adapter via this

TODOs before merging

  • [x] Add tests
  • [x] A changelog entry is created automatically using the pull request title (do not manually add a changelog entry)

dblythy avatar Sep 08 '22 05:09 dblythy

Thanks for opening this pull request!

  • 🎉 We are excited about your hands-on contribution!

Codecov Report

Base: 94.13% // Head: 84.68% // Decreases project coverage by -9.45% :warning:

Coverage data is based on head (838cf17) compared to base (ed3248f). Patch coverage: 98.57% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##            alpha    #8156      +/-   ##
==========================================
- Coverage   94.13%   84.68%   -9.46%     
==========================================
  Files         182      182              
  Lines       13785    13973     +188     
==========================================
- Hits        12977    11833    -1144     
- Misses        808     2140    +1332     
Impacted Files Coverage Δ
...dapters/Storage/Postgres/PostgresStorageAdapter.js 2.47% <0.00%> (-93.24%) :arrow_down:
src/Deprecator/Deprecations.js 100.00% <ø> (ø)
src/GraphQL/loaders/parseClassTypes.js 94.87% <ø> (ø)
src/Options/Definitions.js 100.00% <ø> (ø)
src/Options/index.js 100.00% <ø> (ø)
src/cloud-code/Parse.Cloud.js 99.20% <ø> (ø)
src/Routers/UsersRouter.js 95.02% <98.43%> (+0.63%) :arrow_up:
src/Adapters/Auth/index.js 98.79% <100.00%> (+5.24%) :arrow_up:
src/Auth.js 99.56% <100.00%> (+0.26%) :arrow_up:
src/Config.js 89.05% <100.00%> (+0.12%) :arrow_up:
... and 22 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Sep 08 '22 05:09 codecov[bot]

@Moumouls Do you want to review this PR before merging?

mtrezza avatar Sep 12 '22 09:09 mtrezza

Yes @mtrezza , I'll check the diff between this one and my original PR

Moumouls avatar Sep 12 '22 10:09 Moumouls

Quite busy currently @mtrezza, @dblythy but i don't forget this one 👍 I will also build a custom version and test it on my company repo to check that everything works with advanced usage

Moumouls avatar Sep 21 '22 07:09 Moumouls

@Moumouls Did you get to try this out?

mtrezza avatar Oct 12 '22 01:10 mtrezza

A gentle reminder to @Moumouls and @rhuanbarreto that this PR is ready for review. I remember you both have been very outspoken in https://github.com/parse-community/parse-server/pull/7079 about the urgency of getting this feature merged. It's now waiting for >1 month for feedback on the new changes, so if you could take a look and post some feedback that would be great, so we can finally get this merged. Thanks.

mtrezza avatar Oct 14 '22 19:10 mtrezza

So @mtrezza if the options and the functional approach are restored we should be okay (plus the new test). I did not find other issues running this branch on my company project. We are close. Thanks, @dblythy for the continuation.

Moumouls avatar Oct 16 '22 16:10 Moumouls

Let's try to merge this PR by end of next week. There are some other changes that are blocked by this PR, so it would be great if we could accomplish that.

mtrezza avatar Oct 20 '22 23:10 mtrezza

@dblythy @mtrezza I'll take a look into this today, we are so close :rocket:

Thanks @dblythy for you contributions !

Moumouls avatar Nov 01 '22 11:11 Moumouls

I will reformat the title to use the proper commit message syntax.

Do / should we have any docs that come with this PR?

To confirm again, this PR doesn't include any breaking changes? If it does, that's also fine since we can release it with Parse Server 6, but we would need to document them.

mtrezza avatar Nov 02 '22 01:11 mtrezza

@mtrezza I forgot your comment

To confirm again, this PR doesn't include any breaking changes?

No breaking changes here, Parse is still fully compatible with current and older auth systems. Basically it's just a new auth interface for backend adapters.

BTW, we can consider to release it into Parse V6 as a new major feature, since with this system it will be really easy to develop Webauthn, OTP, TOTP, MFA, and any advanced auth mechanism !

Moumouls avatar Nov 03 '22 12:11 Moumouls

It's quite a significant change so I would also say to release it with PS6, not as a feature in PS5. In case there are any issues, people can stay on PS5 and we can still maintain the LTS branch separately.

In that sense we got this ready for merge just in time 😉

mtrezza avatar Nov 03 '22 16:11 mtrezza

@mtrezza i can suggest "feat: enhanced auth adapter interface"

Btw, let's merge this one !

Moumouls avatar Nov 04 '22 10:11 Moumouls

Could we find a more descriptive changelog entry? A title that gives a better idea about the new capabilities, so developers can better understand what benefit this change has, and they start exploring the feature, for example MFA. 4 words seems a pretty modest description for a feature that required so much work 😉

How about:

feat: Improve authentication adapter interface to support multi-factor authentication (MFA), authentication challenges, and provide a more powerful interface for writing custom authentication adapters.

mtrezza avatar Nov 04 '22 13:11 mtrezza

you description is nice @mtrezza let's go for it 🚀

Moumouls avatar Nov 04 '22 16:11 Moumouls

Great, we have a few other PRs to merge before this; I estimate we'll merge this on Monday.

mtrezza avatar Nov 04 '22 17:11 mtrezza

🎉 This change has been released in version 6.0.0-alpha.2

parseplatformorg avatar Nov 10 '22 16:11 parseplatformorg

It's merged! Thanks @Moumouls for starting this and @dblythy for finishing this, and everyone else between.

mtrezza avatar Nov 10 '22 16:11 mtrezza

Awesome work @Moumouls - keen to see the cool new auth adapters that are made thanks to your work! Would be good to try ship some of these new ones as part of Parse Server 6

dblythy avatar Nov 10 '22 23:11 dblythy

🎉 This change has been released in version 6.0.0-beta.1

parseplatformorg avatar Jan 31 '23 03:01 parseplatformorg

🎉 This change has been released in version 6.0.0

parseplatformorg avatar Jan 31 '23 03:01 parseplatformorg