-
Notifications
You must be signed in to change notification settings - Fork 9
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
Test for two factor authentication #131
Conversation
@dpakach @skshetry @paurakhsharma please review on my PR. |
Codecov Report
@@ Coverage Diff @@
## master #131 +/- ##
=========================================
Coverage 64.68% 64.68%
Complexity 61 61
=========================================
Files 13 13
Lines 252 252
=========================================
Hits 163 163
Misses 89 89 Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #131 +/- ##
=========================================
Coverage 64.68% 64.68%
Complexity 61 61
=========================================
Files 13 13
Lines 252 252
=========================================
Hits 163 163
Misses 89 89 Continue to review full report at Codecov.
|
* @return void | ||
*/ | ||
public function sendRequestWithSecretKey($user, $secretKey) { | ||
$response = \TestHelpers\OcsApiHelper::sendRequest( |
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.
import OcsApiHelper
into the namespace
} | ||
|
||
/** | ||
* @When the administrator tries to verify the otp key for user :user using the correct key |
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.
* @When the administrator tries to verify the otp key for user :user using the correct key | |
* @When the administrator tries to verify with the one-time key generated from the secret key for user :user |
} | ||
|
||
/** | ||
* @When the administrator tries to verify the otp key for user :user using the wrong key |
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.
* @When the administrator tries to verify the otp key for user :user using the wrong key | |
* @When the administrator tries to verify with the random key :key for user :user |
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.
Or, maybe this:
* @When the administrator tries to verify the otp key for user :user using the wrong key | |
* @When the administrator tries to verify with the random key for user :bust_in_silhouette: |
I do prefer the first one though.
* | ||
* @return void | ||
*/ | ||
public function theAdministratorTriesToVerifyTheOtpKeyForUserAUserThatDoesNotExist() { |
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 you need this step? You could achieve the same thing with above steps as well
3dfee2c
to
d2e4f92
Compare
* | ||
* @return void | ||
*/ | ||
public function theAdministratorTriesToVerifyTheOtpKeyForUserUsingTheWrongKey($user) { |
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.
public function theAdministratorTriesToVerifyTheOtpKeyForUserUsingTheWrongKey($user) { | |
public function theAdministratorTriesToVerifyTheOtpKeyForUserUsingTheWrongKey($user, $key) { |
Also, you need to change docs, and the body of the function to use the Skey
.
Given user "user0" has logged in using the webUI | ||
And the user has browsed to the personal security settings page | ||
And the user has activated TOTP Second-factor auth but not verified | ||
When the administrator tries to verify with the random key "random" for user "user0" |
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.
When the administrator tries to verify with the random key "random" for user "user0" | |
When the administrator tries to verify with the invalid key "random" for user "user0" |
d2e4f92
to
f0d5f4b
Compare
@individual-it @phil-davis please review again |
Description
The result of last verification request made using OTP can be checked via API.
Related Issue
#38
Types of changes