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

MFA #14049

Merged
merged 29 commits into from Feb 17, 2022
Merged

MFA #14049

merged 29 commits into from Feb 17, 2022

Conversation

zofskeez
Copy link
Contributor

This feature adds multi-factor authentication support to the UI. If the user is required to take further action to satisfy the an mfa requirement they will be presented a form, otherwise for push notifications the standard login form will wait until the mfa requirements are fulfilled and display a message to the user.

image
image

@zofskeez zofskeez added the ui label Feb 14, 2022
@zofskeez zofskeez added this to the 1.10 milestone Feb 14, 2022
@vercel vercel bot temporarily deployed to Preview – vault February 14, 2022 19:38 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook February 14, 2022 19:38 Inactive
Copy link
Collaborator

@hashishaw hashishaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! I pulled down the branch and was playing with the various logins, but I didn't see the error timer on a failed passcode. I might have set it up wrong though. Either way, this is a great start and we can follow on with updates!

} catch (error) {
this.errors = error.errors;
// update if specific error can be parsed for incorrect passcode
// this.newCodeDelay.perform();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to keep this commented out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I commented this out recently until I can confirm whether or not the backend is sending a specific error response for this scenario or if the delay is necessary.

} catch (e) {
// check for totp not configured mfa error before throwing
const errors = this.handleError(e);
// stubbing error - verify once API is finalized
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add this as a TODO?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call I updated the comment

* @param [isInline=false] {Bool} - Whether or not the select should be displayed as inline-block or block.
* @param [isFullwidth=false] {Bool} - Whether or not the select should take up the full width of the parent element.
* @param onChange=null {Func} - The action to take once the user has selected an item. This method will be passed the `value` of the select.
* @param {string} [label=null] - The label for the select element.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙌 thank you

@@ -0,0 +1,13 @@
import { Factory } from 'ember-cli-mirage';
import faker from 'faker';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we pulled out this dep 🤔

Copy link
Contributor Author

@zofskeez zofskeez Feb 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't merged main as of yet but thanks for the reminder 🙂. I'll get this updated before it breaks post merge.

@@ -0,0 +1,135 @@
import { module, test } from 'qunit';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

>
Verify
</button>
{{#if this.newCodeDelay.isRunning}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this is the real reason concurrency rocks. the rest of it is difficult, but this is so nice.

@@ -0,0 +1,146 @@
import { Response } from 'miragejs';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zofskeez do we need the mirage handler now that the API is done, or will this be useful later for any testing or debugging?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we landed on whether or not to keep feature handlers around. In this case I am using it in the tests since push notifications require user input from a secondary device.

My gut says it's probably a good idea to keep mirage handlers around after feature work is complete in case we want to use them for testing in the future.

assert
.dom('[data-test-mfa-description]')
.includesText(
'2 methods are required for successful authentication.',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure where this is in the code, but if possible it seems like this should be a written two instead of 2. Any numbers under 10 are generally written out.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering if we have a library or helper that converts integers to their English representation? This value comes from an array length so I wasn't sure how to handle converting it, or more accurately when to stop since the array could theoretically be any length. If the pattern should be any number under 10 is written out I could write a util and also a template helper for that.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a helper for this would be useful! Angel is right, usually numbers under 10 are wordy

Copy link
Contributor

@Monkeychip Monkeychip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of comments/questions but nothing blocking. Nice work!

This reverts commit 8ee6a6a, reversing
changes made to 2428dd6.
@vercel vercel bot temporarily deployed to Preview – vault February 17, 2022 15:43 Inactive
@zofskeez zofskeez merged commit 5f17953 into main Feb 17, 2022
@zofskeez zofskeez deleted the ui/mfa branch February 17, 2022 16:11
@zofskeez zofskeez mentioned this pull request Feb 17, 2022
zofskeez added a commit that referenced this pull request Feb 17, 2022
This reverts commit 5f17953.
zofskeez added a commit that referenced this pull request Feb 17, 2022
@zofskeez zofskeez mentioned this pull request Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants