-
Notifications
You must be signed in to change notification settings - Fork 117
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
feat(Auth): Add TOTP Support (#2537) #2568
Conversation
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## main #2568 +/- ##
==========================================
- Coverage 41.50% 41.23% -0.27%
==========================================
Files 874 885 +11
Lines 27643 28240 +597
Branches 3883 3993 +110
==========================================
+ Hits 11473 11645 +172
- Misses 14944 15312 +368
- Partials 1226 1283 +57 |
aws-auth-cognito/src/main/java/com/amplifyframework/auth/cognito/KotlinAuthFacadeInternal.kt
Outdated
Show resolved
Hide resolved
...ain/java/com/amplifyframework/auth/cognito/options/AWSCognitoAuthVerifyTOTPSetupOptions.java
Outdated
Show resolved
Hide resolved
...ain/java/com/amplifyframework/auth/cognito/options/AWSCognitoAuthVerifyTOTPSetupOptions.java
Outdated
Show resolved
Hide resolved
...ain/java/com/amplifyframework/auth/cognito/options/AWSCognitoAuthVerifyTOTPSetupOptions.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/amplifyframework/auth/options/AuthVerifyTOTPSetupOptions.java
Outdated
Show resolved
Hide resolved
aws-auth-cognito/src/main/java/com/amplifyframework/auth/cognito/UserMFAPreference.kt
Outdated
Show resolved
Hide resolved
...java/com/amplifyframework/auth/cognito/exceptions/service/EnableSoftwareTokenMfaException.kt
Outdated
Show resolved
Hide resolved
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.
Feature tests are missing
...nito/src/androidTest/java/com/amplifyframework/auth/cognito/AWSCognitoAuthPluginTOTPTests.kt
Outdated
Show resolved
Hide resolved
aws-auth-cognito/src/main/java/com/amplifyframework/auth/cognito/RealAWSCognitoAuthPlugin.kt
Show resolved
Hide resolved
aws-auth-cognito/src/main/java/com/amplifyframework/auth/cognito/RealAWSCognitoAuthPlugin.kt
Show resolved
Hide resolved
@@ -681,6 +683,53 @@ class AWSCognitoAuthPluginTest { | |||
verify(timeout = CHANNEL_TIMEOUT) { realPlugin.clearFederationToIdentityPool(any(), any()) } | |||
} | |||
|
|||
@Test | |||
fun setUpTOTP() { |
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.
For this test and the 3 tests below it, any()
shouldn't be used on the last blocks. Its should be asserting that the correct listeners, etc are passed. In this case it should check expectedOnSuccess and expectedOnError.
Issue #, if available:
Description of changes:
How did you test these changes?
(Please add a line here how the changes were tested)
Documentation update required?
General Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.