Closed xystrive closed 2 months ago
New changes made according to what was pointed out by @kozabrada123.
Also taking into account this discussion https://github.com/polyphony-chat/chorus/pull/521#discussion_r1666921209, before going forward with a merge I would want to include the API endpoint for verifying MFA for login requests.
One more question before merging, @xystrive: Would it be possible for you to add integration tests for this, at this time? If you need help/guidance with doing that, I'd be happy to assist. A "no" is fine too, by the way! The crate isn't stable yet anyhow, and tests can be added a little later.
One more question before merging, @xystrive: Would it be possible for you to add integration tests for this, at this time? If you need help/guidance with doing that, I'd be happy to assist. A "no" is fine too, by the way! The crate isn't stable yet anyhow, and tests can be added a little later.
@bitfl0wer Yes for sure!
@bitfl0wer I have added the tests you have asked me, however they are just a skeleton implementation and won't succeed since I haven't found a proper way to test against an endpoint that requires MFA.
Thank you so much for being so cooperative and for opening this PR! It's extremely appreciated :3
Edit: I have merged into a branch called mfa
for now, since as you said, the tests you added currently fail. I will mock the missing MFA endpoint using the httptest
crate, then merge into dev
Thank you so much for being so cooperative and for opening this PR! It's extremely appreciated :3 Edit: I have merged into a branch called
mfa
for now, since as you said, the tests you added currently fail. I will mock the missing MFA endpoint using thehttptest
crate, then merge intodev
Gotcha, thank you for the care and guidance as well :slightly_smiling_face:
Here is my suggested implementation of MFA #40
Features
ChorusError
.complete_mfa_challenge
which calls the endpoint to verify MFA.Refactors
TotpSchema
.user
field type is wrapped withOption
so there is an exact way to know when it is authenticated. Theshell
function has also been changed accordingly.Notes