-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Conversation
…or various mfa scenarios
There was a problem hiding this 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(); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌 thank you
ui/mirage/factories/mfa-method.js
Outdated
@@ -0,0 +1,13 @@ | |||
import { Factory } from 'ember-cli-mirage'; | |||
import faker from 'faker'; |
There was a problem hiding this comment.
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 🤔
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
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}} |
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
ui/tests/acceptance/mfa-test.js
Outdated
assert | ||
.dom('[data-test-mfa-description]') | ||
.includesText( | ||
'2 methods are required for successful authentication.', |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this 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 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.