diff --git a/.gitattributes b/.gitattributes index ab23572ce9..3fcc994970 100644 --- a/.gitattributes +++ b/.gitattributes @@ -74,7 +74,6 @@ ## Generated SDK files packages/**/lib/src/sdk/src/** linguist-generated -packages/auth/amplify_auth_cognito_dart/lib/src/sdk/sdk_exception.dart linguist-generated ## Generated Swift Plugins packages/amplify_datastore/ios/internal/** linguist-generated diff --git a/infra-gen2/backends/auth/mfa-optional-email-sms/.gitignore b/infra-gen2/backends/auth/mfa-optional-email-sms/.gitignore deleted file mode 100644 index 03d4668c65..0000000000 --- a/infra-gen2/backends/auth/mfa-optional-email-sms/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -# amplify -node_modules -.amplify -amplify_outputs* -amplifyconfiguration* diff --git a/infra-gen2/backends/auth/mfa-optional-email-sms/amplify/auth/resource.ts b/infra-gen2/backends/auth/mfa-optional-email-sms/amplify/auth/resource.ts deleted file mode 100644 index 43ddc18eec..0000000000 --- a/infra-gen2/backends/auth/mfa-optional-email-sms/amplify/auth/resource.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -import { defineAuth } from "@aws-amplify/backend"; - -export const auth = defineAuth({ - name: "mfa-optional-email-sms", - loginWith: { - email: true, - }, - - // TODO(khatruong2009): Uncomment the following line when the feature is ready. - // multifactor: { - // mode: "OPTIONAL", - // email: true, - // sms: true, - // }, -}); diff --git a/infra-gen2/backends/auth/mfa-optional-email-sms/amplify/backend.ts b/infra-gen2/backends/auth/mfa-optional-email-sms/amplify/backend.ts deleted file mode 100644 index d6b854225f..0000000000 --- a/infra-gen2/backends/auth/mfa-optional-email-sms/amplify/backend.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -import { defineBackend } from "@aws-amplify/backend"; -import { addAuthUserExtensions } from "infra-common"; -import { auth } from "./auth/resource"; - -const backend = defineBackend({ - auth, -}); - -const resources = backend.auth.resources; -const { userPool, cfnResources } = resources; -const { stack } = userPool; -const { cfnUserPool } = cfnResources; - -// Adds infra for creating/deleting users via App Sync and fetching confirmation -// and MFA codes from App Sync. -const customOutputs = addAuthUserExtensions({ - name: "mfa-optional-email-sms", - stack, - userPool, - cfnUserPool, -}); -backend.addOutput(customOutputs); diff --git a/infra-gen2/backends/auth/mfa-optional-email-sms/amplify/package.json b/infra-gen2/backends/auth/mfa-optional-email-sms/amplify/package.json deleted file mode 100644 index aead43de36..0000000000 --- a/infra-gen2/backends/auth/mfa-optional-email-sms/amplify/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} \ No newline at end of file diff --git a/infra-gen2/backends/auth/mfa-optional-email-sms/amplify/tsconfig.json b/infra-gen2/backends/auth/mfa-optional-email-sms/amplify/tsconfig.json deleted file mode 100644 index 4eb4ab26ca..0000000000 --- a/infra-gen2/backends/auth/mfa-optional-email-sms/amplify/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "es2022", - "module": "es2022", - "moduleResolution": "bundler", - "resolveJsonModule": true, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "strict": true, - "skipLibCheck": true, - "paths": { - "$amplify/*": [ - "../.amplify/generated/*" - ] - } - } -} \ No newline at end of file diff --git a/infra-gen2/backends/auth/mfa-optional-email-sms/package.json b/infra-gen2/backends/auth/mfa-optional-email-sms/package.json deleted file mode 100644 index f8ffc5b939..0000000000 --- a/infra-gen2/backends/auth/mfa-optional-email-sms/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "mfa-optional-email-sms", - "version": "1.0.0", - "main": "index.js" -} diff --git a/infra-gen2/backends/auth/mfa-optional-email-totp/.gitignore b/infra-gen2/backends/auth/mfa-optional-email-totp/.gitignore deleted file mode 100644 index 03d4668c65..0000000000 --- a/infra-gen2/backends/auth/mfa-optional-email-totp/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -# amplify -node_modules -.amplify -amplify_outputs* -amplifyconfiguration* diff --git a/infra-gen2/backends/auth/mfa-optional-email-totp/amplify/auth/resource.ts b/infra-gen2/backends/auth/mfa-optional-email-totp/amplify/auth/resource.ts deleted file mode 100644 index ae1765e5d0..0000000000 --- a/infra-gen2/backends/auth/mfa-optional-email-totp/amplify/auth/resource.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -import { defineAuth } from "@aws-amplify/backend"; - -export const auth = defineAuth({ - name: "mfa-optional-email-totp", - loginWith: { - email: true, - }, - - // TODO(khatruong2009): Uncomment the following line when the feature is ready. - // multifactor: { - // mode: "OPTIONAL", - // email: true, - // totp: true, - // }, -}); diff --git a/infra-gen2/backends/auth/mfa-optional-email-totp/amplify/backend.ts b/infra-gen2/backends/auth/mfa-optional-email-totp/amplify/backend.ts deleted file mode 100644 index a3f1f19985..0000000000 --- a/infra-gen2/backends/auth/mfa-optional-email-totp/amplify/backend.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -import { defineBackend } from "@aws-amplify/backend"; -import { addAuthUserExtensions } from "infra-common"; -import { auth } from "./auth/resource"; - -const backend = defineBackend({ - auth, -}); - -const resources = backend.auth.resources; -const { userPool, cfnResources } = resources; -const { stack } = userPool; -const { cfnUserPool } = cfnResources; - -// Adds infra for creating/deleting users via App Sync and fetching confirmation -// and MFA codes from App Sync. -const customOutputs = addAuthUserExtensions({ - name: "mfa-optional-email-totp", - stack, - userPool, - cfnUserPool, -}); -backend.addOutput(customOutputs); diff --git a/infra-gen2/backends/auth/mfa-optional-email-totp/amplify/package.json b/infra-gen2/backends/auth/mfa-optional-email-totp/amplify/package.json deleted file mode 100644 index aead43de36..0000000000 --- a/infra-gen2/backends/auth/mfa-optional-email-totp/amplify/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} \ No newline at end of file diff --git a/infra-gen2/backends/auth/mfa-optional-email-totp/amplify/tsconfig.json b/infra-gen2/backends/auth/mfa-optional-email-totp/amplify/tsconfig.json deleted file mode 100644 index 4eb4ab26ca..0000000000 --- a/infra-gen2/backends/auth/mfa-optional-email-totp/amplify/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "es2022", - "module": "es2022", - "moduleResolution": "bundler", - "resolveJsonModule": true, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "strict": true, - "skipLibCheck": true, - "paths": { - "$amplify/*": [ - "../.amplify/generated/*" - ] - } - } -} \ No newline at end of file diff --git a/infra-gen2/backends/auth/mfa-optional-email-totp/package.json b/infra-gen2/backends/auth/mfa-optional-email-totp/package.json deleted file mode 100644 index 20be47dae0..0000000000 --- a/infra-gen2/backends/auth/mfa-optional-email-totp/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "mfa-optional-email-totp", - "version": "1.0.0", - "main": "index.js" -} diff --git a/infra-gen2/backends/auth/mfa-optional-email/.gitignore b/infra-gen2/backends/auth/mfa-optional-email/.gitignore deleted file mode 100644 index 03d4668c65..0000000000 --- a/infra-gen2/backends/auth/mfa-optional-email/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -# amplify -node_modules -.amplify -amplify_outputs* -amplifyconfiguration* diff --git a/infra-gen2/backends/auth/mfa-optional-email/amplify/auth/resource.ts b/infra-gen2/backends/auth/mfa-optional-email/amplify/auth/resource.ts deleted file mode 100644 index 1e33905c1d..0000000000 --- a/infra-gen2/backends/auth/mfa-optional-email/amplify/auth/resource.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -import { defineAuth } from "@aws-amplify/backend"; - -export const auth = defineAuth({ - name: "mfa-optional-email", - loginWith: { - email: true, - }, - - // TODO(khatruong2009): Uncomment the following line when the feature is ready. - // multifactor: { - // mode: "OPTIONAL", - // email: true, - // }, -}); diff --git a/infra-gen2/backends/auth/mfa-optional-email/amplify/backend.ts b/infra-gen2/backends/auth/mfa-optional-email/amplify/backend.ts deleted file mode 100644 index ceb5e2a90a..0000000000 --- a/infra-gen2/backends/auth/mfa-optional-email/amplify/backend.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -import { defineBackend } from "@aws-amplify/backend"; -import { addAuthUserExtensions } from "infra-common"; -import { auth } from "./auth/resource"; - -const backend = defineBackend({ - auth, -}); - -const resources = backend.auth.resources; -const { userPool, cfnResources } = resources; -const { stack } = userPool; -const { cfnUserPool } = cfnResources; - -// Adds infra for creating/deleting users via App Sync and fetching confirmation -// and MFA codes from App Sync. -const customOutputs = addAuthUserExtensions({ - name: "mfa-optional-email", - stack, - userPool, - cfnUserPool, -}); -backend.addOutput(customOutputs); diff --git a/infra-gen2/backends/auth/mfa-optional-email/amplify/package.json b/infra-gen2/backends/auth/mfa-optional-email/amplify/package.json deleted file mode 100644 index aead43de36..0000000000 --- a/infra-gen2/backends/auth/mfa-optional-email/amplify/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} \ No newline at end of file diff --git a/infra-gen2/backends/auth/mfa-optional-email/amplify/tsconfig.json b/infra-gen2/backends/auth/mfa-optional-email/amplify/tsconfig.json deleted file mode 100644 index 4eb4ab26ca..0000000000 --- a/infra-gen2/backends/auth/mfa-optional-email/amplify/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "es2022", - "module": "es2022", - "moduleResolution": "bundler", - "resolveJsonModule": true, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "strict": true, - "skipLibCheck": true, - "paths": { - "$amplify/*": [ - "../.amplify/generated/*" - ] - } - } -} \ No newline at end of file diff --git a/infra-gen2/backends/auth/mfa-optional-email/package.json b/infra-gen2/backends/auth/mfa-optional-email/package.json deleted file mode 100644 index a716d71dd4..0000000000 --- a/infra-gen2/backends/auth/mfa-optional-email/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "mfa-optional-email", - "version": "1.0.0", - "main": "index.js" -} diff --git a/infra-gen2/backends/auth/mfa-required-email-sms/.gitignore b/infra-gen2/backends/auth/mfa-required-email-sms/.gitignore deleted file mode 100644 index 03d4668c65..0000000000 --- a/infra-gen2/backends/auth/mfa-required-email-sms/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -# amplify -node_modules -.amplify -amplify_outputs* -amplifyconfiguration* diff --git a/infra-gen2/backends/auth/mfa-required-email-sms/amplify/auth/resource.ts b/infra-gen2/backends/auth/mfa-required-email-sms/amplify/auth/resource.ts deleted file mode 100644 index e90924c42e..0000000000 --- a/infra-gen2/backends/auth/mfa-required-email-sms/amplify/auth/resource.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -import { defineAuth } from "@aws-amplify/backend"; - -export const auth = defineAuth({ - name: "mfa-required-email-sms", - loginWith: { - email: true, - }, - // TODO(khatruong2009): Uncomment the following line when the feature is ready. - // multifactor: { - // mode: "REQUIRED", - // email: true, - // sms: true, - // }, -}); diff --git a/infra-gen2/backends/auth/mfa-required-email-sms/amplify/backend.ts b/infra-gen2/backends/auth/mfa-required-email-sms/amplify/backend.ts deleted file mode 100644 index 397b7b4a6e..0000000000 --- a/infra-gen2/backends/auth/mfa-required-email-sms/amplify/backend.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -import { defineBackend } from "@aws-amplify/backend"; -import { addAuthUserExtensions } from "infra-common"; -import { auth } from "./auth/resource"; - -const backend = defineBackend({ - auth, -}); - -const resources = backend.auth.resources; -const { userPool, cfnResources } = resources; -const { stack } = userPool; -const { cfnUserPool } = cfnResources; - -// Adds infra for creating/deleting users via App Sync and fetching confirmation -// and MFA codes from App Sync. -const customOutputs = addAuthUserExtensions({ - name: "mfa-required-email-sms", - stack, - userPool, - cfnUserPool, -}); -backend.addOutput(customOutputs); diff --git a/infra-gen2/backends/auth/mfa-required-email-sms/amplify/package.json b/infra-gen2/backends/auth/mfa-required-email-sms/amplify/package.json deleted file mode 100644 index aead43de36..0000000000 --- a/infra-gen2/backends/auth/mfa-required-email-sms/amplify/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} \ No newline at end of file diff --git a/infra-gen2/backends/auth/mfa-required-email-sms/amplify/tsconfig.json b/infra-gen2/backends/auth/mfa-required-email-sms/amplify/tsconfig.json deleted file mode 100644 index 4eb4ab26ca..0000000000 --- a/infra-gen2/backends/auth/mfa-required-email-sms/amplify/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "es2022", - "module": "es2022", - "moduleResolution": "bundler", - "resolveJsonModule": true, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "strict": true, - "skipLibCheck": true, - "paths": { - "$amplify/*": [ - "../.amplify/generated/*" - ] - } - } -} \ No newline at end of file diff --git a/infra-gen2/backends/auth/mfa-required-email-sms/package.json b/infra-gen2/backends/auth/mfa-required-email-sms/package.json deleted file mode 100644 index b2e8c9c4c7..0000000000 --- a/infra-gen2/backends/auth/mfa-required-email-sms/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "mfa-required-email-sms", - "version": "1.0.0", - "main": "index.js" -} diff --git a/infra-gen2/backends/auth/mfa-required-email-totp/.gitignore b/infra-gen2/backends/auth/mfa-required-email-totp/.gitignore deleted file mode 100644 index 03d4668c65..0000000000 --- a/infra-gen2/backends/auth/mfa-required-email-totp/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -# amplify -node_modules -.amplify -amplify_outputs* -amplifyconfiguration* diff --git a/infra-gen2/backends/auth/mfa-required-email-totp/amplify/auth/resource.ts b/infra-gen2/backends/auth/mfa-required-email-totp/amplify/auth/resource.ts deleted file mode 100644 index bf09fd7dc7..0000000000 --- a/infra-gen2/backends/auth/mfa-required-email-totp/amplify/auth/resource.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -import { defineAuth } from "@aws-amplify/backend"; - -export const auth = defineAuth({ - name: "mfa-required-email-totp", - loginWith: { - email: true, - }, - // TODO(khatruong2009): Uncomment the following line when the feature is ready. - // multifactor: { - // mode: "REQUIRED", - // email: true, - // totp: true, - // }, -}); diff --git a/infra-gen2/backends/auth/mfa-required-email-totp/amplify/backend.ts b/infra-gen2/backends/auth/mfa-required-email-totp/amplify/backend.ts deleted file mode 100644 index c9e3bd79c1..0000000000 --- a/infra-gen2/backends/auth/mfa-required-email-totp/amplify/backend.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -import { defineBackend } from "@aws-amplify/backend"; -import { addAuthUserExtensions } from "infra-common"; -import { auth } from "./auth/resource"; - -const backend = defineBackend({ - auth, -}); - -const resources = backend.auth.resources; -const { userPool, cfnResources } = resources; -const { stack } = userPool; -const { cfnUserPool } = cfnResources; - -// Adds infra for creating/deleting users via App Sync and fetching confirmation -// and MFA codes from App Sync. -const customOutputs = addAuthUserExtensions({ - name: "mfa-required-email-totp", - stack, - userPool, - cfnUserPool, -}); -backend.addOutput(customOutputs); diff --git a/infra-gen2/backends/auth/mfa-required-email-totp/amplify/package.json b/infra-gen2/backends/auth/mfa-required-email-totp/amplify/package.json deleted file mode 100644 index aead43de36..0000000000 --- a/infra-gen2/backends/auth/mfa-required-email-totp/amplify/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} \ No newline at end of file diff --git a/infra-gen2/backends/auth/mfa-required-email-totp/amplify/tsconfig.json b/infra-gen2/backends/auth/mfa-required-email-totp/amplify/tsconfig.json deleted file mode 100644 index 4eb4ab26ca..0000000000 --- a/infra-gen2/backends/auth/mfa-required-email-totp/amplify/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "es2022", - "module": "es2022", - "moduleResolution": "bundler", - "resolveJsonModule": true, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "strict": true, - "skipLibCheck": true, - "paths": { - "$amplify/*": [ - "../.amplify/generated/*" - ] - } - } -} \ No newline at end of file diff --git a/infra-gen2/backends/auth/mfa-required-email-totp/package.json b/infra-gen2/backends/auth/mfa-required-email-totp/package.json deleted file mode 100644 index 1ebbbbb859..0000000000 --- a/infra-gen2/backends/auth/mfa-required-email-totp/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "mfa-required-email-totp", - "version": "1.0.0", - "main": "index.js" -} diff --git a/infra-gen2/backends/auth/mfa-required-email/.gitignore b/infra-gen2/backends/auth/mfa-required-email/.gitignore deleted file mode 100644 index 03d4668c65..0000000000 --- a/infra-gen2/backends/auth/mfa-required-email/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -# amplify -node_modules -.amplify -amplify_outputs* -amplifyconfiguration* diff --git a/infra-gen2/backends/auth/mfa-required-email/amplify/auth/resource.ts b/infra-gen2/backends/auth/mfa-required-email/amplify/auth/resource.ts deleted file mode 100644 index ba859af386..0000000000 --- a/infra-gen2/backends/auth/mfa-required-email/amplify/auth/resource.ts +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -import { defineAuth } from "@aws-amplify/backend"; - -export const auth = defineAuth({ - name: "mfa-required-email", - loginWith: { - email: true, - }, - // TODO(khatruong2009): Uncomment the following line when the feature is ready. - // multifactor: { - // mode: "REQUIRED", - // email: true, - // }, -}); diff --git a/infra-gen2/backends/auth/mfa-required-email/amplify/backend.ts b/infra-gen2/backends/auth/mfa-required-email/amplify/backend.ts deleted file mode 100644 index e9299cf711..0000000000 --- a/infra-gen2/backends/auth/mfa-required-email/amplify/backend.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -import { defineBackend } from "@aws-amplify/backend"; -import { addAuthUserExtensions } from "infra-common"; -import { auth } from "./auth/resource"; - -const backend = defineBackend({ - auth, -}); - -const resources = backend.auth.resources; -const { userPool, cfnResources } = resources; -const { stack } = userPool; -const { cfnUserPool } = cfnResources; - -// Adds infra for creating/deleting users via App Sync and fetching confirmation -// and MFA codes from App Sync. -const customOutputs = addAuthUserExtensions({ - name: "mfa-required-email", - stack, - userPool, - cfnUserPool, -}); -backend.addOutput(customOutputs); diff --git a/infra-gen2/backends/auth/mfa-required-email/amplify/package.json b/infra-gen2/backends/auth/mfa-required-email/amplify/package.json deleted file mode 100644 index aead43de36..0000000000 --- a/infra-gen2/backends/auth/mfa-required-email/amplify/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} \ No newline at end of file diff --git a/infra-gen2/backends/auth/mfa-required-email/amplify/tsconfig.json b/infra-gen2/backends/auth/mfa-required-email/amplify/tsconfig.json deleted file mode 100644 index 4eb4ab26ca..0000000000 --- a/infra-gen2/backends/auth/mfa-required-email/amplify/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "es2022", - "module": "es2022", - "moduleResolution": "bundler", - "resolveJsonModule": true, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "strict": true, - "skipLibCheck": true, - "paths": { - "$amplify/*": [ - "../.amplify/generated/*" - ] - } - } -} \ No newline at end of file diff --git a/infra-gen2/backends/auth/mfa-required-email/package.json b/infra-gen2/backends/auth/mfa-required-email/package.json deleted file mode 100644 index 3d30b5522b..0000000000 --- a/infra-gen2/backends/auth/mfa-required-email/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "mfa-required-email", - "version": "1.0.0", - "main": "index.js" -} diff --git a/infra-gen2/backends/auth/username-login-mfa/.gitignore b/infra-gen2/backends/auth/username-login-mfa/.gitignore deleted file mode 100644 index 03d4668c65..0000000000 --- a/infra-gen2/backends/auth/username-login-mfa/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -# amplify -node_modules -.amplify -amplify_outputs* -amplifyconfiguration* diff --git a/infra-gen2/backends/auth/username-login-mfa/amplify/auth/resource.ts b/infra-gen2/backends/auth/username-login-mfa/amplify/auth/resource.ts deleted file mode 100644 index 94d78b3d4b..0000000000 --- a/infra-gen2/backends/auth/username-login-mfa/amplify/auth/resource.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -import { defineAuth } from "@aws-amplify/backend"; - -export const auth = defineAuth({ - name: "mfa-username-login", - loginWith: { - phone: true, - }, - // TODO(khatruong2009): Uncomment the following line when the feature is ready. - // multifactor: { - // mode: "REQUIRED", - // email: true, - // sms: true, - // totp: true, - // }, - accountRecovery: "PHONE_WITHOUT_MFA_AND_EMAIL", -}); diff --git a/infra-gen2/backends/auth/username-login-mfa/amplify/backend.ts b/infra-gen2/backends/auth/username-login-mfa/amplify/backend.ts deleted file mode 100644 index ce86475882..0000000000 --- a/infra-gen2/backends/auth/username-login-mfa/amplify/backend.ts +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -import { defineBackend } from "@aws-amplify/backend"; -import { addAuthUserExtensions } from "infra-common"; -import { auth } from "./auth/resource"; - -const backend = defineBackend({ - auth, -}); - -const resources = backend.auth.resources; -const { userPool, cfnResources } = resources; -const { stack } = userPool; -const { cfnUserPool } = cfnResources; - -// Adds infra for creating/deleting users via App Sync and fetching confirmation -// and MFA codes from App Sync. -const customOutputs = addAuthUserExtensions({ - name: "username-login-mfa", - stack, - userPool, - cfnUserPool, -}); -backend.addOutput(customOutputs); - -cfnUserPool.schema = undefined; -cfnUserPool.usernameAttributes = []; -cfnUserPool.emailConfiguration = { - emailSendingAccount: "DEVELOPER", - from: "ktruon@amazon.com", - sourceArn: `arn:aws:ses:${stack.region}:${stack.account}:identity/ktruon@amazon.com`, -}; -cfnUserPool.adminCreateUserConfig = { - allowAdminCreateUserOnly: true, -}; -cfnUserPool.autoVerifiedAttributes = []; -cfnUserPool.userAttributeUpdateSettings = { - attributesRequireVerificationBeforeUpdate: [], -}; diff --git a/infra-gen2/backends/auth/username-login-mfa/amplify/package.json b/infra-gen2/backends/auth/username-login-mfa/amplify/package.json deleted file mode 100644 index aead43de36..0000000000 --- a/infra-gen2/backends/auth/username-login-mfa/amplify/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} \ No newline at end of file diff --git a/infra-gen2/backends/auth/username-login-mfa/amplify/tsconfig.json b/infra-gen2/backends/auth/username-login-mfa/amplify/tsconfig.json deleted file mode 100644 index 4eb4ab26ca..0000000000 --- a/infra-gen2/backends/auth/username-login-mfa/amplify/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "es2022", - "module": "es2022", - "moduleResolution": "bundler", - "resolveJsonModule": true, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "strict": true, - "skipLibCheck": true, - "paths": { - "$amplify/*": [ - "../.amplify/generated/*" - ] - } - } -} \ No newline at end of file diff --git a/infra-gen2/backends/auth/username-login-mfa/package.json b/infra-gen2/backends/auth/username-login-mfa/package.json deleted file mode 100644 index e604512607..0000000000 --- a/infra-gen2/backends/auth/username-login-mfa/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "username-login-mfa", - "version": "1.0.0", - "main": "index.js" -} diff --git a/infra-gen2/package-lock.json b/infra-gen2/package-lock.json index f56c0348d5..a4fb252803 100644 --- a/infra-gen2/package-lock.json +++ b/infra-gen2/package-lock.json @@ -45,15 +45,9 @@ "backends/auth/email-sign-in": { "version": "1.0.0" }, - "backends/auth/mfa-optional-email": { - "version": "1.0.0" - }, "backends/auth/mfa-optional-sms": { "version": "1.0.0" }, - "backends/auth/mfa-required-email": { - "version": "1.0.0" - }, "backends/auth/mfa-required-sms": { "version": "1.0.0" }, @@ -6911,7 +6905,7 @@ "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, "node_modules/@aws-crypto/sha1-browser/node_modules/@smithy/util-utf8": { @@ -6925,7 +6919,7 @@ "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, "node_modules/@aws-crypto/sha256-browser": { @@ -6952,7 +6946,7 @@ "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, "node_modules/@aws-crypto/sha256-browser/node_modules/@smithy/util-buffer-from": { @@ -6965,7 +6959,7 @@ "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, "node_modules/@aws-crypto/sha256-browser/node_modules/@smithy/util-utf8": { @@ -6978,7 +6972,7 @@ "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, "node_modules/@aws-crypto/sha256-js": { @@ -7024,7 +7018,7 @@ "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, "node_modules/@aws-crypto/util/node_modules/@smithy/util-buffer-from": { @@ -7037,7 +7031,7 @@ "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, "node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8": { @@ -7050,7 +7044,7 @@ "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, "node_modules/@aws-sdk/client-amplify": { @@ -10075,7 +10069,7 @@ "@aws-sdk/middleware-user-agent": "3.620.0", "@aws-sdk/region-config-resolver": "3.614.0", "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", + "@aws-sdk/util-endpoints": "3.614.0", "@aws-sdk/util-user-agent-browser": "3.609.0", "@aws-sdk/util-user-agent-node": "3.614.0", "@smithy/config-resolver": "^3.0.5", @@ -10124,7 +10118,7 @@ "@aws-sdk/middleware-user-agent": "3.620.0", "@aws-sdk/region-config-resolver": "3.614.0", "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", + "@aws-sdk/util-endpoints": "3.614.0", "@aws-sdk/util-user-agent-browser": "3.609.0", "@aws-sdk/util-user-agent-node": "3.614.0", "@smithy/config-resolver": "^3.0.5", @@ -10174,7 +10168,7 @@ "@aws-sdk/middleware-user-agent": "3.620.0", "@aws-sdk/region-config-resolver": "3.614.0", "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", + "@aws-sdk/util-endpoints": "3.614.0", "@aws-sdk/util-user-agent-browser": "3.609.0", "@aws-sdk/util-user-agent-node": "3.614.0", "@smithy/config-resolver": "^3.0.5", @@ -10228,7 +10222,7 @@ "@aws-sdk/middleware-user-agent": "3.620.0", "@aws-sdk/region-config-resolver": "3.614.0", "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", + "@aws-sdk/util-endpoints": "3.614.0", "@aws-sdk/util-user-agent-browser": "3.609.0", "@aws-sdk/util-user-agent-node": "3.614.0", "@smithy/config-resolver": "^3.0.5", @@ -10477,20 +10471,6 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-personalize-events/node_modules/@aws-sdk/middleware-user-agent/node_modules/@aws-sdk/util-endpoints": { - "version": "3.614.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.614.0.tgz", - "integrity": "sha512-wK2cdrXHH4oz4IomV/yrGkftU9A+ITB6nFL+rxxyO78is2ifHJpFdV4aqk4LSkXYPi6CXWNru/Dqc7yiKXgJPw==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/types": "^3.3.0", - "@smithy/util-endpoints": "^2.0.5", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, "node_modules/@aws-sdk/client-personalize-events/node_modules/@aws-sdk/region-config-resolver": { "version": "3.614.0", "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.614.0.tgz", @@ -10541,9 +10521,10 @@ } }, "node_modules/@aws-sdk/client-personalize-events/node_modules/@aws-sdk/util-endpoints": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.637.0.tgz", - "integrity": "sha512-pAqOKUHeVWHEXXDIp/qoMk/6jyxIb6GGjnK1/f8dKHtKIEs4tKsnnL563gceEvdad53OPXIt86uoevCcCzmBnw==", + "version": "3.614.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.614.0.tgz", + "integrity": "sha512-wK2cdrXHH4oz4IomV/yrGkftU9A+ITB6nFL+rxxyO78is2ifHJpFdV4aqk4LSkXYPi6CXWNru/Dqc7yiKXgJPw==", + "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.609.0", "@smithy/types": "^3.3.0", @@ -20106,18 +20087,10 @@ "node": ">= 8" } }, - "node_modules/mfa-optional-email": { - "resolved": "backends/auth/mfa-optional-email", - "link": true - }, "node_modules/mfa-optional-sms": { "resolved": "backends/auth/mfa-optional-sms", "link": true }, - "node_modules/mfa-required-email": { - "resolved": "backends/auth/mfa-required-email", - "link": true - }, "node_modules/mfa-required-sms": { "resolved": "backends/auth/mfa-required-sms", "link": true diff --git a/infra-gen2/tool/deploy_gen2.dart b/infra-gen2/tool/deploy_gen2.dart index b83efb7c60..15ffcf10f4 100644 --- a/infra-gen2/tool/deploy_gen2.dart +++ b/infra-gen2/tool/deploy_gen2.dart @@ -19,6 +19,11 @@ import 'package:path/path.dart' as p; /// 3. Add the backend to a category or create a new category /// 4. Run `dart tool/deploy_gen2.dart` to deploy the backend const List infraConfig = [ + AmplifyBackendGroup( + category: Category.analytics, + defaultOutput: '', + backends: [], + ), AmplifyBackendGroup( category: Category.api, defaultOutput: 'packages/api/amplify_api/example/lib', @@ -58,41 +63,6 @@ const List infraConfig = [ identifier: 'mfa-req-sms', pathToSource: 'infra-gen2/backends/auth/mfa-required-sms', ), - AmplifyBackend( - name: 'mfa-required-email', - identifier: 'mfa-req-email', - pathToSource: 'infra-gen2/backends/auth/mfa-required-email', - ), - AmplifyBackend( - name: 'mfa-required-email-sms', - identifier: 'mfa-req-ema-sms', - pathToSource: 'infra-gen2/backends/auth/mfa-required-email-sms', - ), - AmplifyBackend( - name: 'mfa-optional-email', - identifier: 'mfa-opt-email', - pathToSource: 'infra-gen2/backends/auth/mfa-optional-email', - ), - AmplifyBackend( - name: 'mfa-optional-email-sms', - identifier: 'mfa-opt-ema-sms', - pathToSource: 'infra-gen2/backends/auth/mfa-optional-email-sms', - ), - AmplifyBackend( - name: 'mfa-required-email-totp', - identifier: 'mfa-req-ema-tot', - pathToSource: 'infra-gen2/backends/auth/mfa-required-email-totp', - ), - AmplifyBackend( - name: 'mfa-optional-email-totp', - identifier: 'mfa-opt-ema-tot', - pathToSource: 'infra-gen2/backends/auth/mfa-optional-email-totp', - ), - AmplifyBackend( - name: 'username-login-mfa', - identifier: 'user-login-mfa', - pathToSource: 'infra-gen2/backends/auth/username-login-mfa', - ), ], ), AmplifyBackendGroup( diff --git a/infra/pnpm-lock.yaml b/infra/pnpm-lock.yaml index 456aa1cabb..ae73b772ac 100644 --- a/infra/pnpm-lock.yaml +++ b/infra/pnpm-lock.yaml @@ -1616,8 +1616,8 @@ packages: merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} - micromatch@4.0.8: - resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + micromatch@4.0.7: + resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} engines: {node: '>=8.6'} mimic-fn@2.1.0: @@ -3067,7 +3067,7 @@ snapshots: jest-util: 29.7.0 jest-validate: 29.7.0 jest-watcher: 29.7.0 - micromatch: 4.0.8 + micromatch: 4.0.7 pretty-format: 29.7.0 slash: 3.0.0 strip-ansi: 6.0.1 @@ -3178,7 +3178,7 @@ snapshots: jest-haste-map: 29.7.0 jest-regex-util: 29.6.3 jest-util: 29.7.0 - micromatch: 4.0.8 + micromatch: 4.0.7 pirates: 4.0.6 slash: 3.0.0 write-file-atomic: 4.0.2 @@ -4141,7 +4141,7 @@ snapshots: jest-runner: 29.7.0 jest-util: 29.7.0 jest-validate: 29.7.0 - micromatch: 4.0.8 + micromatch: 4.0.7 parse-json: 5.2.0 pretty-format: 29.7.0 slash: 3.0.0 @@ -4194,7 +4194,7 @@ snapshots: jest-regex-util: 29.6.3 jest-util: 29.7.0 jest-worker: 29.7.0 - micromatch: 4.0.8 + micromatch: 4.0.7 walker: 1.0.8 optionalDependencies: fsevents: 2.3.3 @@ -4218,7 +4218,7 @@ snapshots: '@types/stack-utils': 2.0.3 chalk: 4.1.2 graceful-fs: 4.2.11 - micromatch: 4.0.8 + micromatch: 4.0.7 pretty-format: 29.7.0 slash: 3.0.0 stack-utils: 2.0.6 @@ -4425,7 +4425,7 @@ snapshots: merge-stream@2.0.0: {} - micromatch@4.0.8: + micromatch@4.0.7: dependencies: braces: 3.0.3 picomatch: 2.3.1 diff --git a/packages/amplify/amplify_flutter/CHANGELOG.md b/packages/amplify/amplify_flutter/CHANGELOG.md index 590ee854ad..8088385bf1 100644 --- a/packages/amplify/amplify_flutter/CHANGELOG.md +++ b/packages/amplify/amplify_flutter/CHANGELOG.md @@ -1,8 +1,3 @@ -## 2.5.0 - -### Features -- feat(auth, authenticator): Add support for Email OTP MFA ([#5449](https://github.com/aws-amplify/amplify-flutter/pull/5449)) (#5472) - ## 2.4.1 ### Fixes diff --git a/packages/amplify/amplify_flutter/pubspec.yaml b/packages/amplify/amplify_flutter/pubspec.yaml index 8d7064ccad..d4ad221334 100644 --- a/packages/amplify/amplify_flutter/pubspec.yaml +++ b/packages/amplify/amplify_flutter/pubspec.yaml @@ -1,6 +1,6 @@ name: amplify_flutter description: The top level Flutter package for the AWS Amplify libraries. -version: 2.5.0 +version: 2.4.1 homepage: https://docs.amplify.aws/lib/q/platform/flutter/ repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/amplify/amplify_flutter issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues @@ -19,7 +19,7 @@ platforms: web: dependencies: - amplify_core: ">=2.5.0 <2.6.0" + amplify_core: ">=2.4.1 <2.5.0" amplify_secure_storage: ">=0.5.7 <0.6.0" aws_common: ">=0.7.3 <0.8.0" collection: ^1.15.0 diff --git a/packages/amplify_core/CHANGELOG.md b/packages/amplify_core/CHANGELOG.md index de61e1a736..57b663a848 100644 --- a/packages/amplify_core/CHANGELOG.md +++ b/packages/amplify_core/CHANGELOG.md @@ -1,8 +1,3 @@ -## 2.5.0 - -### Features -- feat(auth, authenticator): Add support for Email OTP MFA ([#5449](https://github.com/aws-amplify/amplify-flutter/pull/5449)) (#5472) - ## 2.4.2 ### Features diff --git a/packages/amplify_core/doc/lib/auth.dart b/packages/amplify_core/doc/lib/auth.dart index d4f33ab4c7..6e48014a9b 100644 --- a/packages/amplify_core/doc/lib/auth.dart +++ b/packages/amplify_core/doc/lib/auth.dart @@ -104,38 +104,22 @@ Future resendSignUpCode(String username) async { } // #enddocregion resend-signup-code -// #docregion handle-signin, handle-confirm-signin-sms, handle-confirm-signin-new-password, handle-confirm-signin-custom-challenge, handle-confirm-signin-reset-password, handle-confirm-signin-confirm-signup, handle-confirm-signin-done, handle-confirm-signin-mfa-selection, handle-confirm-signin-totp-setup, handle-confirm-signin-totp-code, handle-confirm-signin-email-code, handle-confirm-signin-mfa-setup-selection, handle-confirm-signin-email-setup +// #docregion handle-signin, handle-confirm-signin-sms, handle-confirm-signin-new-password, handle-confirm-signin-custom-challenge, handle-confirm-signin-reset-password, handle-confirm-signin-confirm-signup, handle-confirm-signin-done, handle-confirm-signin-mfa-selection, handle-confirm-signin-totp-setup, handle-confirm-signin-totp-code Future _handleSignInResult(SignInResult result) async { switch (result.nextStep.signInStep) { - // #enddocregion handle-signin, handle-confirm-signin-sms, handle-confirm-signin-new-password, handle-confirm-signin-custom-challenge, handle-confirm-signin-reset-password, handle-confirm-signin-confirm-signup, handle-confirm-signin-done, handle-confirm-signin-mfa-selection, handle-confirm-signin-totp-setup, handle-confirm-signin-totp-code, handle-confirm-signin-email-code, handle-confirm-signin-mfa-setup-selection, handle-confirm-signin-email-setup + // #enddocregion handle-signin, handle-confirm-signin-sms, handle-confirm-signin-new-password, handle-confirm-signin-custom-challenge, handle-confirm-signin-reset-password, handle-confirm-signin-confirm-signup, handle-confirm-signin-done, handle-confirm-signin-mfa-selection, handle-confirm-signin-totp-setup, handle-confirm-signin-totp-code // #docregion handle-confirm-signin-mfa-selection case AuthSignInStep.continueSignInWithMfaSelection: final allowedMfaTypes = result.nextStep.allowedMfaTypes!; final selection = await _promptUserPreference(allowedMfaTypes); return _handleMfaSelection(selection); // #enddocregion handle-confirm-signin-mfa-selection - // #docregion handle-confirm-signin-mfa-setup-selection - case AuthSignInStep.continueSignInWithMfaSetupSelection: - final allowedMfaTypes = result.nextStep.allowedMfaTypes!; - if (allowedMfaTypes.length == 1) { - return _handleMfaSelection(allowedMfaTypes.first); - } - final selection = await _promptUserPreference(allowedMfaTypes); - safePrint('Selected MFA type: $selection'); - return _handleMfaSelection(selection); - // #enddocregion handle-confirm-signin-mfa-setup-selection // #docregion handle-confirm-signin-totp-setup case AuthSignInStep.continueSignInWithTotpSetup: final totpSetupDetails = result.nextStep.totpSetupDetails!; final setupUri = totpSetupDetails.getSetupUri(appName: 'MyApp'); safePrint('Open URI to complete setup: $setupUri'); // #enddocregion handle-confirm-signin-totp-setup - // #docregion handle-confirm-signin-email-setup - case AuthSignInStep.continueSignInWithEmailMfaSetup: - safePrint( - 'Enter the email address you want to use for two-factor authentication', - ); - // #enddocregion handle-confirm-signin-email-setup // #docregion handle-confirm-signin-totp-code case AuthSignInStep.confirmSignInWithTotpMfaCode: safePrint('Enter a one-time code from your registered Authenticator app'); @@ -145,11 +129,6 @@ Future _handleSignInResult(SignInResult result) async { final codeDeliveryDetails = result.nextStep.codeDeliveryDetails!; _handleCodeDelivery(codeDeliveryDetails); // #enddocregion handle-confirm-signin-sms - // #docregion handle-confirm-signin-email - case AuthSignInStep.confirmSignInWithOtpCode: - final codeDeliveryDetails = result.nextStep.codeDeliveryDetails!; - _handleCodeDelivery(codeDeliveryDetails); - // #enddocregion handle-confirm-signin-email // #docregion handle-confirm-signin-new-password case AuthSignInStep.confirmSignInWithNewPassword: safePrint('Enter a new password to continue signing in'); @@ -179,10 +158,10 @@ Future _handleSignInResult(SignInResult result) async { case AuthSignInStep.done: safePrint('Sign in is complete'); // #enddocregion handle-confirm-signin-done - // #docregion handle-signin, handle-confirm-signin-sms, handle-confirm-signin-new-password, handle-confirm-signin-custom-challenge, handle-confirm-signin-reset-password, handle-confirm-signin-confirm-signup, handle-confirm-signin-done, handle-confirm-signin-mfa-selection, handle-confirm-signin-totp-setup, handle-confirm-signin-totp-code, handle-confirm-signin-email-code, handle-confirm-signin-mfa-setup-selection, handle-confirm-signin-email-setup + // #docregion handle-signin, handle-confirm-signin-sms, handle-confirm-signin-new-password, handle-confirm-signin-custom-challenge, handle-confirm-signin-reset-password, handle-confirm-signin-confirm-signup, handle-confirm-signin-done, handle-confirm-signin-mfa-selection, handle-confirm-signin-totp-setup, handle-confirm-signin-totp-code } } -// #enddocregion handle-signin, handle-confirm-signin-sms, handle-confirm-signin-new-password, handle-confirm-signin-custom-challenge, handle-confirm-signin-reset-password, handle-confirm-signin-confirm-signup, handle-confirm-signin-done, handle-confirm-signin-mfa-selection, handle-confirm-signin-totp-setup, handle-confirm-signin-totp-code, handle-confirm-signin-email-code, handle-confirm-signin-mfa-setup-selection, handle-confirm-signin-email-setup +// #enddocregion handle-signin, handle-confirm-signin-sms, handle-confirm-signin-new-password, handle-confirm-signin-custom-challenge, handle-confirm-signin-reset-password, handle-confirm-signin-confirm-signup, handle-confirm-signin-done, handle-confirm-signin-mfa-selection, handle-confirm-signin-totp-setup, handle-confirm-signin-totp-code // #docregion signin Future signInUser(String username, String password) async { diff --git a/packages/amplify_core/lib/src/config/amplify_outputs/auth/auth_outputs.g.dart b/packages/amplify_core/lib/src/config/amplify_outputs/auth/auth_outputs.g.dart index 9c9639f654..f278972143 100644 --- a/packages/amplify_core/lib/src/config/amplify_outputs/auth/auth_outputs.g.dart +++ b/packages/amplify_core/lib/src/config/amplify_outputs/auth/auth_outputs.g.dart @@ -128,5 +128,4 @@ const _$MfaEnforcementEnumMap = { const _$MfaMethodEnumMap = { MfaMethod.sms: 'SMS', MfaMethod.totp: 'TOTP', - MfaMethod.email: 'EMAIL', }; diff --git a/packages/amplify_core/lib/src/config/amplify_outputs/auth/mfa.dart b/packages/amplify_core/lib/src/config/amplify_outputs/auth/mfa.dart index 92fee3d781..e82d3327d7 100644 --- a/packages/amplify_core/lib/src/config/amplify_outputs/auth/mfa.dart +++ b/packages/amplify_core/lib/src/config/amplify_outputs/auth/mfa.dart @@ -11,10 +11,7 @@ enum MfaMethod { sms, @JsonValue('TOTP') - totp, - - @JsonValue('EMAIL') - email; + totp; /// The value to pass to `Amplify.Auth.confirmSignIn` when /// selecting an MFA type. diff --git a/packages/amplify_core/lib/src/config/auth/cognito/auth.g.dart b/packages/amplify_core/lib/src/config/auth/cognito/auth.g.dart index 6bbb532080..51926ead53 100644 --- a/packages/amplify_core/lib/src/config/auth/cognito/auth.g.dart +++ b/packages/amplify_core/lib/src/config/auth/cognito/auth.g.dart @@ -119,5 +119,4 @@ const _$MfaConfigurationEnumMap = { const _$MfaTypeEnumMap = { MfaType.sms: 'SMS', MfaType.totp: 'TOTP', - MfaType.email: 'EMAIL', }; diff --git a/packages/amplify_core/lib/src/config/auth/cognito/mfa.dart b/packages/amplify_core/lib/src/config/auth/cognito/mfa.dart index 292c5e184f..6d33bd00b3 100644 --- a/packages/amplify_core/lib/src/config/auth/cognito/mfa.dart +++ b/packages/amplify_core/lib/src/config/auth/cognito/mfa.dart @@ -9,10 +9,7 @@ enum MfaType { sms, @JsonValue('TOTP') - totp, - - @JsonValue('EMAIL') - email; + totp; /// The value to pass to `Amplify.Auth.confirmSignIn` when /// selecting an MFA type. @@ -24,7 +21,6 @@ extension ToMfaMethod on MfaType { return switch (this) { MfaType.sms => MfaMethod.sms, MfaType.totp => MfaMethod.totp, - MfaType.email => MfaMethod.email, }; } } diff --git a/packages/amplify_core/lib/src/types/auth/sign_in/auth_next_sign_in_step.g.dart b/packages/amplify_core/lib/src/types/auth/sign_in/auth_next_sign_in_step.g.dart index 6d480f1414..46d7e2de61 100644 --- a/packages/amplify_core/lib/src/types/auth/sign_in/auth_next_sign_in_step.g.dart +++ b/packages/amplify_core/lib/src/types/auth/sign_in/auth_next_sign_in_step.g.dart @@ -75,14 +75,9 @@ Map _$AuthNextSignInStepToJson(AuthNextSignInStep instance) { const _$AuthSignInStepEnumMap = { AuthSignInStep.continueSignInWithMfaSelection: 'continueSignInWithMfaSelection', - AuthSignInStep.continueSignInWithMfaSetupSelection: - 'continueSignInWithMfaSetupSelection', AuthSignInStep.continueSignInWithTotpSetup: 'continueSignInWithTotpSetup', - AuthSignInStep.continueSignInWithEmailMfaSetup: - 'continueSignInWithEmailMfaSetup', AuthSignInStep.confirmSignInWithSmsMfaCode: 'confirmSignInWithSmsMfaCode', AuthSignInStep.confirmSignInWithTotpMfaCode: 'confirmSignInWithTotpMfaCode', - AuthSignInStep.confirmSignInWithOtpCode: 'confirmSignInWithOtpCode', AuthSignInStep.confirmSignInWithNewPassword: 'confirmSignInWithNewPassword', AuthSignInStep.confirmSignInWithCustomChallenge: 'confirmSignInWithCustomChallenge', @@ -94,5 +89,4 @@ const _$AuthSignInStepEnumMap = { const _$MfaTypeEnumMap = { MfaType.sms: 'SMS', MfaType.totp: 'TOTP', - MfaType.email: 'EMAIL', }; diff --git a/packages/amplify_core/lib/src/types/auth/sign_in/auth_sign_in_step.dart b/packages/amplify_core/lib/src/types/auth/sign_in/auth_sign_in_step.dart index e63cb3a58f..7474f4be5e 100644 --- a/packages/amplify_core/lib/src/types/auth/sign_in/auth_sign_in_step.dart +++ b/packages/amplify_core/lib/src/types/auth/sign_in/auth_sign_in_step.dart @@ -10,17 +10,10 @@ enum AuthSignInStep { /// an MFA method. continueSignInWithMfaSelection, - /// The sign-in is not complete and the user must select an MFA method to setup. - continueSignInWithMfaSetupSelection, - /// The sign-in is not complete and a TOTP authenticator app must be /// registered before continuing. continueSignInWithTotpSetup, - /// The sign-in is not complete and an Email MFA must be set up before - /// continuing. - continueSignInWithEmailMfaSetup, - /// The sign-in is not complete and must be confirmed with an SMS code. confirmSignInWithSmsMfaCode, @@ -28,9 +21,6 @@ enum AuthSignInStep { /// from a registered authenticator app. confirmSignInWithTotpMfaCode, - /// The sign-in is not complete and must be confirmed with an email code. - confirmSignInWithOtpCode, - /// The sign-in is not complete and must be confirmed with the user's new /// password. confirmSignInWithNewPassword, diff --git a/packages/amplify_core/lib/src/version.dart b/packages/amplify_core/lib/src/version.dart index 63fd551c60..b4cefe9232 100644 --- a/packages/amplify_core/lib/src/version.dart +++ b/packages/amplify_core/lib/src/version.dart @@ -1,2 +1,2 @@ // Generated code. Do not modify. -const packageVersion = '2.5.0'; +const packageVersion = '2.4.2'; diff --git a/packages/amplify_core/pubspec.yaml b/packages/amplify_core/pubspec.yaml index 66e8e537c6..7de06f6b02 100644 --- a/packages/amplify_core/pubspec.yaml +++ b/packages/amplify_core/pubspec.yaml @@ -1,6 +1,6 @@ name: amplify_core description: The base package containing common types and utilities that are shared across the Amplify Flutter packages. -version: 2.5.0 +version: 2.4.2 homepage: https://docs.amplify.aws/lib/q/platform/flutter/ repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/amplify_core issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues diff --git a/packages/amplify_datastore/CHANGELOG.md b/packages/amplify_datastore/CHANGELOG.md index 6d260c1adf..4194b55191 100644 --- a/packages/amplify_datastore/CHANGELOG.md +++ b/packages/amplify_datastore/CHANGELOG.md @@ -1,7 +1,3 @@ -## 2.5.0 - -- Minor bug fixes and improvements - ## 2.4.2 - Minor bug fixes and improvements diff --git a/packages/amplify_datastore/pubspec.yaml b/packages/amplify_datastore/pubspec.yaml index 9664299fd5..39fdc3fabe 100644 --- a/packages/amplify_datastore/pubspec.yaml +++ b/packages/amplify_datastore/pubspec.yaml @@ -1,6 +1,6 @@ name: amplify_datastore description: The Amplify Flutter DataStore category plugin, providing a queryable, on-device data store. -version: 2.5.0 +version: 2.4.2 homepage: https://docs.amplify.aws/lib/q/platform/flutter/ repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/amplify_datastore issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues @@ -12,8 +12,8 @@ environment: dependencies: flutter: sdk: flutter - amplify_datastore_plugin_interface: ">=2.5.0 <2.6.0" - amplify_core: ">=2.5.0 <2.6.0" + amplify_datastore_plugin_interface: ">=2.4.1 <2.5.0" + amplify_core: ">=2.4.2 <2.5.0" plugin_platform_interface: ^2.0.0 meta: ^1.7.0 collection: ^1.14.13 diff --git a/packages/amplify_datastore_plugin_interface/CHANGELOG.md b/packages/amplify_datastore_plugin_interface/CHANGELOG.md index 0a11b5216c..6bc7b74456 100644 --- a/packages/amplify_datastore_plugin_interface/CHANGELOG.md +++ b/packages/amplify_datastore_plugin_interface/CHANGELOG.md @@ -1,7 +1,3 @@ -## 2.5.0 - -- Minor bug fixes and improvements - ## 2.4.1 - Minor bug fixes and improvements diff --git a/packages/amplify_datastore_plugin_interface/pubspec.yaml b/packages/amplify_datastore_plugin_interface/pubspec.yaml index dfceee6803..f22b2e9c88 100644 --- a/packages/amplify_datastore_plugin_interface/pubspec.yaml +++ b/packages/amplify_datastore_plugin_interface/pubspec.yaml @@ -1,6 +1,6 @@ name: amplify_datastore_plugin_interface description: The platform interface for the DataStore module of Amplify Flutter. -version: 2.5.0 +version: 2.4.1 homepage: https://docs.amplify.aws/lib/q/platform/flutter/ repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/amplify_datastore_plugin_interface issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues @@ -10,7 +10,7 @@ environment: flutter: ">=3.19.0" dependencies: - amplify_core: ">=2.5.0 <2.6.0" + amplify_core: ">=2.4.1 <2.5.0" collection: ^1.15.0 flutter: sdk: flutter diff --git a/packages/analytics/amplify_analytics_pinpoint/CHANGELOG.md b/packages/analytics/amplify_analytics_pinpoint/CHANGELOG.md index 25bca8683a..99c85f3d8d 100644 --- a/packages/analytics/amplify_analytics_pinpoint/CHANGELOG.md +++ b/packages/analytics/amplify_analytics_pinpoint/CHANGELOG.md @@ -1,7 +1,3 @@ -## 2.5.0 - -- Minor bug fixes and improvements - ## 2.4.1 - Minor bug fixes and improvements diff --git a/packages/analytics/amplify_analytics_pinpoint/pubspec.yaml b/packages/analytics/amplify_analytics_pinpoint/pubspec.yaml index cfd338508a..38d1e66209 100644 --- a/packages/analytics/amplify_analytics_pinpoint/pubspec.yaml +++ b/packages/analytics/amplify_analytics_pinpoint/pubspec.yaml @@ -1,6 +1,6 @@ name: amplify_analytics_pinpoint description: The Amplify Flutter Analytics category plugin using the AWS Pinpoint provider. -version: 2.5.0 +version: 2.4.1 homepage: https://docs.amplify.aws/lib/q/platform/flutter/ repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/analytics/amplify_analytics_pinpoint issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues @@ -19,9 +19,9 @@ platforms: web: dependencies: - amplify_analytics_pinpoint_dart: ">=0.4.6 <0.5.0" - amplify_core: ">=2.5.0 <2.6.0" - amplify_db_common: ">=0.4.6 <0.5.0" + amplify_analytics_pinpoint_dart: ">=0.4.5 <0.5.0" + amplify_core: ">=2.4.1 <2.5.0" + amplify_db_common: ">=0.4.5 <0.5.0" amplify_secure_storage: ">=0.5.7 <0.6.0" aws_common: ">=0.7.3 <0.8.0" device_info_plus: ^10.0.1 diff --git a/packages/analytics/amplify_analytics_pinpoint_dart/CHANGELOG.md b/packages/analytics/amplify_analytics_pinpoint_dart/CHANGELOG.md index 229ad89a6c..443707bbe2 100644 --- a/packages/analytics/amplify_analytics_pinpoint_dart/CHANGELOG.md +++ b/packages/analytics/amplify_analytics_pinpoint_dart/CHANGELOG.md @@ -1,7 +1,3 @@ -## 0.4.6 - -- Minor bug fixes and improvements - ## 0.4.5 - Minor bug fixes and improvements diff --git a/packages/analytics/amplify_analytics_pinpoint_dart/pubspec.yaml b/packages/analytics/amplify_analytics_pinpoint_dart/pubspec.yaml index 94a5792d65..0e15a70300 100644 --- a/packages/analytics/amplify_analytics_pinpoint_dart/pubspec.yaml +++ b/packages/analytics/amplify_analytics_pinpoint_dart/pubspec.yaml @@ -1,6 +1,6 @@ name: amplify_analytics_pinpoint_dart description: A Dart-only implementation of the Amplify Analytics plugin for Pinpoint. -version: 0.4.6 +version: 0.4.5 homepage: https://docs.amplify.aws/lib/q/platform/flutter/ repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/analytics/amplify_analytics_pinpoint_dart issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues @@ -9,8 +9,8 @@ environment: sdk: ^3.3.0 dependencies: - amplify_core: ">=2.5.0 <2.6.0" - amplify_db_common_dart: ">=0.4.7 <0.5.0" + amplify_core: ">=2.4.1 <2.5.0" + amplify_db_common_dart: ">=0.4.6 <0.5.0" amplify_secure_storage_dart: ">=0.5.3 <0.6.0" aws_common: ">=0.7.3 <0.8.0" aws_signature_v4: ">=0.6.3 <0.7.0" diff --git a/packages/api/amplify_api/CHANGELOG.md b/packages/api/amplify_api/CHANGELOG.md index 02d776882e..bec52dc75b 100644 --- a/packages/api/amplify_api/CHANGELOG.md +++ b/packages/api/amplify_api/CHANGELOG.md @@ -1,7 +1,3 @@ -## 2.5.0 - -- Minor bug fixes and improvements - ## 2.4.2 ### Fixes diff --git a/packages/api/amplify_api/pubspec.yaml b/packages/api/amplify_api/pubspec.yaml index 2125cf6a54..d401c15680 100644 --- a/packages/api/amplify_api/pubspec.yaml +++ b/packages/api/amplify_api/pubspec.yaml @@ -1,6 +1,6 @@ name: amplify_api description: The Amplify Flutter API category plugin, supporting GraphQL and REST operations. -version: 2.5.0 +version: 2.4.2 homepage: https://docs.amplify.aws/lib/q/platform/flutter/ repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/api/amplify_api issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues @@ -19,9 +19,9 @@ platforms: web: dependencies: - amplify_api_dart: ">=0.5.7 <0.6.0" - amplify_core: ">=2.5.0 <2.6.0" - amplify_flutter: ">=2.5.0 <2.6.0" + amplify_api_dart: ">=0.5.6 <0.6.0" + amplify_core: ">=2.4.2 <2.5.0" + amplify_flutter: ">=2.4.1 <2.5.0" connectivity_plus: ^6.0.1 flutter: sdk: flutter diff --git a/packages/api/amplify_api_dart/CHANGELOG.md b/packages/api/amplify_api_dart/CHANGELOG.md index 1d073337b5..4d8fd7e87f 100644 --- a/packages/api/amplify_api_dart/CHANGELOG.md +++ b/packages/api/amplify_api_dart/CHANGELOG.md @@ -1,7 +1,3 @@ -## 0.5.7 - -- Minor bug fixes and improvements - ## 0.5.6 ### Features diff --git a/packages/api/amplify_api_dart/pubspec.yaml b/packages/api/amplify_api_dart/pubspec.yaml index 43ff663a6b..7d7b3110c9 100644 --- a/packages/api/amplify_api_dart/pubspec.yaml +++ b/packages/api/amplify_api_dart/pubspec.yaml @@ -1,6 +1,6 @@ name: amplify_api_dart description: The Amplify API category plugin in Dart-only, supporting GraphQL and REST operations. -version: 0.5.7 +version: 0.5.6 homepage: https://docs.amplify.aws/lib/q/platform/flutter/ repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/api/amplify_api_dart issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues @@ -9,7 +9,7 @@ environment: sdk: ^3.3.0 dependencies: - amplify_core: ">=2.5.0 <2.6.0" + amplify_core: ">=2.4.2 <2.5.0" async: ^2.10.0 aws_common: ">=0.7.4 <0.8.0" collection: ^1.15.0 diff --git a/packages/auth/amplify_auth_cognito/CHANGELOG.md b/packages/auth/amplify_auth_cognito/CHANGELOG.md index ecdb34bd2a..c548a18633 100644 --- a/packages/auth/amplify_auth_cognito/CHANGELOG.md +++ b/packages/auth/amplify_auth_cognito/CHANGELOG.md @@ -1,8 +1,3 @@ -## 2.5.0 - -### Features -- feat(auth, authenticator): Add support for Email OTP MFA ([#5449](https://github.com/aws-amplify/amplify-flutter/pull/5449)) (#5472) - ## 2.4.2 - Minor bug fixes and improvements diff --git a/packages/auth/amplify_auth_cognito/example/integration_test/main_test.dart b/packages/auth/amplify_auth_cognito/example/integration_test/main_test.dart index 4c2bcec0ba..192d73db19 100644 --- a/packages/auth/amplify_auth_cognito/example/integration_test/main_test.dart +++ b/packages/auth/amplify_auth_cognito/example/integration_test/main_test.dart @@ -15,19 +15,11 @@ import 'fetch_auth_session_test.dart' as fetch_auth_session_tests; import 'get_current_user_test.dart' as get_current_user_tests; import 'hosted_ui_webview_test.dart' as hosted_ui_webview_tests; import 'hub_events_test.dart' as hub_events_tests; -import 'mfa_email_optional_test.dart' as mfa_email_optional_tests; -import 'mfa_email_required_test.dart' as mfa_email_required_tests; -import 'mfa_email_totp_optional_test.dart' as mfa_email_totp_optional_tests; -import 'mfa_email_totp_required_test.dart' as mfa_email_totp_required_tests; -import 'mfa_sms_email_optional_test.dart' as mfa_sms_email_optional_tests; -import 'mfa_sms_email_required_test.dart' as mfa_sms_email_required_tests; import 'mfa_sms_test.dart' as mfa_sms_tests; import 'mfa_sms_totp_optional_test.dart' as mfa_sms_totp_optional_tests; import 'mfa_sms_totp_required_test.dart' as mfa_sms_totp_required_tests; import 'mfa_totp_optional_test.dart' as mfa_totp_optional_tests; import 'mfa_totp_required_test.dart' as mfa_totp_required_tests; -import 'mfa_username_login_required_test.dart' - as mfa_username_login_required_tests; import 'native_auth_bridge_test.dart' as native_auth_bridge_tests; import 'reset_password_test.dart' as reset_password_tests; import 'security_test.dart' as security_tests; @@ -44,18 +36,6 @@ void main() async { group('amplify_auth_cognito', () { asf_tests.main(); - mfa_username_login_required_tests.main(); - mfa_sms_tests.main(); - mfa_sms_totp_optional_tests.main(); - mfa_sms_totp_required_tests.main(); - mfa_totp_optional_tests.main(); - mfa_totp_required_tests.main(); - mfa_email_optional_tests.main(); - mfa_email_required_tests.main(); - mfa_sms_email_optional_tests.main(); - mfa_sms_email_required_tests.main(); - mfa_email_totp_optional_tests.main(); - mfa_email_totp_required_tests.main(); confirm_sign_in_tests.main(); confirm_sign_up_tests.main(); custom_auth_tests.main(); @@ -67,6 +47,11 @@ void main() async { get_current_user_tests.main(); hosted_ui_webview_tests.main(); hub_events_tests.main(); + mfa_sms_tests.main(); + mfa_sms_totp_optional_tests.main(); + mfa_sms_totp_required_tests.main(); + mfa_totp_optional_tests.main(); + mfa_totp_required_tests.main(); native_auth_bridge_tests.main(); reset_password_tests.main(); security_tests.main(); diff --git a/packages/auth/amplify_auth_cognito/example/integration_test/mfa_email_optional_test.dart b/packages/auth/amplify_auth_cognito/example/integration_test/mfa_email_optional_test.dart deleted file mode 100644 index 0fed40593b..0000000000 --- a/packages/auth/amplify_auth_cognito/example/integration_test/mfa_email_optional_test.dart +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -import 'package:amplify_auth_integration_test/amplify_auth_integration_test.dart'; -import 'package:amplify_flutter/amplify_flutter.dart'; -import 'package:amplify_integration_test/amplify_integration_test.dart'; -import 'package:checks/checks.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'test_runner.dart'; - -void main() { - testRunner.setupTests(); - - group('MFA (Email)', () { - testRunner.withEnvironment(mfaOptionalEmail, (env) { - asyncTest('can sign in with Email MFA', (_) async { - final username = env.generateUsername(); - final password = generatePassword(); - - await adminCreateUser( - username, - password, - autoConfirm: true, - verifyAttributes: true, - attributes: { - AuthUserAttributeKey.email: username, - }, - ); - - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check( - signInRes.nextStep.signInStep, - because: 'MFA is optional', - ).equals(AuthSignInStep.done); - - await cognitoPlugin.updateMfaPreference( - email: MfaPreference.preferred, - ); - - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.email}, - preferred: MfaType.email, - ), - ); - - Future signInWithEmail() async { - await signOutUser(assertComplete: true); - - final otpResult = await getOtpCode( - env.getLoginAttribute(username), - ); - - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check(signInRes.nextStep.signInStep) - .equals(AuthSignInStep.confirmSignInWithOtpCode); - check(signInRes.nextStep.codeDeliveryDetails) - .isNotNull() - .has((d) => d.deliveryMedium, 'deliveryMedium') - .equals(DeliveryMedium.email); - final mfaSetupRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await otpResult.code, - ); - check(mfaSetupRes.nextStep.signInStep).equals(AuthSignInStep.done); - } - - await signInWithEmail(); - await signInWithEmail(); - }); - }); - }); -} diff --git a/packages/auth/amplify_auth_cognito/example/integration_test/mfa_email_required_test.dart b/packages/auth/amplify_auth_cognito/example/integration_test/mfa_email_required_test.dart deleted file mode 100644 index 5cd4809ad6..0000000000 --- a/packages/auth/amplify_auth_cognito/example/integration_test/mfa_email_required_test.dart +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -import 'package:amplify_auth_integration_test/amplify_auth_integration_test.dart'; -import 'package:amplify_flutter/amplify_flutter.dart'; -import 'package:amplify_integration_test/amplify_integration_test.dart'; -import 'package:checks/checks.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'test_runner.dart'; - -void main() { - testRunner.setupTests(); - - group('MFA (Email)', () { - testRunner.withEnvironment(mfaRequiredEmail, (env) { - asyncTest('can sign in with Email MFA', (_) async { - final username = env.generateUsername(); - final password = generatePassword(); - - final otpResult = await getOtpCode( - env.getLoginAttribute(username), - ); - - await adminCreateUser( - username, - password, - autoConfirm: true, - verifyAttributes: true, - attributes: { - AuthUserAttributeKey.email: username, - }, - ); - - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check(signInRes.nextStep.signInStep) - .equals(AuthSignInStep.confirmSignInWithOtpCode); - - final confirmRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await otpResult.code, - ); - check(confirmRes.nextStep.signInStep).equals(AuthSignInStep.done); - - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.email}, - preferred: MfaType.email, - ), - ); - - Future signInWithEmail() async { - await signOutUser(assertComplete: true); - - final otpResult = await getOtpCode( - env.getLoginAttribute(username), - ); - - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check(signInRes.nextStep.signInStep) - .equals(AuthSignInStep.confirmSignInWithOtpCode); - check(signInRes.nextStep.codeDeliveryDetails) - .isNotNull() - .has((d) => d.deliveryMedium, 'deliveryMedium') - .equals(DeliveryMedium.email); - final mfaSetupRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await otpResult.code, - ); - check(mfaSetupRes.nextStep.signInStep).equals(AuthSignInStep.done); - } - - await signInWithEmail(); - await signInWithEmail(); - }); - }); - }); -} diff --git a/packages/auth/amplify_auth_cognito/example/integration_test/mfa_email_totp_optional_test.dart b/packages/auth/amplify_auth_cognito/example/integration_test/mfa_email_totp_optional_test.dart deleted file mode 100644 index 16a9987e1c..0000000000 --- a/packages/auth/amplify_auth_cognito/example/integration_test/mfa_email_totp_optional_test.dart +++ /dev/null @@ -1,490 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -import 'package:amplify_auth_integration_test/amplify_auth_integration_test.dart'; -import 'package:amplify_flutter/amplify_flutter.dart'; -import 'package:amplify_integration_test/amplify_integration_test.dart'; -import 'package:checks/checks.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'test_runner.dart'; - -void main() { - testRunner.setupTests(); - - group('MFA (EMAIL + TOTP)', () { - testRunner.withEnvironment(mfaOptionalEmailTotp, (env) { - asyncTest('can set up TOTP MFA', (_) async { - final username = env.generateUsername(); - final password = generatePassword(); - - // Create user with no phone number. - await adminCreateUser( - username, - password, - autoConfirm: true, - autoFillAttributes: false, - attributes: { - AuthUserAttributeKey.email: username, - }, - ); - - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check( - because: 'MFA is optional', - signInRes.nextStep.signInStep, - ).equals(AuthSignInStep.done); - - check(await cognitoPlugin.fetchMfaPreference()) - .equals(const UserMfaPreference()); - - await setUpTotp(); - - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.totp}, - preferred: MfaType.totp, - ), - ); - - Future signInWithTotp() async { - await signOutUser(assertComplete: true); - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check( - signInRes.nextStep.signInStep, - because: 'Once TOTP MFA is preferred, it is performed ' - 'on every sign-in attempt.', - ).equals(AuthSignInStep.confirmSignInWithTotpMfaCode); - check(signInRes.nextStep.codeDeliveryDetails).isNotNull() - ..has((d) => d.deliveryMedium, 'deliveryMedium') - .equals(DeliveryMedium.totp) - ..has((d) => d.destination, 'destination') - .equals(friendlyDeviceName); - - final confirmRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await generateTotpCode(), - ); - check(confirmRes.nextStep.signInStep).equals(AuthSignInStep.done); - } - - await signInWithTotp(); - await signInWithTotp(); - - await check( - because: 'TOTP can be disabled when optional', - cognitoPlugin.updateMfaPreference(totp: MfaPreference.disabled), - ).completes(); - - check( - because: 'Disabling TOTP should mark it as not preferred', - await cognitoPlugin.fetchMfaPreference(), - ).equals( - const UserMfaPreference(enabled: {}, preferred: null), - ); - }); - - asyncTest('can select TOTP MFA', (_) async { - final username = env.generateUsername(); - final password = generatePassword(); - - // Create a user with an unverified phone number. - await adminCreateUser( - username, - password, - autoConfirm: true, - verifyAttributes: false, - attributes: { - AuthUserAttributeKey.email: username, - }, - ); - - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check( - signInRes.nextStep.signInStep, - because: 'MFA is optional', - ).equals(AuthSignInStep.done); - - check(await cognitoPlugin.fetchMfaPreference()) - .equals(const UserMfaPreference()); - - await setUpTotp(); - - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.totp}, - preferred: MfaType.totp, - ), - ); - - await cognitoPlugin.updateMfaPreference( - email: MfaPreference.enabled, - totp: MfaPreference.enabled, - ); - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.email, MfaType.totp}, - preferred: null, - ), - ); - - { - await signOutUser(assertComplete: true); - - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check(signInRes.nextStep.signInStep) - .equals(AuthSignInStep.continueSignInWithMfaSelection); - check(signInRes.nextStep.allowedMfaTypes) - .isNotNull() - .deepEquals({MfaType.email, MfaType.totp}); - - final selectRes = await Amplify.Auth.confirmSignIn( - confirmationValue: 'TOTP', - ); - check(selectRes.nextStep.signInStep) - .equals(AuthSignInStep.confirmSignInWithTotpMfaCode); - check(selectRes.nextStep.codeDeliveryDetails).isNotNull() - ..has((d) => d.deliveryMedium, 'deliveryMedium') - .equals(DeliveryMedium.totp) - ..has((d) => d.destination, 'destination') - .equals(friendlyDeviceName); - - final confirmRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await generateTotpCode(), - ); - check(confirmRes.nextStep.signInStep).equals(AuthSignInStep.done); - } - - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.email, MfaType.totp}, - preferred: null, - ), - ); - - // Verify we can set TOTP as preferred and forego selection. - - await cognitoPlugin.updateMfaPreference( - totp: MfaPreference.preferred, - ); - check( - await cognitoPlugin.fetchMfaPreference(), - because: 'TOTP should be marked preferred', - ).equals( - const UserMfaPreference( - enabled: {MfaType.email, MfaType.totp}, - preferred: MfaType.totp, - ), - ); - - { - await signOutUser(assertComplete: true); - - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check(signInRes.nextStep.signInStep) - .equals(AuthSignInStep.confirmSignInWithTotpMfaCode); - check(signInRes.nextStep.codeDeliveryDetails).isNotNull() - ..has((d) => d.deliveryMedium, 'deliveryMedium') - .equals(DeliveryMedium.totp) - ..has((d) => d.destination, 'destination') - .equals(friendlyDeviceName); - - final confirmRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await generateTotpCode(), - ); - check(confirmRes.nextStep.signInStep).equals(AuthSignInStep.done); - } - - // Verify we can switch to EMAIL as preferred. - - await cognitoPlugin.updateMfaPreference( - email: MfaPreference.preferred, - ); - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.email, MfaType.totp}, - preferred: MfaType.email, - ), - ); - - { - await signOutUser(assertComplete: true); - - final otpRes = await getOtpCode(env.getLoginAttribute(username)); - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check(signInRes.nextStep.signInStep) - .equals(AuthSignInStep.confirmSignInWithOtpCode); - check(signInRes.nextStep.codeDeliveryDetails) - .isNotNull() - .has((d) => d.deliveryMedium, 'deliveryMedium') - .equals(DeliveryMedium.email); - - final confirmRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await otpRes.code, - ); - check(confirmRes.nextStep.signInStep).equals(AuthSignInStep.done); - } - - // Verify marking enabled does not change preference. - await cognitoPlugin.updateMfaPreference( - email: MfaPreference.enabled, - totp: MfaPreference.enabled, - ); - check( - await cognitoPlugin.fetchMfaPreference(), - because: 'EMAIL should still be marked preferred', - ).equals( - const UserMfaPreference( - enabled: {MfaType.email, MfaType.totp}, - preferred: MfaType.email, - ), - ); - - // Verify we can mark neither as preferred - await cognitoPlugin.updateMfaPreference( - email: MfaPreference.notPreferred, - ); - check( - await cognitoPlugin.fetchMfaPreference(), - because: 'EMAIL should be marked not preferred', - ).equals( - const UserMfaPreference( - enabled: {MfaType.email, MfaType.totp}, - preferred: null, - ), - ); - - // Verify that we can disable both - await check( - because: 'MFA can be disabled when optional', - cognitoPlugin.updateMfaPreference( - email: MfaPreference.disabled, - totp: MfaPreference.disabled, - ), - ).completes(); - - check( - because: 'Disabling MFA should mark it as not preferred', - await cognitoPlugin.fetchMfaPreference(), - ).equals( - const UserMfaPreference(enabled: {}, preferred: null), - ); - }); - - asyncTest('can select EMAIL MFA', (_) async { - final username = env.generateUsername(); - final password = generatePassword(); - - // Create a user with an unverified phone number. - await adminCreateUser( - username, - password, - autoConfirm: true, - verifyAttributes: false, - attributes: { - AuthUserAttributeKey.email: username, - }, - ); - - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check( - signInRes.nextStep.signInStep, - because: 'MFA is optional', - ).equals(AuthSignInStep.done); - - check(await cognitoPlugin.fetchMfaPreference()) - .equals(const UserMfaPreference()); - - await setUpTotp(); - - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.totp}, - preferred: MfaType.totp, - ), - ); - - await cognitoPlugin.updateMfaPreference( - email: MfaPreference.enabled, - totp: MfaPreference.enabled, - ); - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.email, MfaType.totp}, - preferred: null, - ), - ); - - await signOutUser(assertComplete: true); - - final otpResult = await getOtpCode(UserAttribute.email(username)); - - final resignInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check(resignInRes.nextStep.signInStep) - .equals(AuthSignInStep.continueSignInWithMfaSelection); - check(resignInRes.nextStep.allowedMfaTypes) - .isNotNull() - .deepEquals({MfaType.email, MfaType.totp}); - - final selectRes = await Amplify.Auth.confirmSignIn( - confirmationValue: 'EMAIL', - ); - check(selectRes.nextStep.signInStep) - .equals(AuthSignInStep.confirmSignInWithOtpCode); - check(selectRes.nextStep.codeDeliveryDetails) - .isNotNull() - .has((d) => d.deliveryMedium, 'deliveryMedium') - .equals(DeliveryMedium.email); - - final confirmRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await otpResult.code, - ); - check(confirmRes.nextStep.signInStep).equals(AuthSignInStep.done); - - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.email, MfaType.totp}, - preferred: null, - ), - ); - - // Verify we can set EMAIL as preferred and forego selection. - - await cognitoPlugin.updateMfaPreference( - email: MfaPreference.preferred, - ); - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.email, MfaType.totp}, - preferred: MfaType.email, - ), - ); - - { - await signOutUser(assertComplete: true); - - final otpResult = await getOtpCode(UserAttribute.email(username)); - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check(signInRes.nextStep.signInStep) - .equals(AuthSignInStep.confirmSignInWithOtpCode); - check(signInRes.nextStep.codeDeliveryDetails) - .isNotNull() - .has((d) => d.deliveryMedium, 'deliveryMedium') - .equals(DeliveryMedium.email); - - final confirmRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await otpResult.code, - ); - check(confirmRes.nextStep.signInStep).equals(AuthSignInStep.done); - } - - // Verify we can switch to TOTP as preferred. - - await cognitoPlugin.updateMfaPreference( - totp: MfaPreference.preferred, - ); - check( - await cognitoPlugin.fetchMfaPreference(), - because: 'TOTP should be marked preferred', - ).equals( - const UserMfaPreference( - enabled: {MfaType.email, MfaType.totp}, - preferred: MfaType.totp, - ), - ); - - { - await signOutUser(assertComplete: true); - - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check(signInRes.nextStep.signInStep) - .equals(AuthSignInStep.confirmSignInWithTotpMfaCode); - check(signInRes.nextStep.codeDeliveryDetails).isNotNull() - ..has((d) => d.deliveryMedium, 'deliveryMedium') - .equals(DeliveryMedium.totp) - ..has((d) => d.destination, 'destination') - .equals(friendlyDeviceName); - - final confirmRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await generateTotpCode(), - ); - check(confirmRes.nextStep.signInStep).equals(AuthSignInStep.done); - } - - // Verify marking enabled does not change preference. - await cognitoPlugin.updateMfaPreference( - email: MfaPreference.enabled, - totp: MfaPreference.enabled, - ); - check( - await cognitoPlugin.fetchMfaPreference(), - because: 'TOTP should still be marked preferred', - ).equals( - const UserMfaPreference( - enabled: {MfaType.email, MfaType.totp}, - preferred: MfaType.totp, - ), - ); - - // Verify we can mark neither as preferred - await cognitoPlugin.updateMfaPreference( - totp: MfaPreference.notPreferred, - ); - check( - await cognitoPlugin.fetchMfaPreference(), - because: 'TOTP should be marked not preferred', - ).equals( - const UserMfaPreference( - enabled: {MfaType.email, MfaType.totp}, - preferred: null, - ), - ); - - // Verify that we can disable both - await check( - because: 'MFA can be disabled when optional', - cognitoPlugin.updateMfaPreference( - email: MfaPreference.disabled, - totp: MfaPreference.disabled, - ), - ).completes(); - - check( - because: 'Disabling MFA should mark it as not preferred', - await cognitoPlugin.fetchMfaPreference(), - ).equals( - const UserMfaPreference(enabled: {}, preferred: null), - ); - }); - }); - }); -} diff --git a/packages/auth/amplify_auth_cognito/example/integration_test/mfa_email_totp_required_test.dart b/packages/auth/amplify_auth_cognito/example/integration_test/mfa_email_totp_required_test.dart deleted file mode 100644 index b7f49da0e6..0000000000 --- a/packages/auth/amplify_auth_cognito/example/integration_test/mfa_email_totp_required_test.dart +++ /dev/null @@ -1,292 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -import 'package:amplify_auth_integration_test/amplify_auth_integration_test.dart'; -import 'package:amplify_flutter/amplify_flutter.dart'; -import 'package:amplify_integration_test/amplify_integration_test.dart'; -import 'package:checks/checks.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'test_runner.dart'; - -void main() { - testRunner.setupTests(); - - group('MFA (EMAIL + TOTP)', () { - testRunner.withEnvironment(mfaRequiredEmailTotp, (env) { - asyncTest('can set up EMAIL MFA', (_) async { - final username = env.generateUsername(); - final password = generatePassword(); - - final otpResult = await getOtpCode(UserAttribute.email(username)); - - // Create a user with no phone number. - await adminCreateUser( - username, - password, - autoConfirm: true, - autoFillAttributes: false, - verifyAttributes: false, - ); - - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check( - signInRes.nextStep.signInStep, - because: - 'When an email is registered and the userpool has email MFA enabled, Cognito will automatically enable email MFA as the preferred MFA method.', - ).equals(AuthSignInStep.confirmSignInWithOtpCode); - - final setupRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await otpResult.code, - ); - check(setupRes.nextStep.signInStep).equals(AuthSignInStep.done); - - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.email}, - preferred: MfaType.email, - ), - ); - - await signOutUser(assertComplete: true); - - final otpResult2 = await getOtpCode(UserAttribute.email(username)); - - final resignInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check(resignInRes.nextStep.signInStep) - .equals(AuthSignInStep.confirmSignInWithOtpCode); - check(resignInRes.nextStep.codeDeliveryDetails) - .isNotNull() - .has((d) => d.deliveryMedium, 'deliveryMedium') - .equals(DeliveryMedium.email); - - final confirmRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await otpResult2.code, - ); - check(confirmRes.nextStep.signInStep).equals(AuthSignInStep.done); - }); - - asyncTest('can select TOTP MFA', (_) async { - final username = env.generateUsername(); - final password = generatePassword(); - - final otpResult = await getOtpCode(UserAttribute.email(username)); - - // Create a user with an unverified phone number. - await adminCreateUser( - username, - password, - autoConfirm: true, - verifyAttributes: false, - attributes: { - AuthUserAttributeKey.email: username, - }, - ); - - { - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check( - signInRes.nextStep.signInStep, - because: - 'MFA is required so Cognito automatically enables EMAIL MFA', - ).equals(AuthSignInStep.confirmSignInWithOtpCode); - - final confirmRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await otpResult.code, - ); - check(confirmRes.nextStep.signInStep).equals(AuthSignInStep.done); - } - - check( - await cognitoPlugin.fetchMfaPreference(), - because: - 'MFA is required so Cognito automatically enables EMAIL MFA, this is expected behavior', - ).equals( - const UserMfaPreference( - enabled: {MfaType.email}, - preferred: MfaType.email, - ), - ); - - await setUpTotp(); - - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.email, MfaType.totp}, - preferred: null, - ), - ); - - await signOutUser(assertComplete: true); - - { - final resignInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check( - resignInRes.nextStep.signInStep, - because: 'Both EMAIL + TOTP are activated with no preference', - ).equals(AuthSignInStep.continueSignInWithMfaSelection); - check(resignInRes.nextStep.allowedMfaTypes) - .isNotNull() - .deepEquals({MfaType.email, MfaType.totp}); - - final selectRes = await Amplify.Auth.confirmSignIn( - confirmationValue: 'TOTP', - ); - check(selectRes.nextStep.signInStep) - .equals(AuthSignInStep.confirmSignInWithTotpMfaCode); - check(selectRes.nextStep.codeDeliveryDetails).isNotNull() - ..has((d) => d.deliveryMedium, 'deliveryMedium') - .equals(DeliveryMedium.totp) - ..has((d) => d.destination, 'destination') - .equals(friendlyDeviceName); - - final confirmRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await generateTotpCode(), - ); - check(confirmRes.nextStep.signInStep).equals(AuthSignInStep.done); - } - - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.email, MfaType.totp}, - preferred: null, - ), - ); - - // Verify we can set TOTP as preferred and forego selection. - - await cognitoPlugin.updateMfaPreference( - totp: MfaPreference.preferred, - ); - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.email, MfaType.totp}, - preferred: MfaType.totp, - ), - ); - - { - await signOutUser(assertComplete: true); - - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check( - signInRes.nextStep.signInStep, - because: 'Preference is TOTP MFA now', - ).equals(AuthSignInStep.confirmSignInWithTotpMfaCode); - check(signInRes.nextStep.codeDeliveryDetails).isNotNull() - ..has((d) => d.deliveryMedium, 'deliveryMedium') - .equals(DeliveryMedium.totp) - ..has((d) => d.destination, 'destination') - .equals(friendlyDeviceName); - - final confirmRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await generateTotpCode(), - ); - check(confirmRes.nextStep.signInStep).equals(AuthSignInStep.done); - } - - // Verify we can switch to EMAIL as preferred. - - await cognitoPlugin.updateMfaPreference( - email: MfaPreference.preferred, - ); - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.email, MfaType.totp}, - preferred: MfaType.email, - ), - ); - - { - await signOutUser(assertComplete: true); - - final otpResult = await getOtpCode(UserAttribute.email(username)); - - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check( - signInRes.nextStep.signInStep, - because: 'Preference is EMAIL MFA now', - ).equals(AuthSignInStep.confirmSignInWithOtpCode); - check(signInRes.nextStep.codeDeliveryDetails) - .isNotNull() - .has((d) => d.deliveryMedium, 'deliveryMedium') - .equals(DeliveryMedium.email); - - final confirmRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await otpResult.code, - ); - check(confirmRes.nextStep.signInStep).equals(AuthSignInStep.done); - } - - // Verify marking enabled does not change preference. - await cognitoPlugin.updateMfaPreference( - email: MfaPreference.enabled, - totp: MfaPreference.enabled, - ); - check( - await cognitoPlugin.fetchMfaPreference(), - because: 'EMAIL should still be marked preferred', - ).equals( - const UserMfaPreference( - enabled: {MfaType.email, MfaType.totp}, - preferred: MfaType.email, - ), - ); - - // Verify we can mark neither as preferred - await cognitoPlugin.updateMfaPreference( - email: MfaPreference.notPreferred, - ); - check( - await cognitoPlugin.fetchMfaPreference(), - because: 'EMAIL should be marked not preferred', - ).equals( - const UserMfaPreference( - enabled: {MfaType.email, MfaType.totp}, - preferred: null, - ), - ); - - // Verify that we can disable MFA - { - await check( - because: 'Interestingly, Cognito does not throw and allows ' - 'MFA to be disabled even when required.', - cognitoPlugin.updateMfaPreference( - email: MfaPreference.disabled, - totp: MfaPreference.disabled, - ), - ).completes(); - - check( - because: 'Disabling MFA should mark it as not preferred', - await cognitoPlugin.fetchMfaPreference(), - ).equals( - const UserMfaPreference( - enabled: {}, - preferred: null, - ), - ); - } - }); - }); - }); -} diff --git a/packages/auth/amplify_auth_cognito/example/integration_test/mfa_sms_email_optional_test.dart b/packages/auth/amplify_auth_cognito/example/integration_test/mfa_sms_email_optional_test.dart deleted file mode 100644 index 4be77b4f06..0000000000 --- a/packages/auth/amplify_auth_cognito/example/integration_test/mfa_sms_email_optional_test.dart +++ /dev/null @@ -1,434 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -import 'package:amplify_auth_integration_test/amplify_auth_integration_test.dart'; -import 'package:amplify_flutter/amplify_flutter.dart'; -import 'package:amplify_integration_test/amplify_integration_test.dart'; -import 'package:checks/checks.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'test_runner.dart'; - -void main() { - testRunner.setupTests(); - - group('MFA (SMS + EMAIL)', () { - testRunner.withEnvironment(mfaOptionalEmailSms, (env) { - asyncTest('can set up EMAIL MFA', (_) async { - final username = env.generateUsername(); - final password = generatePassword(); - - // Create user with no phone number. - await adminCreateUser( - username, - password, - autoConfirm: true, - autoFillAttributes: false, - ); - - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check( - because: 'MFA is optional', - signInRes.nextStep.signInStep, - ).equals(AuthSignInStep.done); - - check(await cognitoPlugin.fetchMfaPreference()) - .equals(const UserMfaPreference()); - - await cognitoPlugin.updateMfaPreference( - email: MfaPreference.preferred, - ); - - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.email}, - preferred: MfaType.email, - ), - ); - - Future signInWithEmail() async { - await signOutUser(assertComplete: true); - - final otpResult = await getOtpCode( - env.getLoginAttribute(username), - ); - - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check( - signInRes.nextStep.signInStep, - because: 'Once Email MFA is preferred, it is performed ' - 'on every sign-in attempt.', - ).equals(AuthSignInStep.confirmSignInWithOtpCode); - check(signInRes.nextStep.codeDeliveryDetails) - .isNotNull() - .has((d) => d.deliveryMedium, 'deliveryMedium') - .equals(DeliveryMedium.email); - - final confirmRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await otpResult.code, - ); - check(confirmRes.nextStep.signInStep).equals(AuthSignInStep.done); - } - - await signInWithEmail(); - await signInWithEmail(); - - await check( - because: 'EMAIL can be disabled when optional', - cognitoPlugin.updateMfaPreference(email: MfaPreference.disabled), - ).completes(); - - check( - because: 'Disabling EMAIL should mark it as not preferred', - await cognitoPlugin.fetchMfaPreference(), - ).equals( - const UserMfaPreference(enabled: {}, preferred: null), - ); - }); - - asyncTest('can select EMAIL MFA', (_) async { - final username = env.generateUsername(); - final password = generatePassword(); - final phoneNumber = generatePhoneNumber(); - - final otpResult = await getOtpCode( - env.getLoginAttribute(username), - ); - - // Create a user with an unverified phone number. - await adminCreateUser( - username, - password, - autoConfirm: true, - verifyAttributes: false, - attributes: { - AuthUserAttributeKey.phoneNumber: phoneNumber, - AuthUserAttributeKey.email: username, - }, - ); - - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check( - signInRes.nextStep.signInStep, - because: 'MFA is optional', - ).equals(AuthSignInStep.done); - - check(await cognitoPlugin.fetchMfaPreference()) - .equals(const UserMfaPreference()); - - await cognitoPlugin.updateMfaPreference( - email: MfaPreference.preferred, - ); - - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.email}, - preferred: MfaType.email, - ), - ); - - await cognitoPlugin.updateMfaPreference( - sms: MfaPreference.enabled, - ); - - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.sms, MfaType.email}, - preferred: MfaType.email, - ), - ); - - { - await signOutUser(assertComplete: true); - - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check(signInRes.nextStep.signInStep) - .equals(AuthSignInStep.confirmSignInWithOtpCode); - check(signInRes.nextStep.codeDeliveryDetails) - .isNotNull() - .has((d) => d.deliveryMedium, 'deliveryMedium') - .equals(DeliveryMedium.email); - - final confirmRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await otpResult.code, - ); - check(confirmRes.nextStep.signInStep).equals(AuthSignInStep.done); - } - - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.sms, MfaType.email}, - preferred: MfaType.email, - ), - ); - - // Verify we can switch to SMS as preferred. - - await cognitoPlugin.updateMfaPreference( - sms: MfaPreference.preferred, - ); - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.sms, MfaType.email}, - preferred: MfaType.sms, - ), - ); - - { - await signOutUser(assertComplete: true); - - final mfaCode = await getOtpCode(UserAttribute.phone(phoneNumber)); - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check(signInRes.nextStep.signInStep) - .equals(AuthSignInStep.confirmSignInWithSmsMfaCode); - check(signInRes.nextStep.codeDeliveryDetails).isNotNull() - ..has((d) => d.deliveryMedium, 'deliveryMedium') - .equals(DeliveryMedium.sms) - ..has((d) => d.destination, 'destination') - .isNotNull() - .startsWith('+'); - - final confirmRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await mfaCode.code, - ); - check(confirmRes.nextStep.signInStep).equals(AuthSignInStep.done); - } - - // Verify marking enabled does not change preference. - await cognitoPlugin.updateMfaPreference( - sms: MfaPreference.enabled, - email: MfaPreference.enabled, - ); - check( - await cognitoPlugin.fetchMfaPreference(), - because: 'SMS should still be marked preferred', - ).equals( - const UserMfaPreference( - enabled: {MfaType.sms, MfaType.email}, - preferred: MfaType.sms, - ), - ); - - // Verify that we can disable both - await check( - because: 'MFA can be disabled when optional', - cognitoPlugin.updateMfaPreference( - sms: MfaPreference.disabled, - email: MfaPreference.disabled, - ), - ).completes(); - - check( - because: 'Disabling MFA should mark it as not preferred', - await cognitoPlugin.fetchMfaPreference(), - ).equals( - const UserMfaPreference(enabled: {}, preferred: null), - ); - }); - - asyncTest('can select SMS MFA', (_) async { - final username = env.generateUsername(); - final password = generatePassword(); - final phoneNumber = generatePhoneNumber(); - - // Create a user with an unverified phone number. - await adminCreateUser( - username, - password, - autoConfirm: true, - verifyAttributes: false, - attributes: { - AuthUserAttributeKey.phoneNumber: phoneNumber, - AuthUserAttributeKey.email: username, - }, - ); - - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check( - signInRes.nextStep.signInStep, - because: 'MFA is optional', - ).equals(AuthSignInStep.done); - - check(await cognitoPlugin.fetchMfaPreference()) - .equals(const UserMfaPreference()); - - await cognitoPlugin.updateMfaPreference( - sms: MfaPreference.preferred, - email: MfaPreference.enabled, - ); - - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.email, MfaType.sms}, - preferred: MfaType.sms, - ), - ); - - await cognitoPlugin.updateMfaPreference( - sms: MfaPreference.enabled, - email: MfaPreference.enabled, - ); - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.sms, MfaType.email}, - preferred: MfaType.sms, - ), - ); - - await signOutUser(assertComplete: true); - - final mfaCode = await getOtpCode(UserAttribute.phone(phoneNumber)); - - final resignInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check(resignInRes.nextStep.signInStep) - .equals(AuthSignInStep.confirmSignInWithSmsMfaCode); - check(resignInRes.nextStep.codeDeliveryDetails).isNotNull() - ..has((d) => d.deliveryMedium, 'deliveryMedium') - .equals(DeliveryMedium.sms) - ..has((d) => d.destination, 'destination') - .isNotNull() - .startsWith('+'); - - final confirmRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await mfaCode.code, - ); - - check(confirmRes.nextStep.signInStep).equals(AuthSignInStep.done); - - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.sms, MfaType.email}, - preferred: MfaType.sms, - ), - ); - - // Verify we can set SMS as preferred and forego selection. - - await cognitoPlugin.updateMfaPreference( - sms: MfaPreference.preferred, - ); - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.sms, MfaType.email}, - preferred: MfaType.sms, - ), - ); - - { - await signOutUser(assertComplete: true); - - final mfaCode = await getOtpCode(UserAttribute.phone(phoneNumber)); - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check(signInRes.nextStep.signInStep) - .equals(AuthSignInStep.confirmSignInWithSmsMfaCode); - check(signInRes.nextStep.codeDeliveryDetails).isNotNull() - ..has((d) => d.deliveryMedium, 'deliveryMedium') - .equals(DeliveryMedium.sms) - ..has((d) => d.destination, 'destination') - .isNotNull() - .startsWith('+'); - - final confirmRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await mfaCode.code, - ); - check(confirmRes.nextStep.signInStep).equals(AuthSignInStep.done); - } - - // Verify we can switch to EMAIL as preferred. - - await cognitoPlugin.updateMfaPreference( - email: MfaPreference.preferred, - ); - check( - await cognitoPlugin.fetchMfaPreference(), - because: 'EMAIL should be marked preferred', - ).equals( - const UserMfaPreference( - enabled: {MfaType.sms, MfaType.email}, - preferred: MfaType.email, - ), - ); - - { - await signOutUser(assertComplete: true); - - final otpResult = await getOtpCode( - env.getLoginAttribute(username), - ); - - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - - check(signInRes.nextStep.signInStep) - .equals(AuthSignInStep.confirmSignInWithOtpCode); - check(signInRes.nextStep.codeDeliveryDetails) - .isNotNull() - .has((d) => d.deliveryMedium, 'deliveryMedium') - .equals(DeliveryMedium.email); - - final confirmRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await otpResult.code, - ); - check(confirmRes.nextStep.signInStep).equals(AuthSignInStep.done); - } - - // Verify marking enabled does not change preference. - await cognitoPlugin.updateMfaPreference( - sms: MfaPreference.enabled, - email: MfaPreference.enabled, - ); - check( - await cognitoPlugin.fetchMfaPreference(), - because: 'EMAIL should still be marked preferred', - ).equals( - const UserMfaPreference( - enabled: {MfaType.sms, MfaType.email}, - preferred: MfaType.email, - ), - ); - - // Verify that we can disable both - await check( - because: 'MFA can be disabled when optional', - cognitoPlugin.updateMfaPreference( - sms: MfaPreference.disabled, - email: MfaPreference.disabled, - ), - ).completes(); - - check( - because: 'Disabling MFA should mark it as not preferred', - await cognitoPlugin.fetchMfaPreference(), - ).equals( - const UserMfaPreference(enabled: {}, preferred: null), - ); - }); - }); - }); -} diff --git a/packages/auth/amplify_auth_cognito/example/integration_test/mfa_sms_email_required_test.dart b/packages/auth/amplify_auth_cognito/example/integration_test/mfa_sms_email_required_test.dart deleted file mode 100644 index 6a3da16919..0000000000 --- a/packages/auth/amplify_auth_cognito/example/integration_test/mfa_sms_email_required_test.dart +++ /dev/null @@ -1,354 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -import 'package:amplify_auth_integration_test/amplify_auth_integration_test.dart'; -import 'package:amplify_flutter/amplify_flutter.dart'; -import 'package:amplify_integration_test/amplify_integration_test.dart'; -import 'package:checks/checks.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'test_runner.dart'; - -void main() { - testRunner.setupTests(); - - group('MFA (EMAIL + SMS)', () { - testRunner.withEnvironment(mfaRequiredEmailSms, (env) { - asyncTest('can set up EMAIL MFA', (_) async { - final username = env.generateUsername(); - final password = generatePassword(); - - final otpResult = await getOtpCode( - env.getLoginAttribute(username), - ); - - // Create a user with no phone number. - await adminCreateUser( - username, - password, - autoConfirm: true, - attributes: { - AuthUserAttributeKey.email: username, - }, - autoFillAttributes: false, - ); - - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check( - signInRes.nextStep.signInStep, - because: 'MFA is required, and EMAIL is chosen when ' - 'no phone number is registered', - ).equals(AuthSignInStep.confirmSignInWithOtpCode); - - final setupRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await otpResult.code, - ); - check(setupRes.nextStep.signInStep).equals(AuthSignInStep.done); - - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.email}, - preferred: MfaType.email, - ), - ); - - await signOutUser(assertComplete: true); - - // Verify we can sign in with EMAIL MFA as the preferred method and forego selection. - - final otpResult2 = await getOtpCode( - env.getLoginAttribute(username), - ); - - final resignInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check(resignInRes.nextStep.signInStep) - .equals(AuthSignInStep.confirmSignInWithOtpCode); - check(resignInRes.nextStep.codeDeliveryDetails) - .isNotNull() - .has((d) => d.deliveryMedium, 'deliveryMedium') - .equals(DeliveryMedium.email); - - final confirmRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await otpResult2.code, - ); - check(confirmRes.nextStep.signInStep).equals(AuthSignInStep.done); - }); - - asyncTest('can select EMAIL MFA', (_) async { - final username = env.generateUsername(); - final password = generatePassword(); - final phoneNumber = generatePhoneNumber(); - - final mfaCode = await getOtpCode(UserAttribute.phone(phoneNumber)); - - // Verify we can set EMAIL as preferred and forego selection. - await adminCreateUser( - username, - password, - autoConfirm: true, - verifyAttributes: false, - attributes: { - AuthUserAttributeKey.phoneNumber: phoneNumber, - AuthUserAttributeKey.email: username, - }, - ); - - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check( - signInRes.nextStep.signInStep, - because: 'MFA is required so Cognito automatically enables SMS MFA', - ).equals(AuthSignInStep.confirmSignInWithSmsMfaCode); - - final confirmRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await mfaCode.code, - ); - check(confirmRes.nextStep.signInStep).equals(AuthSignInStep.done); - - check( - await cognitoPlugin.fetchMfaPreference(), - because: 'MFA is required so Cognito automatically enables SMS MFA', - ).equals( - const UserMfaPreference( - enabled: {MfaType.sms}, - preferred: MfaType.sms, - ), - ); - - await cognitoPlugin.updateMfaPreference( - email: MfaPreference.preferred, - ); - - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.sms, MfaType.email}, - preferred: MfaType.email, - ), - ); - - await signOutUser(assertComplete: true); - - { - final otpResult = await getOtpCode( - env.getLoginAttribute(username), - ); - final resignInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check( - resignInRes.nextStep.signInStep, - because: 'Preference is EMAIL MFA now', - ).equals(AuthSignInStep.confirmSignInWithOtpCode); - check(resignInRes.nextStep.codeDeliveryDetails) - .isNotNull() - .has((d) => d.deliveryMedium, 'deliveryMedium') - .equals(DeliveryMedium.email); - - final confirmRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await otpResult.code, - ); - check(confirmRes.nextStep.signInStep).equals(AuthSignInStep.done); - } - - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.sms, MfaType.email}, - preferred: MfaType.email, - ), - ); - - // Verify marking enabled does not change preference. - await cognitoPlugin.updateMfaPreference( - sms: MfaPreference.enabled, - email: MfaPreference.enabled, - ); - check( - await cognitoPlugin.fetchMfaPreference(), - because: 'SMS should still be marked preferred', - ).equals( - const UserMfaPreference( - enabled: {MfaType.sms, MfaType.email}, - preferred: MfaType.email, - ), - ); - - // Verify that we can disable MFA - { - await check( - because: 'Interestingly, Cognito does not throw and allows ' - 'MFA to be disabled even when required.', - cognitoPlugin.updateMfaPreference( - sms: MfaPreference.disabled, - email: MfaPreference.disabled, - ), - ).completes(); - - check( - because: 'Disabling MFA should mark it as not preferred', - await cognitoPlugin.fetchMfaPreference(), - ).equals( - const UserMfaPreference( - enabled: {}, - preferred: null, - ), - ); - } - }); - - asyncTest('can select SMS MFA', (_) async { - final username = env.generateUsername(); - final password = generatePassword(); - final phoneNumber = generatePhoneNumber(); - - final mfaCode = await getOtpCode(UserAttribute.phone(phoneNumber)); - - // Create a user with an unverified phone number. - await adminCreateUser( - username, - password, - autoConfirm: true, - verifyAttributes: false, - attributes: { - AuthUserAttributeKey.phoneNumber: phoneNumber, - AuthUserAttributeKey.email: username, - }, - ); - - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check( - signInRes.nextStep.signInStep, - because: 'MFA is required so Cognito automatically enables SMS MFA', - ).equals(AuthSignInStep.confirmSignInWithSmsMfaCode); - - final confirmRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await mfaCode.code, - ); - check(confirmRes.nextStep.signInStep).equals(AuthSignInStep.done); - - check( - await cognitoPlugin.fetchMfaPreference(), - because: 'MFA is required so Cognito automatically enables SMS MFA', - ).equals( - const UserMfaPreference( - enabled: {MfaType.sms}, - preferred: MfaType.sms, - ), - ); - - // Verify we can set SMS as preferred and forego selection. - - { - await signOutUser(assertComplete: true); - - final mfaCode = await getOtpCode(UserAttribute.phone(phoneNumber)); - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check( - signInRes.nextStep.signInStep, - because: 'Preference is SMS MFA now', - ).equals(AuthSignInStep.confirmSignInWithSmsMfaCode); - check(signInRes.nextStep.codeDeliveryDetails).isNotNull() - ..has((d) => d.deliveryMedium, 'deliveryMedium') - .equals(DeliveryMedium.sms) - ..has((d) => d.destination, 'destination') - .isNotNull() - .startsWith('+'); - - final confirmRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await mfaCode.code, - ); - check(confirmRes.nextStep.signInStep).equals(AuthSignInStep.done); - } - - // Verify we can switch to EMAIL as preferred. - - await cognitoPlugin.updateMfaPreference( - email: MfaPreference.preferred, - ); - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.sms, MfaType.email}, - preferred: MfaType.email, - ), - ); - - { - await signOutUser(assertComplete: true); - - final otpResult = await getOtpCode( - env.getLoginAttribute(username), - ); - - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check( - signInRes.nextStep.signInStep, - because: 'Preference is EMAIL MFA now', - ).equals(AuthSignInStep.confirmSignInWithOtpCode); - check(signInRes.nextStep.codeDeliveryDetails) - .isNotNull() - .has((d) => d.deliveryMedium, 'deliveryMedium') - .equals(DeliveryMedium.email); - - final confirmRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await otpResult.code, - ); - check(confirmRes.nextStep.signInStep).equals(AuthSignInStep.done); - } - - // Verify marking enabled does not change preference. - await cognitoPlugin.updateMfaPreference( - sms: MfaPreference.enabled, - email: MfaPreference.enabled, - ); - check( - await cognitoPlugin.fetchMfaPreference(), - because: 'EMAIL should still be marked preferred', - ).equals( - const UserMfaPreference( - enabled: {MfaType.sms, MfaType.email}, - preferred: MfaType.email, - ), - ); - - // Verify that we can disable MFA - { - await check( - because: 'Interestingly, Cognito does not throw and allows ' - 'MFA to be disabled even when required.', - cognitoPlugin.updateMfaPreference( - sms: MfaPreference.disabled, - email: MfaPreference.disabled, - ), - ).completes(); - - check( - because: 'Disabling MFA should mark it as not preferred', - await cognitoPlugin.fetchMfaPreference(), - ).equals( - const UserMfaPreference( - enabled: {}, - preferred: null, - ), - ); - } - }); - }); - }); -} diff --git a/packages/auth/amplify_auth_cognito/example/integration_test/mfa_sms_totp_required_test.dart b/packages/auth/amplify_auth_cognito/example/integration_test/mfa_sms_totp_required_test.dart index 2f5c1422e3..32862bf0bb 100644 --- a/packages/auth/amplify_auth_cognito/example/integration_test/mfa_sms_totp_required_test.dart +++ b/packages/auth/amplify_auth_cognito/example/integration_test/mfa_sms_totp_required_test.dart @@ -35,7 +35,7 @@ void main() { signInRes.nextStep.signInStep, because: 'MFA is required, and TOTP is chosen when ' 'no phone number is registered', - ).equals(AuthSignInStep.continueSignInWithMfaSetupSelection); + ).equals(AuthSignInStep.continueSignInWithTotpSetup); final sharedSecret = signInRes.nextStep.totpSetupDetails!.sharedSecret; final setupRes = await Amplify.Auth.confirmSignIn( diff --git a/packages/auth/amplify_auth_cognito/example/integration_test/mfa_totp_required_test.dart b/packages/auth/amplify_auth_cognito/example/integration_test/mfa_totp_required_test.dart index 323700b9f6..84370b665c 100644 --- a/packages/auth/amplify_auth_cognito/example/integration_test/mfa_totp_required_test.dart +++ b/packages/auth/amplify_auth_cognito/example/integration_test/mfa_totp_required_test.dart @@ -34,7 +34,7 @@ void main() { signInRes.nextStep.signInStep, because: "TOTP MFA is automatically enabled when it's the only option", - ).equals(AuthSignInStep.continueSignInWithMfaSetupSelection); + ).equals(AuthSignInStep.continueSignInWithTotpSetup); final sharedSecret = signInRes.nextStep.totpSetupDetails!.sharedSecret; final setupRes = await Amplify.Auth.confirmSignIn( diff --git a/packages/auth/amplify_auth_cognito/example/integration_test/mfa_username_login_required_test.dart b/packages/auth/amplify_auth_cognito/example/integration_test/mfa_username_login_required_test.dart deleted file mode 100644 index 9903ed6e2d..0000000000 --- a/packages/auth/amplify_auth_cognito/example/integration_test/mfa_username_login_required_test.dart +++ /dev/null @@ -1,247 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -import 'package:amplify_auth_cognito/amplify_auth_cognito.dart'; -import 'package:amplify_auth_integration_test/amplify_auth_integration_test.dart'; -import 'package:amplify_flutter/amplify_flutter.dart'; -import 'package:amplify_integration_test/amplify_integration_test.dart'; -import 'package:checks/checks.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'test_runner.dart'; - -void main() { - testRunner.setupTests(); - - group('MFA (EMAIL + TOTP + SMS)', () { - testRunner.withEnvironment(mfaRequiredUsernameLogin, (env) { - asyncTest('can set up EMAIL MFA', (_) async { - final username = env.generateUsername(); - final password = generatePassword(); - final email = generateEmail(); - - final otpResult = await getOtpCode(UserAttribute.email(email)); - - // Create a user with no phone number. - await adminCreateUser( - username, - password, - autoConfirm: true, - autoFillAttributes: false, - verifyAttributes: false, - ); - - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - - check( - signInRes.nextStep.signInStep, - because: - 'When an email is registered and the userpool has email MFA enabled, Cognito will automatically enable email MFA as the preferred MFA method.', - ).equals(AuthSignInStep.continueSignInWithMfaSetupSelection); - - await Amplify.Auth.confirmSignIn( - confirmationValue: 'EMAIL', - ); - - await Amplify.Auth.confirmSignIn( - confirmationValue: email, - ); - - final confirmRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await otpResult.code, - ); - - check(confirmRes.nextStep.signInStep).equals(AuthSignInStep.done); - - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.email}, - preferred: MfaType.email, - ), - ); - - await signOutUser(assertComplete: true); - - final otpResult2 = await getOtpCode(UserAttribute.email(email)); - - final resignInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check(resignInRes.nextStep.signInStep) - .equals(AuthSignInStep.confirmSignInWithOtpCode); - check(resignInRes.nextStep.codeDeliveryDetails) - .isNotNull() - .has((d) => d.deliveryMedium, 'deliveryMedium') - .equals(DeliveryMedium.email); - - final confirmRes2 = await Amplify.Auth.confirmSignIn( - confirmationValue: await otpResult2.code, - ); - check(confirmRes2.nextStep.signInStep).equals(AuthSignInStep.done); - }); - - asyncTest('can setup TOTP MFA', (_) async { - final username = env.generateUsername(); - final password = generatePassword(); - - // Create a user with an unverified phone number. - await adminCreateUser( - username, - password, - autoConfirm: true, - verifyAttributes: false, - autoFillAttributes: false, - ); - - { - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - check( - signInRes.nextStep.signInStep, - because: 'MFA is required so users select a method to setup', - ).equals(AuthSignInStep.continueSignInWithMfaSetupSelection); - - final selectRes = await Amplify.Auth.confirmSignIn( - confirmationValue: 'TOTP', - ); - - final sharedSecret = - selectRes.nextStep.totpSetupDetails!.sharedSecret; - final setupRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await generateTotpCode(sharedSecret), - options: const ConfirmSignInOptions( - pluginOptions: CognitoConfirmSignInPluginOptions( - friendlyDeviceName: friendlyDeviceName, - ), - ), - ); - - check(setupRes.nextStep.signInStep).equals(AuthSignInStep.done); - } - - check( - await cognitoPlugin.fetchMfaPreference(), - because: - 'MFA is required so Cognito automatically enables EMAIL MFA, this is expected behavior', - ).equals( - const UserMfaPreference( - enabled: {MfaType.totp}, - preferred: MfaType.totp, - ), - ); - - await signOutUser(assertComplete: true); - }); - - asyncTest( - 'Can set up EMAIL and TOTP MFA and then choose a preferred method', - (_) async { - final username = env.generateUsername(); - final password = generatePassword(); - final email = generateEmail(); - - final otpResult = await getOtpCode(UserAttribute.email(email)); - - // Create a user with no phone number. - await adminCreateUser( - username, - password, - autoConfirm: true, - autoFillAttributes: false, - verifyAttributes: false, - ); - - final signInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - - check( - signInRes.nextStep.signInStep, - because: - 'When both EMAIL and TOTP are enabled but email attribute isnt verified, choose an mfa method to set up.', - ).equals(AuthSignInStep.continueSignInWithMfaSetupSelection); - - await Amplify.Auth.confirmSignIn( - confirmationValue: 'EMAIL', - ); - - await Amplify.Auth.confirmSignIn( - confirmationValue: email, - ); - - final confirmRes = await Amplify.Auth.confirmSignIn( - confirmationValue: await otpResult.code, - ); - - check(confirmRes.nextStep.signInStep).equals(AuthSignInStep.done); - - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.email}, - preferred: MfaType.email, - ), - ); - - await signOutUser(assertComplete: true); - - final otpResult2 = await getOtpCode(UserAttribute.email(email)); - - final resignInRes = await Amplify.Auth.signIn( - username: username, - password: password, - ); - - check(resignInRes.nextStep.signInStep) - .equals(AuthSignInStep.confirmSignInWithOtpCode); - check(resignInRes.nextStep.codeDeliveryDetails) - .isNotNull() - .has((d) => d.deliveryMedium, 'deliveryMedium') - .equals(DeliveryMedium.email); - - final confirmRes2 = await Amplify.Auth.confirmSignIn( - confirmationValue: await otpResult2.code, - ); - check(confirmRes2.nextStep.signInStep).equals(AuthSignInStep.done); - - await setUpTotp(); - - check(await cognitoPlugin.fetchMfaPreference()).equals( - const UserMfaPreference( - enabled: {MfaType.email, MfaType.totp}, - preferred: null, - ), - ); - - // sign out and sign back in and confirm TOTP - await signOutUser(assertComplete: true); - - final resignInRes2 = await Amplify.Auth.signIn( - username: username, - password: password, - ); - - check(resignInRes2.nextStep.signInStep) - .equals(AuthSignInStep.continueSignInWithMfaSelection); - - // select totp as the preferred method - await Amplify.Auth.confirmSignIn( - confirmationValue: 'TOTP', - ); - - final confirmRes3 = await Amplify.Auth.confirmSignIn( - confirmationValue: await generateTotpCode(), - ); - - check(confirmRes3.nextStep.signInStep).equals(AuthSignInStep.done); - }, - ); - }); - }); -} diff --git a/packages/auth/amplify_auth_cognito/pubspec.yaml b/packages/auth/amplify_auth_cognito/pubspec.yaml index 56f739c698..e97fcf589a 100644 --- a/packages/auth/amplify_auth_cognito/pubspec.yaml +++ b/packages/auth/amplify_auth_cognito/pubspec.yaml @@ -1,6 +1,6 @@ name: amplify_auth_cognito description: The Amplify Flutter Auth category plugin using the AWS Cognito provider. -version: 2.5.0 +version: 2.4.2 homepage: https://docs.amplify.aws/lib/q/platform/flutter/ repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/auth/amplify_auth_cognito issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues @@ -19,11 +19,11 @@ platforms: web: dependencies: - amplify_analytics_pinpoint: ">=2.5.0 <2.6.0" - amplify_analytics_pinpoint_dart: ">=0.4.6 <0.5.0" - amplify_auth_cognito_dart: ">=0.11.7 <0.12.0" - amplify_core: ">=2.5.0 <2.6.0" - amplify_flutter: ">=2.5.0 <2.6.0" + amplify_analytics_pinpoint: ">=2.4.1 <2.5.0" + amplify_analytics_pinpoint_dart: ">=0.4.5 <0.5.0" + amplify_auth_cognito_dart: ">=0.11.6 <0.12.0" + amplify_core: ">=2.4.2 <2.5.0" + amplify_flutter: ">=2.4.1 <2.5.0" amplify_secure_storage: ">=0.5.7 <0.6.0" async: ^2.10.0 flutter: diff --git a/packages/auth/amplify_auth_cognito_dart/CHANGELOG.md b/packages/auth/amplify_auth_cognito_dart/CHANGELOG.md index e5047e781d..02f5560230 100644 --- a/packages/auth/amplify_auth_cognito_dart/CHANGELOG.md +++ b/packages/auth/amplify_auth_cognito_dart/CHANGELOG.md @@ -1,8 +1,3 @@ -## 0.11.7 - -### Features -- feat(auth, authenticator): Add support for Email OTP MFA ([#5449](https://github.com/aws-amplify/amplify-flutter/pull/5449)) (#5472) - ## 0.11.6 - Minor bug fixes and improvements diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/auth_plugin_impl.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/auth_plugin_impl.dart index e6a848919e..f458548642 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/auth_plugin_impl.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/auth_plugin_impl.dart @@ -481,45 +481,45 @@ class AmplifyAuthCognitoDart extends AuthPluginInterface } CognitoSignInResult _processSignInResult(SignInState result) { - switch (result) { - case SignInNotStarted(): - case SignInInitiating(): + return switch (result) { + SignInNotStarted _ || + SignInInitiating _ => // This should never happen. throw UnknownException( 'Sign in could not be completed', underlyingException: result, - ); - - case SignInCancelling(): - throw const UserCancelledException( + ), + SignInCancelling _ => throw const UserCancelledException( 'The user canceled the sign-in flow', - ); - - case final SignInChallenge challenge: - return CognitoSignInResult( + ), + SignInChallenge( + :final challengeName, + :final challengeParameters, + :final codeDeliveryDetails, + :final requiredAttributes, + :final allowedMfaTypes, + :final totpSetupResult, + ) => + CognitoSignInResult( isSignedIn: false, nextStep: AuthNextSignInStep( - signInStep: challenge.challengeName.signInStep, - codeDeliveryDetails: challenge.codeDeliveryDetails, - additionalInfo: challenge.challengeParameters, - missingAttributes: challenge.requiredAttributes, - allowedMfaTypes: challenge.allowedMfaTypes, - totpSetupDetails: challenge.totpSetupResult, + signInStep: challengeName.signInStep, + codeDeliveryDetails: codeDeliveryDetails, + additionalInfo: challengeParameters, + missingAttributes: requiredAttributes, + allowedMfaTypes: allowedMfaTypes, + totpSetupDetails: totpSetupResult, ), - ); - - case SignInSuccess(): - return const CognitoSignInResult( + ), + SignInSuccess _ => const CognitoSignInResult( isSignedIn: true, nextStep: AuthNextSignInStep( signInStep: AuthSignInStep.done, ), - ); - - case final SignInFailure failure: - Error.throwWithStackTrace(failure.exception, failure.stackTrace); -// To satisfy Dart's requirements, even if unreachable - } + ), + SignInFailure(:final exception, :final stackTrace) => + Error.throwWithStackTrace(exception, stackTrace), + }; } @override @@ -885,14 +885,13 @@ class AmplifyAuthCognitoDart extends AuthPluginInterface /// {@template amplify_core.amplify_auth_category.update_mfa_preference} /// Updates the MFA preference for the current user. /// - /// If [sms], [totp], or [email] is `null`, the preference for that MFA type is left - /// unchanged. Setting either [sms], [totp], or [email] to [MfaPreference.preferred] + /// If [sms] or [totp] is `null`, the preference for that MFA type is left + /// unchanged. Setting either [sms] or [totp] to [MfaPreference.preferred] /// will mark the other as not preferred. /// {@endtemplate} Future updateMfaPreference({ MfaPreference? sms, MfaPreference? totp, - MfaPreference? email, }) async { final tokens = await _stateMachine.getUserPoolTokens(); final accessToken = tokens.accessToken.raw; @@ -900,7 +899,6 @@ class AmplifyAuthCognitoDart extends AuthPluginInterface accessToken: accessToken, sms: sms, totp: totp, - email: email, ); } diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/flows/constants.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/flows/constants.dart index 174bf2c9bf..3ab6d376a5 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/flows/constants.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/flows/constants.dart @@ -11,9 +11,6 @@ abstract class CognitoConstants { /// The `USERNAME` parameter. static const challengeParamUsername = 'USERNAME'; - /// The `EMAIL` parameter. - static const challengeParamEmail = 'EMAIL'; - /// The `SRP_A` parameter. static const challengeParamSrpA = 'SRP_A'; @@ -60,9 +57,6 @@ abstract class CognitoConstants { /// The `SMS_MFA_CODE` parameter. static const challengeParamSmsMfaCode = 'SMS_MFA_CODE'; - /// The `EMAIL_OTP_CODE` parameter. - static const challengeParamEmailOtpCode = 'EMAIL_OTP_CODE'; - /// The `SOFTWARE_TOKEN_MFA_CODE` parameter. static const challengeParamSoftwareTokenMfaCode = 'SOFTWARE_TOKEN_MFA_CODE'; diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/cognito_identity.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/cognito_identity.dart index d3b8223bdb..bcac91000f 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/cognito_identity.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/cognito_identity.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas /// # Amazon Cognito Identity diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/cognito_identity_provider.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/cognito_identity_provider.dart index 3bc1811bc4..7682084c1c 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/cognito_identity_provider.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/cognito_identity_provider.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas /// # Amazon Cognito Identity Provider @@ -68,7 +68,6 @@ export 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/ export 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/device_remembered_status_type.dart'; export 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/device_secret_verifier_config_type.dart'; export 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/device_type.dart'; -export 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/email_mfa_settings_type.dart'; export 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/enable_software_token_mfa_exception.dart'; export 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/expired_code_exception.dart'; export 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/forbidden_exception.dart'; @@ -100,7 +99,6 @@ export 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/ export 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/mfa_option_type.dart'; export 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/new_device_metadata_type.dart'; export 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/not_authorized_exception.dart'; -export 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/password_history_policy_violation_exception.dart'; export 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/password_reset_required_exception.dart'; export 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/resend_confirmation_code_request.dart'; export 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/resend_confirmation_code_response.dart'; diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/sdk_bridge.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/sdk_bridge.dart index 9b4de91f08..5c81717008 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/sdk_bridge.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/sdk_bridge.dart @@ -29,10 +29,9 @@ extension ChallengeNameTypeBridge on ChallengeNameType { ChallengeNameType.selectMfaType => AuthSignInStep.continueSignInWithMfaSelection, ChallengeNameType.mfaSetup => - AuthSignInStep.continueSignInWithMfaSetupSelection, + AuthSignInStep.continueSignInWithTotpSetup, ChallengeNameType.softwareTokenMfa => AuthSignInStep.confirmSignInWithTotpMfaCode, - ChallengeNameType.emailOtp => AuthSignInStep.confirmSignInWithOtpCode, ChallengeNameType.adminNoSrpAuth || ChallengeNameType.passwordVerifier || ChallengeNameType.devicePasswordVerifier || @@ -796,104 +795,80 @@ extension MfaSettings on CognitoIdentityProviderClient { required String accessToken, MfaPreference? sms, MfaPreference? totp, - MfaPreference? email, }) async { final UserMfaPreference( enabled: currentEnabled, - preferred: currentPreference, - ) = await _getRawUserSettings(accessToken: accessToken); - - var preferred = - _getNewPreferredMethod(sms: sms, totp: totp, email: email) ?? - currentPreference; - - if (_isCurrentPreferenceDisabled( - currentPreference, - sms: sms, - totp: totp, - email: email, - )) { - preferred = null; + preferred: currentPreference + ) = await _getRawUserSettings( + accessToken: accessToken, + ); + const enabledValues = [ + MfaPreference.enabled, + MfaPreference.notPreferred, + MfaPreference.preferred, + ]; + bool isEnabled(MfaType mfaType) { + final explicitlyDisabled = switch (mfaType) { + MfaType.sms => sms == MfaPreference.disabled, + MfaType.totp => totp == MfaPreference.disabled, + }; + if (explicitlyDisabled) { + return false; + } + final currentlyEnabled = currentEnabled.contains(mfaType); + final requestingEnabled = switch (mfaType) { + MfaType.sms => enabledValues.contains(sms), + MfaType.totp => enabledValues.contains(totp), + }; + return currentlyEnabled || requestingEnabled; } + final preferred = switch ((currentPreference, sms: sms, totp: totp)) { + // Prevent an invalid choice. + (_, sms: MfaPreference.preferred, totp: MfaPreference.preferred) => + throw const InvalidParameterException( + 'Cannot assign both SMS and TOTP as preferred', + ), + + // Setting one or the other as preferred overrides previous value. + (_, sms: MfaPreference.preferred, totp: != MfaPreference.preferred) => + MfaType.sms, + (_, sms: != MfaPreference.preferred, totp: MfaPreference.preferred) => + MfaType.totp, + + // Setting one or the other as disabled or not preferred removes current + // preference if it matches. + ( + MfaType.sms, + sms: MfaPreference.notPreferred || MfaPreference.disabled, + totp: _, + ) || + ( + MfaType.totp, + sms: _, + totp: MfaPreference.notPreferred || MfaPreference.disabled, + ) => + null, + + // Ignore preference changes which do not affect the current preference. + (final currentPreference, sms: _, totp: _) => currentPreference, + }; final smsMfaSettings = SmsMfaSettingsType( - enabled: _isMfaEnabled(MfaType.sms, sms, currentEnabled), + enabled: isEnabled(MfaType.sms), preferredMfa: preferred == MfaType.sms, ); - final softwareTokenSettings = SoftwareTokenMfaSettingsType( - enabled: _isMfaEnabled(MfaType.totp, totp, currentEnabled), + enabled: isEnabled(MfaType.totp), preferredMfa: preferred == MfaType.totp, ); - - final emailMfaSettings = EmailMfaSettingsType( - enabled: _isMfaEnabled(MfaType.email, email, currentEnabled), - preferredMfa: preferred == MfaType.email, - ); - await setUserMfaPreference( SetUserMfaPreferenceRequest( accessToken: accessToken, smsMfaSettings: smsMfaSettings, softwareTokenMfaSettings: softwareTokenSettings, - emailMfaSettings: emailMfaSettings, ), ).result; } - - /// Making sure a maximum of one MFA method is set to preferred. - MfaType? _getNewPreferredMethod({ - MfaPreference? sms, - MfaPreference? totp, - MfaPreference? email, - }) { - final preferredMethods = [ - if (sms == MfaPreference.preferred) MfaType.sms, - if (totp == MfaPreference.preferred) MfaType.totp, - if (email == MfaPreference.preferred) MfaType.email, - ]; - - if (preferredMethods.length > 1) { - throw const InvalidParameterException( - 'Cannot assign multiple MFA methods as preferred', - ); - } - - return preferredMethods.isNotEmpty ? preferredMethods.first : null; - } - - /// Checks if the current preferred MFA method is being disabled or set to not preferred. - bool _isCurrentPreferenceDisabled( - MfaType? currentPreference, { - MfaPreference? sms, - MfaPreference? totp, - MfaPreference? email, - }) { - switch (currentPreference) { - case MfaType.sms: - return sms == MfaPreference.disabled || - sms == MfaPreference.notPreferred; - case MfaType.totp: - return totp == MfaPreference.disabled || - totp == MfaPreference.notPreferred; - case MfaType.email: - return email == MfaPreference.disabled || - email == MfaPreference.notPreferred; - default: - return false; - } - } - - /// Determines if an MFA type should be enabled based on preferences and current settings. - bool _isMfaEnabled( - MfaType mfaType, - MfaPreference? preference, - Set currentEnabled, - ) { - if (preference == MfaPreference.disabled) return false; - if (preference != null) return true; - return currentEnabled.contains(mfaType); - } } extension on String { @@ -901,7 +876,6 @@ extension on String { MfaType get mfaType => switch (this) { 'SOFTWARE_TOKEN_MFA' => MfaType.totp, 'SMS_MFA' => MfaType.sms, - 'EMAIL_OTP' => MfaType.email, final invalidType => throw StateError('Invalid MFA type: $invalidType'), }; } diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/sdk_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/sdk_exception.dart index 78f5d3eaa8..fde039d5f1 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/sdk_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/sdk_exception.dart @@ -356,22 +356,6 @@ final class NotAuthorizedServiceException extends CognitoServiceException String get runtimeTypeName => 'NotAuthorizedServiceException'; } -/// {@template amplify_auth_cognito_dart.sdk_exception.password_history_policy_violation_exception} -/// The message returned when a user's new password matches a previous password and doesn't comply with the password-history policy. -/// {@endtemplate} -final class PasswordHistoryPolicyViolationException - extends CognitoServiceException { - /// {@macro amplify_auth_cognito_dart.sdk_exception.password_history_policy_violation_exception} - const PasswordHistoryPolicyViolationException( - super.message, { - super.recoverySuggestion, - super.underlyingException, - }); - - @override - String get runtimeTypeName => 'PasswordHistoryPolicyViolationException'; -} - /// {@template amplify_auth_cognito_dart.sdk_exception.password_reset_required_exception} /// This exception is thrown when a password reset is required. /// {@endtemplate} @@ -701,11 +685,6 @@ Object transformSdkException(Object e) { message, underlyingException: e, ), - 'PasswordHistoryPolicyViolationException' => - PasswordHistoryPolicyViolationException( - message, - underlyingException: e, - ), 'PasswordResetRequiredException' => PasswordResetRequiredException( message, underlyingException: e, diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/cognito_identity_client.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/cognito_identity_client.dart index 49472116d5..4fce991aac 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/cognito_identity_client.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/cognito_identity_client.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity.cognito_identity_client; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/common/endpoint_resolver.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/common/endpoint_resolver.dart index aabe87df7f..7cd37f555f 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/common/endpoint_resolver.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/common/endpoint_resolver.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity.common.endpoint_resolver; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/common/serializers.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/common/serializers.dart index 13d2996e70..53d9ea9022 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/common/serializers.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/common/serializers.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity.common.serializers; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/credentials.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/credentials.dart index f907c481b8..4a9768bec5 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/credentials.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/credentials.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity.model.credentials; // ignore_for_file: no_leading_underscores_for_library_prefixes @@ -67,7 +67,7 @@ abstract class Credentials ) ..add( 'secretKey', - '***SENSITIVE***', + secretKey, ) ..add( 'sessionToken', diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/external_service_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/external_service_exception.dart index 9e9500945b..40fea8d03e 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/external_service_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/external_service_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity.model.external_service_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/get_credentials_for_identity_input.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/get_credentials_for_identity_input.dart index 1ef8ddd869..76881a5f20 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/get_credentials_for_identity_input.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/get_credentials_for_identity_input.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity.model.get_credentials_for_identity_input; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/get_credentials_for_identity_response.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/get_credentials_for_identity_response.dart index 6f83f4cf28..3bda9069de 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/get_credentials_for_identity_response.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/get_credentials_for_identity_response.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity.model.get_credentials_for_identity_response; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/get_id_input.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/get_id_input.dart index 15ed362231..2469ffe450 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/get_id_input.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/get_id_input.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity.model.get_id_input; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/get_id_response.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/get_id_response.dart index dfe391a845..17f61687d0 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/get_id_response.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/get_id_response.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity.model.get_id_response; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/internal_error_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/internal_error_exception.dart index 4f5a7455e9..c3aefa1100 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/internal_error_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/internal_error_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity.model.internal_error_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/invalid_identity_pool_configuration_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/invalid_identity_pool_configuration_exception.dart index c25b63d9fa..2e2b04cb49 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/invalid_identity_pool_configuration_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/invalid_identity_pool_configuration_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity.model.invalid_identity_pool_configuration_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/invalid_parameter_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/invalid_parameter_exception.dart index 881a613f75..dd0e1bb993 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/invalid_parameter_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/invalid_parameter_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity.model.invalid_parameter_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/limit_exceeded_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/limit_exceeded_exception.dart index 4909ca0b94..d12231e2d3 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/limit_exceeded_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/limit_exceeded_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity.model.limit_exceeded_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/not_authorized_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/not_authorized_exception.dart index 50add67fb4..43841286cb 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/not_authorized_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/not_authorized_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity.model.not_authorized_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/resource_conflict_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/resource_conflict_exception.dart index cc4b2f9846..5e5f88ad77 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/resource_conflict_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/resource_conflict_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity.model.resource_conflict_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/resource_not_found_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/resource_not_found_exception.dart index 1ba7efb1b3..2061531b78 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/resource_not_found_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/resource_not_found_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity.model.resource_not_found_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/too_many_requests_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/too_many_requests_exception.dart index e005c51ca2..01a910e91a 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/too_many_requests_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/model/too_many_requests_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity.model.too_many_requests_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/operation/get_credentials_for_identity_operation.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/operation/get_credentials_for_identity_operation.dart index a70ab6465f..0a3319e2d0 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/operation/get_credentials_for_identity_operation.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/operation/get_credentials_for_identity_operation.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity.operation.get_credentials_for_identity_operation; // ignore_for_file: no_leading_underscores_for_library_prefixes @@ -69,7 +69,7 @@ class GetCredentialsForIdentityOperation extends _i1.HttpOperation< credentialsProvider: _credentialsProvider, isOptional: true, ), - const _i1.WithUserAgent('aws-sdk-dart/0.3.2'), + const _i1.WithUserAgent('aws-sdk-dart/0.3.1'), const _i3.WithSdkInvocationId(), const _i3.WithSdkRequest(), ] + diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/operation/get_id_operation.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/operation/get_id_operation.dart index 5a9ebaa5b3..c7aa76e5c4 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/operation/get_id_operation.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity/operation/get_id_operation.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity.operation.get_id_operation; // ignore_for_file: no_leading_underscores_for_library_prefixes @@ -64,7 +64,7 @@ class GetIdOperation extends _i1 credentialsProvider: _credentialsProvider, isOptional: true, ), - const _i1.WithUserAgent('aws-sdk-dart/0.3.2'), + const _i1.WithUserAgent('aws-sdk-dart/0.3.1'), const _i3.WithSdkInvocationId(), const _i3.WithSdkRequest(), ] + diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/cognito_identity_provider_client.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/cognito_identity_provider_client.dart index 77dc73bc98..5b504d64fd 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/cognito_identity_provider_client.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/cognito_identity_provider_client.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.cognito_identity_provider_client; // ignore_for_file: no_leading_underscores_for_library_prefixes @@ -178,7 +178,7 @@ class CognitoIdentityProviderClient { /// Begins setup of time-based one-time password (TOTP) multi-factor authentication (MFA) for a user, with a unique private key that Amazon Cognito generates and returns in the API response. You can authorize an `AssociateSoftwareToken` request with either the user's access token, or a session string from a challenge response that you received from Amazon Cognito. /// - /// Amazon Cognito disassociates an existing software token when you verify the new token in a [VerifySoftwareToken](https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_VerifySoftwareToken.html) API request. If you don't verify the software token and your user pool doesn't require MFA, the user can then authenticate with user name and password credentials alone. If your user pool requires TOTP MFA, Amazon Cognito generates an `MFA_SETUP` or `SOFTWARE\_TOKEN\_SETUP` challenge each time your user signs in. Complete setup with `AssociateSoftwareToken` and `VerifySoftwareToken`. + /// Amazon Cognito disassociates an existing software token when you verify the new token in a [VerifySoftwareToken](https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_VerifySoftwareToken.html) API request. If you don't verify the software token and your user pool doesn't require MFA, the user can then authenticate with user name and password credentials alone. If your user pool requires TOTP MFA, Amazon Cognito generates an `MFA_SETUP` or `SOFTWARE\_TOKEN\_SETUP` challenge each time your user signs. Complete setup with `AssociateSoftwareToken` and `VerifySoftwareToken`. /// /// After you set up software token MFA for your user, Amazon Cognito generates a `SOFTWARE\_TOKEN\_MFA` challenge when they authenticate. Respond to this challenge with your user's TOTP. /// @@ -340,7 +340,7 @@ class CognitoIdentityProviderClient { /// /// This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with [Amazon Pinpoint](https://console.aws.amazon.com/pinpoint/home/). Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in. /// - /// If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Servicesservice, Amazon Simple Notification Service might place your account in the SMS sandbox. In _[sandbox mode](https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html)_ , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see [SMS message settings for Amazon Cognito user pools](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html) in the _Amazon Cognito Developer Guide_. + /// If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Service, Amazon Simple Notification Service might place your account in the SMS sandbox. In _[sandbox mode](https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html)_ , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see [SMS message settings for Amazon Cognito user pools](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html) in the _Amazon Cognito Developer Guide_. _i3.SmithyOperation forgotPassword( ForgotPasswordRequest input, { _i1.AWSHttpClient? client, @@ -410,7 +410,7 @@ class CognitoIdentityProviderClient { /// /// This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with [Amazon Pinpoint](https://console.aws.amazon.com/pinpoint/home/). Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in. /// - /// If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Servicesservice, Amazon Simple Notification Service might place your account in the SMS sandbox. In _[sandbox mode](https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html)_ , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see [SMS message settings for Amazon Cognito user pools](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html) in the _Amazon Cognito Developer Guide_. + /// If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Service, Amazon Simple Notification Service might place your account in the SMS sandbox. In _[sandbox mode](https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html)_ , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see [SMS message settings for Amazon Cognito user pools](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html) in the _Amazon Cognito Developer Guide_. _i3.SmithyOperation getUserAttributeVerificationCode( GetUserAttributeVerificationCodeRequest input, { @@ -468,7 +468,7 @@ class CognitoIdentityProviderClient { /// /// This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with [Amazon Pinpoint](https://console.aws.amazon.com/pinpoint/home/). Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in. /// - /// If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Servicesservice, Amazon Simple Notification Service might place your account in the SMS sandbox. In _[sandbox mode](https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html)_ , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see [SMS message settings for Amazon Cognito user pools](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html) in the _Amazon Cognito Developer Guide_. + /// If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Service, Amazon Simple Notification Service might place your account in the SMS sandbox. In _[sandbox mode](https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html)_ , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see [SMS message settings for Amazon Cognito user pools](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html) in the _Amazon Cognito Developer Guide_. _i3.SmithyOperation initiateAuth( InitiateAuthRequest input, { _i1.AWSHttpClient? client, @@ -514,7 +514,7 @@ class CognitoIdentityProviderClient { /// /// This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with [Amazon Pinpoint](https://console.aws.amazon.com/pinpoint/home/). Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in. /// - /// If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Servicesservice, Amazon Simple Notification Service might place your account in the SMS sandbox. In _[sandbox mode](https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html)_ , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see [SMS message settings for Amazon Cognito user pools](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html) in the _Amazon Cognito Developer Guide_. + /// If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Service, Amazon Simple Notification Service might place your account in the SMS sandbox. In _[sandbox mode](https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html)_ , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see [SMS message settings for Amazon Cognito user pools](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html) in the _Amazon Cognito Developer Guide_. _i3.SmithyOperation resendConfirmationCode( ResendConfirmationCodeRequest input, { _i1.AWSHttpClient? client, @@ -540,7 +540,7 @@ class CognitoIdentityProviderClient { /// /// This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with [Amazon Pinpoint](https://console.aws.amazon.com/pinpoint/home/). Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in. /// - /// If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Servicesservice, Amazon Simple Notification Service might place your account in the SMS sandbox. In _[sandbox mode](https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html)_ , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see [SMS message settings for Amazon Cognito user pools](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html) in the _Amazon Cognito Developer Guide_. + /// If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Service, Amazon Simple Notification Service might place your account in the SMS sandbox. In _[sandbox mode](https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html)_ , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see [SMS message settings for Amazon Cognito user pools](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html) in the _Amazon Cognito Developer Guide_. _i3.SmithyOperation respondToAuthChallenge( RespondToAuthChallengeRequest input, { _i1.AWSHttpClient? client, @@ -606,7 +606,7 @@ class CognitoIdentityProviderClient { /// /// This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with [Amazon Pinpoint](https://console.aws.amazon.com/pinpoint/home/). Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in. /// - /// If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Servicesservice, Amazon Simple Notification Service might place your account in the SMS sandbox. In _[sandbox mode](https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html)_ , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see [SMS message settings for Amazon Cognito user pools](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html) in the _Amazon Cognito Developer Guide_. + /// If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Service, Amazon Simple Notification Service might place your account in the SMS sandbox. In _[sandbox mode](https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html)_ , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see [SMS message settings for Amazon Cognito user pools](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html) in the _Amazon Cognito Developer Guide_. _i3.SmithyOperation signUp( SignUpRequest input, { _i1.AWSHttpClient? client, @@ -654,7 +654,7 @@ class CognitoIdentityProviderClient { /// /// This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with [Amazon Pinpoint](https://console.aws.amazon.com/pinpoint/home/). Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in. /// - /// If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Servicesservice, Amazon Simple Notification Service might place your account in the SMS sandbox. In _[sandbox mode](https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html)_ , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see [SMS message settings for Amazon Cognito user pools](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html) in the _Amazon Cognito Developer Guide_. + /// If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Service, Amazon Simple Notification Service might place your account in the SMS sandbox. In _[sandbox mode](https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html)_ , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see [SMS message settings for Amazon Cognito user pools](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html) in the _Amazon Cognito Developer Guide_. _i3.SmithyOperation updateUserAttributes( UpdateUserAttributesRequest input, { _i1.AWSHttpClient? client, diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/common/endpoint_resolver.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/common/endpoint_resolver.dart index 87bbaf7dc7..aa6948f01b 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/common/endpoint_resolver.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/common/endpoint_resolver.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.common.endpoint_resolver; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/common/serializers.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/common/serializers.dart index 45d3210bcb..4bd6e82ab8 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/common/serializers.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/common/serializers.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.common.serializers; // ignore_for_file: no_leading_underscores_for_library_prefixes @@ -28,7 +28,6 @@ import 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/ import 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/device_remembered_status_type.dart'; import 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/device_secret_verifier_config_type.dart'; import 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/device_type.dart'; -import 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/email_mfa_settings_type.dart'; import 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/enable_software_token_mfa_exception.dart'; import 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/expired_code_exception.dart'; import 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/forbidden_exception.dart'; @@ -60,7 +59,6 @@ import 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/ import 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/mfa_option_type.dart'; import 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/new_device_metadata_type.dart'; import 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/not_authorized_exception.dart'; -import 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/password_history_policy_violation_exception.dart'; import 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/password_reset_required_exception.dart'; import 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/resend_confirmation_code_request.dart'; import 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/resend_confirmation_code_response.dart'; @@ -114,7 +112,6 @@ const List<_i1.SmithySerializer> serializers = [ ...ChangePasswordResponse.serializers, ...InvalidPasswordException.serializers, ...LimitExceededException.serializers, - ...PasswordHistoryPolicyViolationException.serializers, ...PasswordResetRequiredException.serializers, ...TooManyRequestsException.serializers, ...UserNotConfirmedException.serializers, @@ -178,7 +175,6 @@ const List<_i1.SmithySerializer> serializers = [ ...UnsupportedTokenTypeException.serializers, ...SmsMfaSettingsType.serializers, ...SoftwareTokenMfaSettingsType.serializers, - ...EmailMfaSettingsType.serializers, ...SetUserMfaPreferenceRequest.serializers, ...SetUserMfaPreferenceResponse.serializers, ...SignUpRequest.serializers, diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/alias_exists_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/alias_exists_exception.dart index 92daad3986..6fe989ea5a 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/alias_exists_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/alias_exists_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.alias_exists_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/analytics_metadata_type.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/analytics_metadata_type.dart index 3ce0fd64f0..0c3b5e5cb1 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/analytics_metadata_type.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/analytics_metadata_type.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.analytics_metadata_type; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/associate_software_token_request.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/associate_software_token_request.dart index 68a490b537..e85c27e777 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/associate_software_token_request.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/associate_software_token_request.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.associate_software_token_request; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/associate_software_token_response.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/associate_software_token_response.dart index c65a519903..5d95699e30 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/associate_software_token_response.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/associate_software_token_response.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.associate_software_token_response; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/attribute_type.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/attribute_type.dart index d6e81f84e6..c05750b94f 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/attribute_type.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/attribute_type.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.attribute_type; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/auth_flow_type.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/auth_flow_type.dart index 63ef0d3e8b..b72dedfb0e 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/auth_flow_type.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/auth_flow_type.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.auth_flow_type; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/authentication_result_type.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/authentication_result_type.dart index fe4c1436b2..e28c05e8f8 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/authentication_result_type.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/authentication_result_type.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.authentication_result_type; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/challenge_name_type.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/challenge_name_type.dart index 245f07151e..16183b5270 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/challenge_name_type.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/challenge_name_type.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.challenge_name_type; // ignore_for_file: no_leading_underscores_for_library_prefixes @@ -38,44 +38,38 @@ class ChallengeNameType extends _i1.SmithyEnum { 'DEVICE_SRP_AUTH', ); - static const emailOtp = ChallengeNameType._( - 4, - 'EMAIL_OTP', - 'EMAIL_OTP', - ); - static const mfaSetup = ChallengeNameType._( - 5, + 4, 'MFA_SETUP', 'MFA_SETUP', ); static const newPasswordRequired = ChallengeNameType._( - 6, + 5, 'NEW_PASSWORD_REQUIRED', 'NEW_PASSWORD_REQUIRED', ); static const passwordVerifier = ChallengeNameType._( - 7, + 6, 'PASSWORD_VERIFIER', 'PASSWORD_VERIFIER', ); static const selectMfaType = ChallengeNameType._( - 8, + 7, 'SELECT_MFA_TYPE', 'SELECT_MFA_TYPE', ); static const smsMfa = ChallengeNameType._( - 9, + 8, 'SMS_MFA', 'SMS_MFA', ); static const softwareTokenMfa = ChallengeNameType._( - 10, + 9, 'SOFTWARE_TOKEN_MFA', 'SOFTWARE_TOKEN_MFA', ); @@ -86,7 +80,6 @@ class ChallengeNameType extends _i1.SmithyEnum { ChallengeNameType.customChallenge, ChallengeNameType.devicePasswordVerifier, ChallengeNameType.deviceSrpAuth, - ChallengeNameType.emailOtp, ChallengeNameType.mfaSetup, ChallengeNameType.newPasswordRequired, ChallengeNameType.passwordVerifier, diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/change_password_request.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/change_password_request.dart index aca8f246fd..1bee4684cf 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/change_password_request.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/change_password_request.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.change_password_request; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/change_password_response.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/change_password_response.dart index 4dfb38ac75..6d32ca2ee8 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/change_password_response.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/change_password_response.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.change_password_response; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/code_delivery_details_type.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/code_delivery_details_type.dart index 2017a74f76..34f7889f1f 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/code_delivery_details_type.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/code_delivery_details_type.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.code_delivery_details_type; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/code_delivery_failure_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/code_delivery_failure_exception.dart index f3a73bfb96..ce4d865c5c 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/code_delivery_failure_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/code_delivery_failure_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.code_delivery_failure_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/code_mismatch_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/code_mismatch_exception.dart index 40d59d121e..470c29a6b7 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/code_mismatch_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/code_mismatch_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.code_mismatch_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/concurrent_modification_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/concurrent_modification_exception.dart index a93d170315..af4d648e10 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/concurrent_modification_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/concurrent_modification_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.concurrent_modification_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/confirm_device_request.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/confirm_device_request.dart index 36ec585c57..c9a359ad63 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/confirm_device_request.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/confirm_device_request.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.confirm_device_request; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/confirm_device_response.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/confirm_device_response.dart index 742d7b7880..c4a56e3d20 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/confirm_device_response.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/confirm_device_response.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.confirm_device_response; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/confirm_forgot_password_request.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/confirm_forgot_password_request.dart index 7d2eae3eb4..5ee0b35e9a 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/confirm_forgot_password_request.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/confirm_forgot_password_request.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.confirm_forgot_password_request; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/confirm_forgot_password_response.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/confirm_forgot_password_response.dart index a4bd14e09b..428faabe8b 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/confirm_forgot_password_response.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/confirm_forgot_password_response.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.confirm_forgot_password_response; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/confirm_sign_up_request.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/confirm_sign_up_request.dart index a3d08239b0..674e4bf602 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/confirm_sign_up_request.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/confirm_sign_up_request.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.confirm_sign_up_request; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/confirm_sign_up_response.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/confirm_sign_up_response.dart index caba28a5c6..eb41e869cb 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/confirm_sign_up_response.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/confirm_sign_up_response.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.confirm_sign_up_response; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/delete_user_request.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/delete_user_request.dart index 6da56f6fad..a1945ea8b1 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/delete_user_request.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/delete_user_request.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.delete_user_request; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/delivery_medium_type.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/delivery_medium_type.dart index f2d8b3b06b..157cc2712f 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/delivery_medium_type.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/delivery_medium_type.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.delivery_medium_type; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/device_remembered_status_type.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/device_remembered_status_type.dart index 6ea59d3c6e..b7ec625425 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/device_remembered_status_type.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/device_remembered_status_type.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.device_remembered_status_type; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/device_secret_verifier_config_type.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/device_secret_verifier_config_type.dart index b001642117..69f90feee7 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/device_secret_verifier_config_type.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/device_secret_verifier_config_type.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.device_secret_verifier_config_type; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/device_type.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/device_type.dart index b48c396c5a..f909f5c4cc 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/device_type.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/device_type.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.device_type; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/email_mfa_settings_type.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/email_mfa_settings_type.dart deleted file mode 100644 index f5871bb77d..0000000000 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/email_mfa_settings_type.dart +++ /dev/null @@ -1,147 +0,0 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. -// ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas - -library amplify_auth_cognito_dart.cognito_identity_provider.model.email_mfa_settings_type; // ignore_for_file: no_leading_underscores_for_library_prefixes - -import 'package:aws_common/aws_common.dart' as _i1; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; -import 'package:smithy/smithy.dart' as _i2; - -part 'email_mfa_settings_type.g.dart'; - -/// User preferences for multi-factor authentication with email messages. Activates or deactivates email MFA and sets it as the preferred MFA method when multiple methods are available. To activate this setting, [advanced security features](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pool-settings-advanced-security.html) must be active in your user pool. -abstract class EmailMfaSettingsType - with _i1.AWSEquatable - implements Built { - /// User preferences for multi-factor authentication with email messages. Activates or deactivates email MFA and sets it as the preferred MFA method when multiple methods are available. To activate this setting, [advanced security features](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pool-settings-advanced-security.html) must be active in your user pool. - factory EmailMfaSettingsType({ - bool? enabled, - bool? preferredMfa, - }) { - enabled ??= false; - preferredMfa ??= false; - return _$EmailMfaSettingsType._( - enabled: enabled, - preferredMfa: preferredMfa, - ); - } - - /// User preferences for multi-factor authentication with email messages. Activates or deactivates email MFA and sets it as the preferred MFA method when multiple methods are available. To activate this setting, [advanced security features](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pool-settings-advanced-security.html) must be active in your user pool. - factory EmailMfaSettingsType.build( - [void Function(EmailMfaSettingsTypeBuilder) updates]) = - _$EmailMfaSettingsType; - - const EmailMfaSettingsType._(); - - static const List<_i2.SmithySerializer> serializers = [ - EmailMfaSettingsTypeAwsJson11Serializer() - ]; - - @BuiltValueHook(initializeBuilder: true) - static void _init(EmailMfaSettingsTypeBuilder b) { - b - ..enabled = false - ..preferredMfa = false; - } - - /// Specifies whether email message MFA is active for a user. When the value of this parameter is `Enabled`, the user will be prompted for MFA during all sign-in attempts, unless device tracking is turned on and the device has been trusted. - bool get enabled; - - /// Specifies whether email message MFA is the user's preferred method. - bool get preferredMfa; - @override - List get props => [ - enabled, - preferredMfa, - ]; - - @override - String toString() { - final helper = newBuiltValueToStringHelper('EmailMfaSettingsType') - ..add( - 'enabled', - enabled, - ) - ..add( - 'preferredMfa', - preferredMfa, - ); - return helper.toString(); - } -} - -class EmailMfaSettingsTypeAwsJson11Serializer - extends _i2.StructuredSmithySerializer { - const EmailMfaSettingsTypeAwsJson11Serializer() - : super('EmailMfaSettingsType'); - - @override - Iterable get types => const [ - EmailMfaSettingsType, - _$EmailMfaSettingsType, - ]; - - @override - Iterable<_i2.ShapeId> get supportedProtocols => const [ - _i2.ShapeId( - namespace: 'aws.protocols', - shape: 'awsJson1_1', - ) - ]; - - @override - EmailMfaSettingsType deserialize( - Serializers serializers, - Iterable serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = EmailMfaSettingsTypeBuilder(); - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final value = iterator.current; - if (value == null) { - continue; - } - switch (key) { - case 'Enabled': - result.enabled = (serializers.deserialize( - value, - specifiedType: const FullType(bool), - ) as bool); - case 'PreferredMfa': - result.preferredMfa = (serializers.deserialize( - value, - specifiedType: const FullType(bool), - ) as bool); - } - } - - return result.build(); - } - - @override - Iterable serialize( - Serializers serializers, - EmailMfaSettingsType object, { - FullType specifiedType = FullType.unspecified, - }) { - final result$ = []; - final EmailMfaSettingsType(:enabled, :preferredMfa) = object; - result$.addAll([ - 'Enabled', - serializers.serialize( - enabled, - specifiedType: const FullType(bool), - ), - 'PreferredMfa', - serializers.serialize( - preferredMfa, - specifiedType: const FullType(bool), - ), - ]); - return result$; - } -} diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/email_mfa_settings_type.g.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/email_mfa_settings_type.g.dart deleted file mode 100644 index 9be203c737..0000000000 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/email_mfa_settings_type.g.dart +++ /dev/null @@ -1,106 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'email_mfa_settings_type.dart'; - -// ************************************************************************** -// BuiltValueGenerator -// ************************************************************************** - -class _$EmailMfaSettingsType extends EmailMfaSettingsType { - @override - final bool enabled; - @override - final bool preferredMfa; - - factory _$EmailMfaSettingsType( - [void Function(EmailMfaSettingsTypeBuilder)? updates]) => - (new EmailMfaSettingsTypeBuilder()..update(updates))._build(); - - _$EmailMfaSettingsType._({required this.enabled, required this.preferredMfa}) - : super._() { - BuiltValueNullFieldError.checkNotNull( - enabled, r'EmailMfaSettingsType', 'enabled'); - BuiltValueNullFieldError.checkNotNull( - preferredMfa, r'EmailMfaSettingsType', 'preferredMfa'); - } - - @override - EmailMfaSettingsType rebuild( - void Function(EmailMfaSettingsTypeBuilder) updates) => - (toBuilder()..update(updates)).build(); - - @override - EmailMfaSettingsTypeBuilder toBuilder() => - new EmailMfaSettingsTypeBuilder()..replace(this); - - @override - bool operator ==(Object other) { - if (identical(other, this)) return true; - return other is EmailMfaSettingsType && - enabled == other.enabled && - preferredMfa == other.preferredMfa; - } - - @override - int get hashCode { - var _$hash = 0; - _$hash = $jc(_$hash, enabled.hashCode); - _$hash = $jc(_$hash, preferredMfa.hashCode); - _$hash = $jf(_$hash); - return _$hash; - } -} - -class EmailMfaSettingsTypeBuilder - implements Builder { - _$EmailMfaSettingsType? _$v; - - bool? _enabled; - bool? get enabled => _$this._enabled; - set enabled(bool? enabled) => _$this._enabled = enabled; - - bool? _preferredMfa; - bool? get preferredMfa => _$this._preferredMfa; - set preferredMfa(bool? preferredMfa) => _$this._preferredMfa = preferredMfa; - - EmailMfaSettingsTypeBuilder() { - EmailMfaSettingsType._init(this); - } - - EmailMfaSettingsTypeBuilder get _$this { - final $v = _$v; - if ($v != null) { - _enabled = $v.enabled; - _preferredMfa = $v.preferredMfa; - _$v = null; - } - return this; - } - - @override - void replace(EmailMfaSettingsType other) { - ArgumentError.checkNotNull(other, 'other'); - _$v = other as _$EmailMfaSettingsType; - } - - @override - void update(void Function(EmailMfaSettingsTypeBuilder)? updates) { - if (updates != null) updates(this); - } - - @override - EmailMfaSettingsType build() => _build(); - - _$EmailMfaSettingsType _build() { - final _$result = _$v ?? - new _$EmailMfaSettingsType._( - enabled: BuiltValueNullFieldError.checkNotNull( - enabled, r'EmailMfaSettingsType', 'enabled'), - preferredMfa: BuiltValueNullFieldError.checkNotNull( - preferredMfa, r'EmailMfaSettingsType', 'preferredMfa')); - replace(_$result); - return _$result; - } -} - -// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/enable_software_token_mfa_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/enable_software_token_mfa_exception.dart index dfbd457723..ebfbade44b 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/enable_software_token_mfa_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/enable_software_token_mfa_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.enable_software_token_mfa_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/expired_code_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/expired_code_exception.dart index f6ab049ad0..29f4dc36e5 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/expired_code_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/expired_code_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.expired_code_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/forbidden_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/forbidden_exception.dart index b97418f44b..37ccbc6dcd 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/forbidden_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/forbidden_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.forbidden_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/forget_device_request.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/forget_device_request.dart index f716905bf4..57fa4dfe45 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/forget_device_request.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/forget_device_request.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.forget_device_request; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/forgot_password_request.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/forgot_password_request.dart index de772a3506..206bf31593 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/forgot_password_request.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/forgot_password_request.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.forgot_password_request; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/forgot_password_response.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/forgot_password_response.dart index 2d77bdb4ac..92fe7f3db7 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/forgot_password_response.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/forgot_password_response.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.forgot_password_response; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/get_device_request.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/get_device_request.dart index d6068a3e65..6f949ad858 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/get_device_request.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/get_device_request.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.get_device_request; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/get_device_response.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/get_device_response.dart index 33bf747c39..62edc0d585 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/get_device_response.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/get_device_response.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.get_device_response; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/get_user_attribute_verification_code_request.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/get_user_attribute_verification_code_request.dart index bc9f259d32..183f2e2cb8 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/get_user_attribute_verification_code_request.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/get_user_attribute_verification_code_request.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.get_user_attribute_verification_code_request; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/get_user_attribute_verification_code_response.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/get_user_attribute_verification_code_response.dart index 92e05abeac..ab94635e1a 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/get_user_attribute_verification_code_response.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/get_user_attribute_verification_code_response.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.get_user_attribute_verification_code_response; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/get_user_request.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/get_user_request.dart index 61c037aa61..eea378cd8a 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/get_user_request.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/get_user_request.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.get_user_request; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/get_user_response.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/get_user_response.dart index 249a5a3fdf..eb690fbcbf 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/get_user_response.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/get_user_response.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.get_user_response; // ignore_for_file: no_leading_underscores_for_library_prefixes @@ -66,7 +66,7 @@ abstract class GetUserResponse /// The user's preferred MFA setting. String? get preferredMfaSetting; - /// The MFA options that are activated for the user. The possible values in this list are `SMS_MFA`, `EMAIL_OTP`, and `SOFTWARE\_TOKEN\_MFA`. + /// The MFA options that are activated for the user. The possible values in this list are `SMS_MFA` and `SOFTWARE\_TOKEN\_MFA`. _i2.BuiltList? get userMfaSettingList; @override List get props => [ diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/global_sign_out_request.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/global_sign_out_request.dart index a19ee40a56..924d17c3d0 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/global_sign_out_request.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/global_sign_out_request.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.global_sign_out_request; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/global_sign_out_response.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/global_sign_out_response.dart index 0cd0cad3ba..2941bae7c3 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/global_sign_out_response.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/global_sign_out_response.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.global_sign_out_response; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/initiate_auth_request.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/initiate_auth_request.dart index d950158c01..299a26378f 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/initiate_auth_request.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/initiate_auth_request.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.initiate_auth_request; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/initiate_auth_response.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/initiate_auth_response.dart index b4d2d39b01..b0d075afe3 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/initiate_auth_response.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/initiate_auth_response.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.initiate_auth_response; // ignore_for_file: no_leading_underscores_for_library_prefixes @@ -58,9 +58,7 @@ abstract class InitiateAuthResponse /// /// All of the following challenges require `USERNAME` and `SECRET_HASH` (if applicable) in the parameters. /// - /// * `SMS_MFA`: Next challenge is to supply an `SMS\_MFA\_CODE`that your user pool delivered in an SMS message. - /// - /// * `EMAIL_OTP`: Next challenge is to supply an `EMAIL\_OTP\_CODE` that your user pool delivered in an email message. + /// * `SMS_MFA`: Next challenge is to supply an `SMS\_MFA\_CODE`, delivered via SMS. /// /// * `PASSWORD_VERIFIER`: Next challenge is to supply `PASSWORD\_CLAIM\_SIGNATURE`, `PASSWORD\_CLAIM\_SECRET_BLOCK`, and `TIMESTAMP` after the client-side SRP calculations. /// diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/internal_error_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/internal_error_exception.dart index ba19414e69..deacb16eb0 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/internal_error_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/internal_error_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.internal_error_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/invalid_email_role_access_policy_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/invalid_email_role_access_policy_exception.dart index 9593759c9c..f5c51b1a95 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/invalid_email_role_access_policy_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/invalid_email_role_access_policy_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.invalid_email_role_access_policy_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/invalid_lambda_response_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/invalid_lambda_response_exception.dart index dcfeb43424..265347fda5 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/invalid_lambda_response_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/invalid_lambda_response_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.invalid_lambda_response_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/invalid_parameter_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/invalid_parameter_exception.dart index daed39aae1..ba0823619b 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/invalid_parameter_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/invalid_parameter_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.invalid_parameter_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/invalid_password_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/invalid_password_exception.dart index e4f651a82b..52c7699f17 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/invalid_password_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/invalid_password_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.invalid_password_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/invalid_sms_role_access_policy_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/invalid_sms_role_access_policy_exception.dart index 857cce6009..15e2e29d4d 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/invalid_sms_role_access_policy_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/invalid_sms_role_access_policy_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.invalid_sms_role_access_policy_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/invalid_sms_role_trust_relationship_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/invalid_sms_role_trust_relationship_exception.dart index cf52736fff..515fc9d07d 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/invalid_sms_role_trust_relationship_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/invalid_sms_role_trust_relationship_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.invalid_sms_role_trust_relationship_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/invalid_user_pool_configuration_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/invalid_user_pool_configuration_exception.dart index 62d8b0cec2..dbf2b347dc 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/invalid_user_pool_configuration_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/invalid_user_pool_configuration_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.invalid_user_pool_configuration_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/limit_exceeded_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/limit_exceeded_exception.dart index fc3900ee8d..c4ded607b3 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/limit_exceeded_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/limit_exceeded_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.limit_exceeded_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/list_devices_request.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/list_devices_request.dart index 3b2a6f0834..07201dab3d 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/list_devices_request.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/list_devices_request.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.list_devices_request; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/list_devices_response.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/list_devices_response.dart index 8de544538a..50771c2b25 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/list_devices_response.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/list_devices_response.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.list_devices_response; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/mfa_method_not_found_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/mfa_method_not_found_exception.dart index f223bc69b0..d159df70a6 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/mfa_method_not_found_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/mfa_method_not_found_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.mfa_method_not_found_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/mfa_option_type.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/mfa_option_type.dart index e6d103c6da..c880f267c7 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/mfa_option_type.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/mfa_option_type.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.mfa_option_type; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/new_device_metadata_type.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/new_device_metadata_type.dart index 56c8dc4549..69a24a5ad4 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/new_device_metadata_type.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/new_device_metadata_type.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.new_device_metadata_type; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/not_authorized_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/not_authorized_exception.dart index 667a4e4e7e..8b8c71a14f 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/not_authorized_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/not_authorized_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.not_authorized_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/password_history_policy_violation_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/password_history_policy_violation_exception.dart deleted file mode 100644 index 8558e99e29..0000000000 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/password_history_policy_violation_exception.dart +++ /dev/null @@ -1,148 +0,0 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. -// ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas - -library amplify_auth_cognito_dart.cognito_identity_provider.model.password_history_policy_violation_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes - -import 'package:aws_common/aws_common.dart' as _i1; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; -import 'package:smithy/smithy.dart' as _i2; - -part 'password_history_policy_violation_exception.g.dart'; - -/// The message returned when a user's new password matches a previous password and doesn't comply with the password-history policy. -abstract class PasswordHistoryPolicyViolationException - with - _i1.AWSEquatable - implements - Built, - _i2.SmithyHttpException { - /// The message returned when a user's new password matches a previous password and doesn't comply with the password-history policy. - factory PasswordHistoryPolicyViolationException({String? message}) { - return _$PasswordHistoryPolicyViolationException._(message: message); - } - - /// The message returned when a user's new password matches a previous password and doesn't comply with the password-history policy. - factory PasswordHistoryPolicyViolationException.build( - [void Function(PasswordHistoryPolicyViolationExceptionBuilder) - updates]) = _$PasswordHistoryPolicyViolationException; - - const PasswordHistoryPolicyViolationException._(); - - /// Constructs a [PasswordHistoryPolicyViolationException] from a [payload] and [response]. - factory PasswordHistoryPolicyViolationException.fromResponse( - PasswordHistoryPolicyViolationException payload, - _i1.AWSBaseHttpResponse response, - ) => - payload.rebuild((b) { - b.headers = response.headers; - }); - - static const List< - _i2.SmithySerializer> - serializers = [ - PasswordHistoryPolicyViolationExceptionAwsJson11Serializer() - ]; - - @override - String? get message; - @override - _i2.ShapeId get shapeId => const _i2.ShapeId( - namespace: 'com.amazonaws.cognitoidentityprovider', - shape: 'PasswordHistoryPolicyViolationException', - ); - - @override - _i2.RetryConfig? get retryConfig => null; - - @override - @BuiltValueField(compare: false) - int get statusCode => 400; - - @override - @BuiltValueField(compare: false) - Map? get headers; - @override - Exception? get underlyingException => null; - - @override - List get props => [message]; - - @override - String toString() { - final helper = - newBuiltValueToStringHelper('PasswordHistoryPolicyViolationException') - ..add( - 'message', - message, - ); - return helper.toString(); - } -} - -class PasswordHistoryPolicyViolationExceptionAwsJson11Serializer extends _i2 - .StructuredSmithySerializer { - const PasswordHistoryPolicyViolationExceptionAwsJson11Serializer() - : super('PasswordHistoryPolicyViolationException'); - - @override - Iterable get types => const [ - PasswordHistoryPolicyViolationException, - _$PasswordHistoryPolicyViolationException, - ]; - - @override - Iterable<_i2.ShapeId> get supportedProtocols => const [ - _i2.ShapeId( - namespace: 'aws.protocols', - shape: 'awsJson1_1', - ) - ]; - - @override - PasswordHistoryPolicyViolationException deserialize( - Serializers serializers, - Iterable serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = PasswordHistoryPolicyViolationExceptionBuilder(); - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final value = iterator.current; - if (value == null) { - continue; - } - switch (key) { - case 'message': - result.message = (serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String); - } - } - - return result.build(); - } - - @override - Iterable serialize( - Serializers serializers, - PasswordHistoryPolicyViolationException object, { - FullType specifiedType = FullType.unspecified, - }) { - final result$ = []; - final PasswordHistoryPolicyViolationException(:message) = object; - if (message != null) { - result$ - ..add('message') - ..add(serializers.serialize( - message, - specifiedType: const FullType(String), - )); - } - return result$; - } -} diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/password_history_policy_violation_exception.g.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/password_history_policy_violation_exception.g.dart deleted file mode 100644 index 14462c7c57..0000000000 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/password_history_policy_violation_exception.g.dart +++ /dev/null @@ -1,101 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'password_history_policy_violation_exception.dart'; - -// ************************************************************************** -// BuiltValueGenerator -// ************************************************************************** - -class _$PasswordHistoryPolicyViolationException - extends PasswordHistoryPolicyViolationException { - @override - final String? message; - @override - final Map? headers; - - factory _$PasswordHistoryPolicyViolationException( - [void Function(PasswordHistoryPolicyViolationExceptionBuilder)? - updates]) => - (new PasswordHistoryPolicyViolationExceptionBuilder()..update(updates)) - ._build(); - - _$PasswordHistoryPolicyViolationException._({this.message, this.headers}) - : super._(); - - @override - PasswordHistoryPolicyViolationException rebuild( - void Function(PasswordHistoryPolicyViolationExceptionBuilder) - updates) => - (toBuilder()..update(updates)).build(); - - @override - PasswordHistoryPolicyViolationExceptionBuilder toBuilder() => - new PasswordHistoryPolicyViolationExceptionBuilder()..replace(this); - - @override - bool operator ==(Object other) { - if (identical(other, this)) return true; - return other is PasswordHistoryPolicyViolationException && - message == other.message; - } - - @override - int get hashCode { - var _$hash = 0; - _$hash = $jc(_$hash, message.hashCode); - _$hash = $jf(_$hash); - return _$hash; - } -} - -class PasswordHistoryPolicyViolationExceptionBuilder - implements - Builder { - _$PasswordHistoryPolicyViolationException? _$v; - - String? _message; - String? get message => _$this._message; - set message(String? message) => _$this._message = message; - - Map? _headers; - Map? get headers => _$this._headers; - set headers(Map? headers) => _$this._headers = headers; - - PasswordHistoryPolicyViolationExceptionBuilder(); - - PasswordHistoryPolicyViolationExceptionBuilder get _$this { - final $v = _$v; - if ($v != null) { - _message = $v.message; - _headers = $v.headers; - _$v = null; - } - return this; - } - - @override - void replace(PasswordHistoryPolicyViolationException other) { - ArgumentError.checkNotNull(other, 'other'); - _$v = other as _$PasswordHistoryPolicyViolationException; - } - - @override - void update( - void Function(PasswordHistoryPolicyViolationExceptionBuilder)? updates) { - if (updates != null) updates(this); - } - - @override - PasswordHistoryPolicyViolationException build() => _build(); - - _$PasswordHistoryPolicyViolationException _build() { - final _$result = _$v ?? - new _$PasswordHistoryPolicyViolationException._( - message: message, headers: headers); - replace(_$result); - return _$result; - } -} - -// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/password_reset_required_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/password_reset_required_exception.dart index 0e4500dc25..3d93fd22a1 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/password_reset_required_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/password_reset_required_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.password_reset_required_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/resend_confirmation_code_request.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/resend_confirmation_code_request.dart index 94ad518a90..4cf8678d2d 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/resend_confirmation_code_request.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/resend_confirmation_code_request.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.resend_confirmation_code_request; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/resend_confirmation_code_response.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/resend_confirmation_code_response.dart index 6a214d00dc..808df308e4 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/resend_confirmation_code_response.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/resend_confirmation_code_response.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.resend_confirmation_code_response; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/resource_not_found_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/resource_not_found_exception.dart index 925645afe5..d54f471e9e 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/resource_not_found_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/resource_not_found_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.resource_not_found_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/respond_to_auth_challenge_request.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/respond_to_auth_challenge_request.dart index 06ac52c376..6d45689bc9 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/respond_to_auth_challenge_request.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/respond_to_auth_challenge_request.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.respond_to_auth_challenge_request; // ignore_for_file: no_leading_underscores_for_library_prefixes @@ -79,16 +79,10 @@ abstract class RespondToAuthChallengeRequest /// /// SMS_MFA /// - /// `"ChallengeName": "SMS\_MFA", "ChallengeResponses": {"SMS\_MFA_CODE": "\[code\]", "USERNAME": "\[username\]"}` - /// - /// EMAIL_OTP - /// - /// `"ChallengeName": "EMAIL\_OTP", "ChallengeResponses": {"EMAIL\_OTP_CODE": "\[code\]", "USERNAME": "\[username\]"}` + /// `"ChallengeName": "SMS\_MFA", "ChallengeResponses": {"SMS\_MFA\_CODE": "\[SMS\_code\]", "USERNAME": "\[username\]"}` /// /// PASSWORD_VERIFIER /// - /// This challenge response is part of the SRP flow. Amazon Cognito requires that your application respond to this challenge within a few seconds. When the response time exceeds this period, your user pool returns a `NotAuthorizedException` error. - /// /// `"ChallengeName": "PASSWORD\_VERIFIER", "ChallengeResponses": {"PASSWORD\_CLAIM\_SIGNATURE": "\[claim\_signature\]", "PASSWORD\_CLAIM\_SECRET\_BLOCK": "\[secret\_block\]", "TIMESTAMP": \[timestamp\], "USERNAME": "\[username\]"}` /// /// Add `"DEVICE_KEY"` when you sign in with a remembered device. diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/respond_to_auth_challenge_response.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/respond_to_auth_challenge_response.dart index 8ea2f06cec..d2cef93d19 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/respond_to_auth_challenge_response.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/respond_to_auth_challenge_response.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.respond_to_auth_challenge_response; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/revoke_token_request.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/revoke_token_request.dart index 423af9fabe..7a46034d7d 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/revoke_token_request.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/revoke_token_request.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.revoke_token_request; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/revoke_token_response.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/revoke_token_response.dart index d9e99039d3..566e257c2a 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/revoke_token_response.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/revoke_token_response.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.revoke_token_response; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/set_user_mfa_preference_request.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/set_user_mfa_preference_request.dart index 04bb1ad29b..6a541e339c 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/set_user_mfa_preference_request.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/set_user_mfa_preference_request.dart @@ -1,9 +1,8 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.set_user_mfa_preference_request; // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/email_mfa_settings_type.dart'; import 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/sms_mfa_settings_type.dart'; import 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/software_token_mfa_settings_type.dart'; import 'package:aws_common/aws_common.dart' as _i2; @@ -22,13 +21,11 @@ abstract class SetUserMfaPreferenceRequest factory SetUserMfaPreferenceRequest({ SmsMfaSettingsType? smsMfaSettings, SoftwareTokenMfaSettingsType? softwareTokenMfaSettings, - EmailMfaSettingsType? emailMfaSettings, required String accessToken, }) { return _$SetUserMfaPreferenceRequest._( smsMfaSettings: smsMfaSettings, softwareTokenMfaSettings: softwareTokenMfaSettings, - emailMfaSettings: emailMfaSettings, accessToken: accessToken, ); } @@ -49,15 +46,12 @@ abstract class SetUserMfaPreferenceRequest static const List<_i1.SmithySerializer> serializers = [SetUserMfaPreferenceRequestAwsJson11Serializer()]; - /// User preferences for SMS message MFA. Activates or deactivates SMS MFA and sets it as the preferred MFA method when multiple methods are available. + /// The SMS text message multi-factor authentication (MFA) settings. SmsMfaSettingsType? get smsMfaSettings; - /// User preferences for time-based one-time password (TOTP) MFA. Activates or deactivates TOTP MFA and sets it as the preferred MFA method when multiple methods are available. + /// The time-based one-time password (TOTP) software token MFA settings. SoftwareTokenMfaSettingsType? get softwareTokenMfaSettings; - /// User preferences for email message MFA. Activates or deactivates email MFA and sets it as the preferred MFA method when multiple methods are available. To activate this setting, [advanced security features](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pool-settings-advanced-security.html) must be active in your user pool. - EmailMfaSettingsType? get emailMfaSettings; - /// A valid access token that Amazon Cognito issued to the user whose MFA preference you want to set. String get accessToken; @override @@ -67,7 +61,6 @@ abstract class SetUserMfaPreferenceRequest List get props => [ smsMfaSettings, softwareTokenMfaSettings, - emailMfaSettings, accessToken, ]; @@ -82,10 +75,6 @@ abstract class SetUserMfaPreferenceRequest 'softwareTokenMfaSettings', softwareTokenMfaSettings, ) - ..add( - 'emailMfaSettings', - emailMfaSettings, - ) ..add( 'accessToken', '***SENSITIVE***', @@ -139,11 +128,6 @@ class SetUserMfaPreferenceRequestAwsJson11Serializer value, specifiedType: const FullType(SoftwareTokenMfaSettingsType), ) as SoftwareTokenMfaSettingsType)); - case 'EmailMfaSettings': - result.emailMfaSettings.replace((serializers.deserialize( - value, - specifiedType: const FullType(EmailMfaSettingsType), - ) as EmailMfaSettingsType)); case 'AccessToken': result.accessToken = (serializers.deserialize( value, @@ -165,7 +149,6 @@ class SetUserMfaPreferenceRequestAwsJson11Serializer final SetUserMfaPreferenceRequest( :smsMfaSettings, :softwareTokenMfaSettings, - :emailMfaSettings, :accessToken ) = object; result$.addAll([ @@ -191,14 +174,6 @@ class SetUserMfaPreferenceRequestAwsJson11Serializer specifiedType: const FullType(SoftwareTokenMfaSettingsType), )); } - if (emailMfaSettings != null) { - result$ - ..add('EmailMfaSettings') - ..add(serializers.serialize( - emailMfaSettings, - specifiedType: const FullType(EmailMfaSettingsType), - )); - } return result$; } } diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/set_user_mfa_preference_request.g.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/set_user_mfa_preference_request.g.dart index fec5ce2c1e..ca68a57587 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/set_user_mfa_preference_request.g.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/set_user_mfa_preference_request.g.dart @@ -12,8 +12,6 @@ class _$SetUserMfaPreferenceRequest extends SetUserMfaPreferenceRequest { @override final SoftwareTokenMfaSettingsType? softwareTokenMfaSettings; @override - final EmailMfaSettingsType? emailMfaSettings; - @override final String accessToken; factory _$SetUserMfaPreferenceRequest( @@ -23,7 +21,6 @@ class _$SetUserMfaPreferenceRequest extends SetUserMfaPreferenceRequest { _$SetUserMfaPreferenceRequest._( {this.smsMfaSettings, this.softwareTokenMfaSettings, - this.emailMfaSettings, required this.accessToken}) : super._() { BuiltValueNullFieldError.checkNotNull( @@ -45,7 +42,6 @@ class _$SetUserMfaPreferenceRequest extends SetUserMfaPreferenceRequest { return other is SetUserMfaPreferenceRequest && smsMfaSettings == other.smsMfaSettings && softwareTokenMfaSettings == other.softwareTokenMfaSettings && - emailMfaSettings == other.emailMfaSettings && accessToken == other.accessToken; } @@ -54,7 +50,6 @@ class _$SetUserMfaPreferenceRequest extends SetUserMfaPreferenceRequest { var _$hash = 0; _$hash = $jc(_$hash, smsMfaSettings.hashCode); _$hash = $jc(_$hash, softwareTokenMfaSettings.hashCode); - _$hash = $jc(_$hash, emailMfaSettings.hashCode); _$hash = $jc(_$hash, accessToken.hashCode); _$hash = $jf(_$hash); return _$hash; @@ -81,12 +76,6 @@ class SetUserMfaPreferenceRequestBuilder SoftwareTokenMfaSettingsTypeBuilder? softwareTokenMfaSettings) => _$this._softwareTokenMfaSettings = softwareTokenMfaSettings; - EmailMfaSettingsTypeBuilder? _emailMfaSettings; - EmailMfaSettingsTypeBuilder get emailMfaSettings => - _$this._emailMfaSettings ??= new EmailMfaSettingsTypeBuilder(); - set emailMfaSettings(EmailMfaSettingsTypeBuilder? emailMfaSettings) => - _$this._emailMfaSettings = emailMfaSettings; - String? _accessToken; String? get accessToken => _$this._accessToken; set accessToken(String? accessToken) => _$this._accessToken = accessToken; @@ -98,7 +87,6 @@ class SetUserMfaPreferenceRequestBuilder if ($v != null) { _smsMfaSettings = $v.smsMfaSettings?.toBuilder(); _softwareTokenMfaSettings = $v.softwareTokenMfaSettings?.toBuilder(); - _emailMfaSettings = $v.emailMfaSettings?.toBuilder(); _accessToken = $v.accessToken; _$v = null; } @@ -126,7 +114,6 @@ class SetUserMfaPreferenceRequestBuilder new _$SetUserMfaPreferenceRequest._( smsMfaSettings: _smsMfaSettings?.build(), softwareTokenMfaSettings: _softwareTokenMfaSettings?.build(), - emailMfaSettings: _emailMfaSettings?.build(), accessToken: BuiltValueNullFieldError.checkNotNull( accessToken, r'SetUserMfaPreferenceRequest', 'accessToken')); } catch (_) { @@ -136,8 +123,6 @@ class SetUserMfaPreferenceRequestBuilder _smsMfaSettings?.build(); _$failedField = 'softwareTokenMfaSettings'; _softwareTokenMfaSettings?.build(); - _$failedField = 'emailMfaSettings'; - _emailMfaSettings?.build(); } catch (e) { throw new BuiltValueNestedFieldError( r'SetUserMfaPreferenceRequest', _$failedField, e.toString()); diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/set_user_mfa_preference_response.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/set_user_mfa_preference_response.dart index bfb06d87f1..371c315986 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/set_user_mfa_preference_response.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/set_user_mfa_preference_response.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.set_user_mfa_preference_response; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/sign_up_request.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/sign_up_request.dart index 8709755f15..c3363048cb 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/sign_up_request.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/sign_up_request.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.sign_up_request; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/sign_up_response.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/sign_up_response.dart index 5c5dc0cf4c..c20050a0b7 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/sign_up_response.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/sign_up_response.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.sign_up_response; // ignore_for_file: no_leading_underscores_for_library_prefixes @@ -57,7 +57,7 @@ abstract class SignUpResponse /// The code delivery details returned by the server response to the user registration request. CodeDeliveryDetailsType? get codeDeliveryDetails; - /// The 128-bit ID of the authenticated user. This isn't the same as `username`. + /// The UUID of the authenticated user. This isn't the same as `username`. String get userSub; @override List get props => [ diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/sms_mfa_settings_type.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/sms_mfa_settings_type.dart index c69f645d76..5fbcc78d0a 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/sms_mfa_settings_type.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/sms_mfa_settings_type.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.sms_mfa_settings_type; // ignore_for_file: no_leading_underscores_for_library_prefixes @@ -45,7 +45,7 @@ abstract class SmsMfaSettingsType ..preferredMfa = false; } - /// Specifies whether SMS message MFA is activated. If an MFA type is activated for a user, the user will be prompted for MFA during all sign-in attempts, unless device tracking is turned on and the device has been trusted. + /// Specifies whether SMS text message MFA is activated. If an MFA type is activated for a user, the user will be prompted for MFA during all sign-in attempts, unless device tracking is turned on and the device has been trusted. bool get enabled; /// Specifies whether SMS is the preferred MFA method. diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/software_token_mfa_not_found_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/software_token_mfa_not_found_exception.dart index b3e013dc50..b886706039 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/software_token_mfa_not_found_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/software_token_mfa_not_found_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.software_token_mfa_not_found_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/software_token_mfa_settings_type.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/software_token_mfa_settings_type.dart index 1aee62a4d4..25cfafd5a3 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/software_token_mfa_settings_type.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/software_token_mfa_settings_type.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.software_token_mfa_settings_type; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/too_many_failed_attempts_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/too_many_failed_attempts_exception.dart index df9e4d77e4..c487f39ff6 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/too_many_failed_attempts_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/too_many_failed_attempts_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.too_many_failed_attempts_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/too_many_requests_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/too_many_requests_exception.dart index dcf1d32175..b1cb3aaa5f 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/too_many_requests_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/too_many_requests_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.too_many_requests_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/unauthorized_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/unauthorized_exception.dart index e5c09b5106..50ecabe32d 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/unauthorized_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/unauthorized_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.unauthorized_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/unexpected_lambda_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/unexpected_lambda_exception.dart index 474492765a..34a02e236b 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/unexpected_lambda_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/unexpected_lambda_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.unexpected_lambda_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/unsupported_operation_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/unsupported_operation_exception.dart index 0e4b511b26..c31068e2ae 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/unsupported_operation_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/unsupported_operation_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.unsupported_operation_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/unsupported_token_type_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/unsupported_token_type_exception.dart index acff97bd7d..2979954ab5 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/unsupported_token_type_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/unsupported_token_type_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.unsupported_token_type_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/update_device_status_request.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/update_device_status_request.dart index 3c50ce8453..1935e80768 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/update_device_status_request.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/update_device_status_request.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.update_device_status_request; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/update_device_status_response.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/update_device_status_response.dart index 81f5daaa34..970c2e9b97 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/update_device_status_response.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/update_device_status_response.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.update_device_status_response; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/update_user_attributes_request.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/update_user_attributes_request.dart index 50c621fa40..49238c60f8 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/update_user_attributes_request.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/update_user_attributes_request.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.update_user_attributes_request; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/update_user_attributes_response.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/update_user_attributes_response.dart index 65a464efff..a8dbfabd2c 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/update_user_attributes_response.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/update_user_attributes_response.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.update_user_attributes_response; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/user_context_data_type.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/user_context_data_type.dart index f98d85cfd4..5f214b4004 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/user_context_data_type.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/user_context_data_type.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.user_context_data_type; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/user_lambda_validation_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/user_lambda_validation_exception.dart index 19a37c5299..225e45dbca 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/user_lambda_validation_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/user_lambda_validation_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.user_lambda_validation_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/user_not_confirmed_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/user_not_confirmed_exception.dart index 1ba1c2d2e8..a75f0605f2 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/user_not_confirmed_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/user_not_confirmed_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.user_not_confirmed_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/user_not_found_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/user_not_found_exception.dart index 060958dac4..9d0d33889c 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/user_not_found_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/user_not_found_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.user_not_found_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/username_exists_exception.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/username_exists_exception.dart index 6a5e063454..0d1ad7b19b 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/username_exists_exception.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/username_exists_exception.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.username_exists_exception; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/verify_software_token_request.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/verify_software_token_request.dart index b880b6ff91..78199373a4 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/verify_software_token_request.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/verify_software_token_request.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.verify_software_token_request; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/verify_software_token_response.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/verify_software_token_response.dart index 5084e7f717..706fc241fe 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/verify_software_token_response.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/verify_software_token_response.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.verify_software_token_response; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/verify_software_token_response_type.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/verify_software_token_response_type.dart index 5de62aad58..4fa5346f09 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/verify_software_token_response_type.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/verify_software_token_response_type.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.verify_software_token_response_type; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/verify_user_attribute_request.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/verify_user_attribute_request.dart index 0ab9eb603b..7603269bcb 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/verify_user_attribute_request.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/verify_user_attribute_request.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.verify_user_attribute_request; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/verify_user_attribute_response.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/verify_user_attribute_response.dart index 2bd2b4cd53..79883fe9ed 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/verify_user_attribute_response.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/model/verify_user_attribute_response.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.model.verify_user_attribute_response; // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/operation/associate_software_token_operation.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/operation/associate_software_token_operation.dart index a59df7d709..8a63714d88 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/operation/associate_software_token_operation.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/operation/associate_software_token_operation.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.operation.associate_software_token_operation; // ignore_for_file: no_leading_underscores_for_library_prefixes @@ -23,7 +23,7 @@ import 'package:smithy_aws/smithy_aws.dart' as _i3; /// Begins setup of time-based one-time password (TOTP) multi-factor authentication (MFA) for a user, with a unique private key that Amazon Cognito generates and returns in the API response. You can authorize an `AssociateSoftwareToken` request with either the user's access token, or a session string from a challenge response that you received from Amazon Cognito. /// -/// Amazon Cognito disassociates an existing software token when you verify the new token in a [VerifySoftwareToken](https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_VerifySoftwareToken.html) API request. If you don't verify the software token and your user pool doesn't require MFA, the user can then authenticate with user name and password credentials alone. If your user pool requires TOTP MFA, Amazon Cognito generates an `MFA_SETUP` or `SOFTWARE\_TOKEN\_SETUP` challenge each time your user signs in. Complete setup with `AssociateSoftwareToken` and `VerifySoftwareToken`. +/// Amazon Cognito disassociates an existing software token when you verify the new token in a [VerifySoftwareToken](https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_VerifySoftwareToken.html) API request. If you don't verify the software token and your user pool doesn't require MFA, the user can then authenticate with user name and password credentials alone. If your user pool requires TOTP MFA, Amazon Cognito generates an `MFA_SETUP` or `SOFTWARE\_TOKEN\_SETUP` challenge each time your user signs. Complete setup with `AssociateSoftwareToken` and `VerifySoftwareToken`. /// /// After you set up software token MFA for your user, Amazon Cognito generates a `SOFTWARE\_TOKEN\_MFA` challenge when they authenticate. Respond to this challenge with your user's TOTP. /// @@ -35,7 +35,7 @@ class AssociateSoftwareTokenOperation extends _i1.HttpOperation< AssociateSoftwareTokenResponse> { /// Begins setup of time-based one-time password (TOTP) multi-factor authentication (MFA) for a user, with a unique private key that Amazon Cognito generates and returns in the API response. You can authorize an `AssociateSoftwareToken` request with either the user's access token, or a session string from a challenge response that you received from Amazon Cognito. /// - /// Amazon Cognito disassociates an existing software token when you verify the new token in a [VerifySoftwareToken](https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_VerifySoftwareToken.html) API request. If you don't verify the software token and your user pool doesn't require MFA, the user can then authenticate with user name and password credentials alone. If your user pool requires TOTP MFA, Amazon Cognito generates an `MFA_SETUP` or `SOFTWARE\_TOKEN\_SETUP` challenge each time your user signs in. Complete setup with `AssociateSoftwareToken` and `VerifySoftwareToken`. + /// Amazon Cognito disassociates an existing software token when you verify the new token in a [VerifySoftwareToken](https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_VerifySoftwareToken.html) API request. If you don't verify the software token and your user pool doesn't require MFA, the user can then authenticate with user name and password credentials alone. If your user pool requires TOTP MFA, Amazon Cognito generates an `MFA_SETUP` or `SOFTWARE\_TOKEN\_SETUP` challenge each time your user signs. Complete setup with `AssociateSoftwareToken` and `VerifySoftwareToken`. /// /// After you set up software token MFA for your user, Amazon Cognito generates a `SOFTWARE\_TOKEN\_MFA` challenge when they authenticate. Respond to this challenge with your user's TOTP. /// @@ -76,7 +76,7 @@ class AssociateSoftwareTokenOperation extends _i1.HttpOperation< credentialsProvider: _credentialsProvider, isOptional: true, ), - const _i1.WithUserAgent('aws-sdk-dart/0.3.2'), + const _i1.WithUserAgent('aws-sdk-dart/0.3.1'), const _i3.WithSdkInvocationId(), const _i3.WithSdkRequest(), ] + diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/operation/change_password_operation.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/operation/change_password_operation.dart index 7b6f0b0a20..81918f776a 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/operation/change_password_operation.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/operation/change_password_operation.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.operation.change_password_operation; // ignore_for_file: no_leading_underscores_for_library_prefixes @@ -15,7 +15,6 @@ import 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/ import 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/invalid_password_exception.dart'; import 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/limit_exceeded_exception.dart'; import 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/not_authorized_exception.dart'; -import 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/password_history_policy_violation_exception.dart'; import 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/password_reset_required_exception.dart'; import 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/resource_not_found_exception.dart'; import 'package:amplify_auth_cognito_dart/src/sdk/src/cognito_identity_provider/model/too_many_requests_exception.dart'; @@ -71,7 +70,7 @@ class ChangePasswordOperation extends _i1.HttpOperation( - _i1.ShapeId( - namespace: 'com.amazonaws.cognitoidentityprovider', - shape: 'PasswordHistoryPolicyViolationException', - ), - _i1.ErrorKind.client, - PasswordHistoryPolicyViolationException, - statusCode: 400, - builder: PasswordHistoryPolicyViolationException.fromResponse, - ), _i1.SmithyError( _i1.ShapeId( diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/operation/confirm_device_operation.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/operation/confirm_device_operation.dart index 5e6c9a0969..27c5bc8073 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/operation/confirm_device_operation.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/operation/confirm_device_operation.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.operation.confirm_device_operation; // ignore_for_file: no_leading_underscores_for_library_prefixes @@ -72,7 +72,7 @@ class ConfirmDeviceOperation extends _i1.HttpOperation( - _i1.ShapeId( - namespace: 'com.amazonaws.cognitoidentityprovider', - shape: 'PasswordHistoryPolicyViolationException', - ), - _i1.ErrorKind.client, - PasswordHistoryPolicyViolationException, - statusCode: 400, - builder: PasswordHistoryPolicyViolationException.fromResponse, - ), _i1.SmithyError( _i1.ShapeId( namespace: 'com.amazonaws.cognitoidentityprovider', diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/operation/confirm_sign_up_operation.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/operation/confirm_sign_up_operation.dart index dd03525a4f..9d62149fbf 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/operation/confirm_sign_up_operation.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/operation/confirm_sign_up_operation.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.operation.confirm_sign_up_operation; // ignore_for_file: no_leading_underscores_for_library_prefixes @@ -74,7 +74,7 @@ class ConfirmSignUpOperation extends _i1.HttpOperation { /// Calling this API causes a message to be sent to the end user with a confirmation code that is required to change the user's password. For the `Username` parameter, you can use the username or user alias. The method used to send the confirmation code is sent according to the specified AccountRecoverySetting. For more information, see [Recovering User Accounts](https://docs.aws.amazon.com/cognito/latest/developerguide/how-to-recover-a-user-account.html) in the _Amazon Cognito Developer Guide_. To use the confirmation code for resetting the password, call [ConfirmForgotPassword](https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_ConfirmForgotPassword.html). @@ -52,7 +52,7 @@ class ForgotPasswordOperation extends _i1.HttpOperation { /// Initiates sign-in for a user in the Amazon Cognito user directory. You can't sign in a user with a federated IdP with `InitiateAuth`. For more information, see [Adding user pool sign-in through a third party](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-identity-federation.html). @@ -45,7 +44,7 @@ class InitiateAuthOperation extends _i1.HttpOperation( - _i1.ShapeId( - namespace: 'com.amazonaws.cognitoidentityprovider', - shape: 'InvalidEmailRoleAccessPolicyException', - ), - _i1.ErrorKind.client, - InvalidEmailRoleAccessPolicyException, - statusCode: 400, - builder: InvalidEmailRoleAccessPolicyException.fromResponse, - ), _i1.SmithyError( _i1.ShapeId( diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/operation/list_devices_operation.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/operation/list_devices_operation.dart index e9087a8151..3c17fd4b17 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/operation/list_devices_operation.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/operation/list_devices_operation.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.operation.list_devices_operation; // ignore_for_file: no_leading_underscores_for_library_prefixes @@ -69,7 +69,7 @@ class ListDevicesOperation extends _i1.HttpOperation( - _i1.ShapeId( - namespace: 'com.amazonaws.cognitoidentityprovider', - shape: 'InvalidEmailRoleAccessPolicyException', - ), - _i1.ErrorKind.client, - InvalidEmailRoleAccessPolicyException, - statusCode: 400, - builder: InvalidEmailRoleAccessPolicyException.fromResponse, - ), _i1.SmithyError( _i1.ShapeId( @@ -287,17 +274,6 @@ class RespondToAuthChallengeOperation extends _i1.HttpOperation< statusCode: 403, builder: NotAuthorizedException.fromResponse, ), - _i1.SmithyError( - _i1.ShapeId( - namespace: 'com.amazonaws.cognitoidentityprovider', - shape: 'PasswordHistoryPolicyViolationException', - ), - _i1.ErrorKind.client, - PasswordHistoryPolicyViolationException, - statusCode: 400, - builder: PasswordHistoryPolicyViolationException.fromResponse, - ), _i1.SmithyError( _i1.ShapeId( diff --git a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/operation/revoke_token_operation.dart b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/operation/revoke_token_operation.dart index e7878fd5f7..7ae9abe992 100644 --- a/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/operation/revoke_token_operation.dart +++ b/packages/auth/amplify_auth_cognito_dart/lib/src/sdk/src/cognito_identity_provider/operation/revoke_token_operation.dart @@ -1,4 +1,4 @@ -// Generated with smithy-dart 0.3.2. DO NOT MODIFY. +// Generated with smithy-dart 0.3.1. DO NOT MODIFY. // ignore_for_file: avoid_unused_constructor_parameters,deprecated_member_use_from_same_package,non_constant_identifier_names,require_trailing_commas library amplify_auth_cognito_dart.cognito_identity_provider.operation.revoke_token_operation; // ignore_for_file: no_leading_underscores_for_library_prefixes @@ -62,7 +62,7 @@ class RevokeTokenOperation extends _i1.HttpOperation { /// Registers the user in the specified user pool and creates a user name, password, and user attributes. @@ -45,7 +45,7 @@ class SignUpOperation extends _i1.HttpOperation switch (type) { 'SOFTWARE_TOKEN_MFA' => MfaType.totp, 'SMS_MFA' => MfaType.sms, - 'EMAIL_OTP' => MfaType.email, _ => () { logger.error('Unrecognized MFA type: $type'); return null; @@ -326,12 +325,10 @@ final class SignInStateMachine createSmsMfaRequest(event), ChallengeNameType.softwareTokenMfa when hasUserResponse => createSoftwareTokenMfaRequest(event), - ChallengeNameType.emailOtp when hasUserResponse => - createEmailOtpRequest(event), ChallengeNameType.selectMfaType when hasUserResponse => createSelectMfaRequest(event), ChallengeNameType.mfaSetup when hasUserResponse => - handleMfaSetup(event: event), + createMfaSetupRequest(event), ChallengeNameType.newPasswordRequired when hasUserResponse => createNewPasswordRequest(event), _ => null, @@ -452,24 +449,6 @@ final class SignInStateMachine }); } - /// Creates the response object for an Email MFA challenge. - @protected - Future createEmailOtpRequest( - SignInRespondToChallenge event, - ) async { - _enableMfaType = MfaType.email; - return RespondToAuthChallengeRequest.build((b) { - b - ..clientId = _authOutputs.userPoolClientId - ..challengeName = _challengeName - ..challengeResponses.addAll({ - CognitoConstants.challengeParamUsername: cognitoUsername, - CognitoConstants.challengeParamEmailOtpCode: event.answer, - }) - ..clientMetadata.addAll(event.clientMetadata); - }); - } - /// Creates the response object for a new password challenge. @protected Future createNewPasswordRequest( @@ -651,64 +630,9 @@ final class SignInStateMachine } } - /// Handles the MFA setup challenge. - @protected - Future handleMfaSetup({ - SignInEvent? event, - }) async { - final allowedMfaTypes = _allowedMfaTypes; - // Exclude MfaType.sms from consideration - final mfaTypesForSetup = allowedMfaTypes?.difference({MfaType.sms}); - if (mfaTypesForSetup == null || mfaTypesForSetup.isEmpty) { - throw const InvalidUserPoolConfigurationException( - 'No eligible MFA types are allowed for setup.', - recoverySuggestion: 'Check your user pool MFA configuration.', - ); - } - - if (event == null) { - throw StateError('Event cannot be null when there is user response.'); - } - if (event is! SignInRespondToChallenge) { - throw StateError('Expected SignInRespondToChallenge event.'); - } - - if (_enableMfaType == null && _totpSetupResult == null) { - // User has just selected the MFA type - final selection = event.answer.toLowerCase(); - _enableMfaType = switch (selection) { - 'totp' => MfaType.totp, - 'email' => MfaType.email, - _ => throw const InvalidParameterException('Invalid MFA type selected'), - }; - - final challengeResponses = { - CognitoConstants.challengeParamMfasCanSetup: - _enableMfaType == MfaType.totp - ? '["SOFTWARE_TOKEN_MFA"]' - : '["EMAIL_OTP"]', - }; - _challengeParameters = BuiltMap(challengeResponses); - await _processChallenge(); - return null; - } - - // totp mfa method was already selected - if (mfaTypesForSetup.length == 1 && - mfaTypesForSetup.contains(MfaType.totp) && - _totpSetupResult != null) { - await createSoftwareTokenMfaRequest(event); - } - - // User has provided the verification code - return _enableMfaType == MfaType.totp - ? createTotpMfaSetupRequest(event) - : createEmailMfaSetupRequest(event); - } - /// Completes set up of a TOTP MFA. @protected - Future createTotpMfaSetupRequest( + Future createMfaSetupRequest( SignInRespondToChallenge event, ) async { await verifySoftwareToken( @@ -729,24 +653,6 @@ final class SignInStateMachine }); } - /// Compeletes set up of an email MFA. - @protected - Future createEmailMfaSetupRequest( - SignInRespondToChallenge event, - ) async { - _enableMfaType = MfaType.email; - return RespondToAuthChallengeRequest.build((b) { - b - ..challengeName = ChallengeNameType.mfaSetup - ..challengeResponses.addAll({ - CognitoConstants.challengeParamUsername: cognitoUsername, - CognitoConstants.challengeParamEmail: event.answer, - }) - ..clientId = _authOutputs.userPoolClientId - ..clientMetadata.addAll(event.clientMetadata); - }); - } - /// Selects an MFA type to use for sign-in. @protected Future createSelectMfaRequest( @@ -761,8 +667,7 @@ final class SignInStateMachine CognitoConstants.challengeParamAnswer: switch (selection) { 'sms' => 'SMS_MFA', 'totp' => 'SOFTWARE_TOKEN_MFA', - 'email' => 'EMAIL_OTP', - _ => throw ArgumentError('Must be either SMS, Email, or TOTP'), + _ => throw ArgumentError('Must be either SMS or TOTP'), }, }) ..clientId = _authOutputs.userPoolClientId @@ -1029,8 +934,6 @@ final class SignInStateMachine accessToken: accessToken, sms: enableMfaType == MfaType.sms ? MfaPreference.enabled : null, totp: enableMfaType == MfaType.totp ? MfaPreference.enabled : null, - email: - enableMfaType == MfaType.email ? MfaPreference.enabled : null, ); } on Exception catch (e, st) { logger.error( @@ -1053,20 +956,14 @@ final class SignInStateMachine if (_allowedMfaTypes case final allowedMfaTypes? when _challengeParameters .containsKey(CognitoConstants.challengeParamMfasCanSetup)) { - if (!allowedMfaTypes.contains(MfaType.totp) && - !allowedMfaTypes.contains(MfaType.email)) { + if (!allowedMfaTypes.contains(MfaType.totp)) { throw const InvalidUserPoolConfigurationException( - 'Cannot enable SMS MFA and TOTP or EMAIL MFA is not allowed', + 'Cannot enable SMS MFA and TOTP MFA is not allowed', recoverySuggestion: - 'Contact an administrator to enable SMS MFA or allow TOTP or EMAIL MFA', + 'Contact an administrator to enable SMS MFA or allow TOTP MFA', ); } - final allowedMfaSetupTypes = [...?_allowedMfaTypes]..remove(MfaType.sms); - if (allowedMfaSetupTypes.length == 1 && - allowedMfaSetupTypes.first == MfaType.totp && - _totpSetupResult == null) { - _totpSetupResult = await associateSoftwareToken(accessToken: _session); - } + _totpSetupResult ??= await associateSoftwareToken(); } // Query the state machine for a response given potential user input in diff --git a/packages/auth/amplify_auth_cognito_dart/pubspec.yaml b/packages/auth/amplify_auth_cognito_dart/pubspec.yaml index de771d1de6..c60f314f78 100644 --- a/packages/auth/amplify_auth_cognito_dart/pubspec.yaml +++ b/packages/auth/amplify_auth_cognito_dart/pubspec.yaml @@ -1,6 +1,6 @@ name: amplify_auth_cognito_dart description: A Dart-only implementation of the Amplify Auth plugin for Cognito. -version: 0.11.7 +version: 0.11.6 homepage: https://docs.amplify.aws/lib/q/platform/flutter/ repository: https://github.com/aws-amplify/amplify-flutter/tree/next/packages/auth/amplify_auth_cognito_dart issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues @@ -9,8 +9,8 @@ environment: sdk: ^3.3.0 dependencies: - amplify_analytics_pinpoint_dart: ">=0.4.6 <0.5.0" - amplify_core: ">=2.5.0 <2.6.0" + amplify_analytics_pinpoint_dart: ">=0.4.5 <0.5.0" + amplify_core: ">=2.4.2 <2.5.0" amplify_secure_storage_dart: ">=0.5.3 <0.6.0" async: ^2.10.0 aws_common: ">=0.7.4 <0.8.0" diff --git a/packages/authenticator/amplify_authenticator/CHANGELOG.md b/packages/authenticator/amplify_authenticator/CHANGELOG.md index eda1931983..65b285f298 100644 --- a/packages/authenticator/amplify_authenticator/CHANGELOG.md +++ b/packages/authenticator/amplify_authenticator/CHANGELOG.md @@ -1,8 +1,3 @@ -## 2.3.0 - -### Features -- feat(auth, authenticator): Add support for Email OTP MFA ([#5449](https://github.com/aws-amplify/amplify-flutter/pull/5449)) (#5472) - ## 2.2.0 ### Features diff --git a/packages/authenticator/amplify_authenticator/example/integration_test/main_test.dart b/packages/authenticator/amplify_authenticator/example/integration_test/main_test.dart index 2fd7c73508..fa1cbc1f8a 100644 --- a/packages/authenticator/amplify_authenticator/example/integration_test/main_test.dart +++ b/packages/authenticator/amplify_authenticator/example/integration_test/main_test.dart @@ -13,14 +13,9 @@ import 'http_test.dart' as http_tests; import 'reset_password_test.dart' as reset_password_tests; import 'sign_in_force_new_password_test.dart' as sign_in_force_new_password_tests; -import 'sign_in_mfa_email_test.dart' as sign_in_mfa_email_tests; -import 'sign_in_mfa_email_totp_test.dart' as sign_in_mfa_email_totp_tests; -import 'sign_in_mfa_sms_email_test.dart' as sign_in_mfa_sms_email_tests; import 'sign_in_mfa_sms_test.dart' as sign_in_mfa_sms_tests; import 'sign_in_mfa_sms_totp_test.dart' as sign_in_mfa_sms_totp_tests; import 'sign_in_mfa_totp_test.dart' as sign_in_mfa_totp_tests; -import 'sign_in_mfa_username_login_test.dart' - as sign_in_mfa_username_login_tests; import 'sign_in_with_email_test.dart' as sign_in_with_email_tests; import 'sign_in_with_phone_test.dart' as sign_in_with_phone_tests; import 'sign_in_with_username_test.dart' as sign_in_with_username_tests; @@ -50,10 +45,6 @@ void main() { sign_in_with_email_tests.main(); sign_in_with_phone_tests.main(); sign_in_with_username_tests.main(); - sign_in_mfa_email_tests.main(); - sign_in_mfa_email_totp_tests.main(); - sign_in_mfa_sms_email_tests.main(); - sign_in_mfa_username_login_tests.main(); sign_out_tests.main(); sign_up_with_email_tests.main(); sign_up_with_email_with_lambda_trigger_tests.main(); diff --git a/packages/authenticator/amplify_authenticator/example/integration_test/sign_in_mfa_email_test.dart b/packages/authenticator/amplify_authenticator/example/integration_test/sign_in_mfa_email_test.dart deleted file mode 100644 index f7c6986312..0000000000 --- a/packages/authenticator/amplify_authenticator/example/integration_test/sign_in_mfa_email_test.dart +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -import 'package:amplify_auth_integration_test/amplify_auth_integration_test.dart'; -import 'package:amplify_authenticator_test/amplify_authenticator_test.dart'; -import 'package:amplify_flutter/amplify_flutter.dart'; -import 'package:amplify_integration_test/amplify_integration_test.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'test_runner.dart'; -import 'utils/test_utils.dart'; - -void main() { - testRunner.setupTests(); - - group('sign-in-email-mfa', () { - testRunner.withEnvironment(mfaRequiredEmail, (env) { - // Scenario: Sign in using a valid email MFA code - testWidgets('Sign in with valid EMAIL MFA code', (tester) async { - final username = env.generateUsername(); - final password = generatePassword(); - - await adminCreateUser( - username, - password, - autoConfirm: true, - attributes: { - AuthUserAttributeKey.email: username, - }, - autoFillAttributes: false, - ); - - await loadAuthenticator(tester: tester); - - expect( - tester.bloc.stream, - emitsInOrder([ - UnauthenticatedState.signIn, - UnauthenticatedState.confirmSignInWithOtpCode, - isA(), - UnauthenticatedState.signIn, - UnauthenticatedState.confirmSignInWithOtpCode, - isA(), - emitsDone, - ]), - ); - - final signInPage = SignInPage(tester: tester); - final confirmSignInPage = ConfirmSignInPage(tester: tester); - - final otpResult = await getOtpCode( - env.getLoginAttribute(username), - ); - - // When I type my "username" - await signInPage.enterUsername(username); - - // And I type my password - await signInPage.enterPassword(password); - - // And I click the "Sign in" button - await signInPage.submitSignIn(); - - // Then I will be redirected to the email MFA code page - await confirmSignInPage.expectConfirmSignInWithOtpCodeIsPresent(); - - // And I type a valid EMAIL OTP code - await confirmSignInPage.enterVerificationCode(await otpResult.code); - - // And I click the "Confirm" button - await confirmSignInPage.submitConfirmSignIn(); - - // Then I see the authenticated app - await signInPage.expectAuthenticated(); - - // When I sign out using Auth.signOut() - await Amplify.Auth.signOut(); - await tester.pumpAndSettle(); - - final otpResult2 = await getOtpCode( - env.getLoginAttribute(username), - ); - - // Then I see the sign in page - signInPage.expectUsername(label: 'Email'); - - // When I type my "username" - await signInPage.enterUsername(username); - - // And I type my password - await signInPage.enterPassword(password); - - // And I click the "Sign in" button - await signInPage.submitSignIn(); - - // Then I will be redirected to the EMAIL OTP code page - await confirmSignInPage.expectConfirmSignInWithOtpCodeIsPresent(); - - // When I type a valid EMAIL OTP code - await confirmSignInPage.enterVerificationCode(await otpResult2.code); - - // And I click the "Confirm" button - await confirmSignInPage.submitConfirmSignIn(); - - // Then I see the authenticated app - await signInPage.expectAuthenticated(); - - await tester.bloc.close(); - }); - - // Scenario: Sign in using an invalid email MFA code - testWidgets('Sign in with invalid EMAIL MFA code', (tester) async { - final username = env.generateUsername(); - final password = generatePassword(); - - await adminCreateUser( - username, - password, - autoConfirm: true, - attributes: { - AuthUserAttributeKey.email: username, - }, - autoFillAttributes: false, - ); - - await loadAuthenticator(tester: tester); - - expect( - tester.bloc.stream, - emitsInOrder([ - UnauthenticatedState.signIn, - UnauthenticatedState.confirmSignInWithOtpCode, - emitsDone, - ]), - ); - - final signInPage = SignInPage(tester: tester); - final confirmSignInPage = ConfirmSignInPage(tester: tester); - - // When I type my "username" - await signInPage.enterUsername(username); - - // And I type my password - await signInPage.enterPassword(password); - - // And I click the "Sign in" button - await signInPage.submitSignIn(); - - // Then I will be redirected to the EMAIL OTP code page - await confirmSignInPage.expectConfirmSignInWithOtpCodeIsPresent(); - - // And I type an invalid confirmation code - await confirmSignInPage.enterVerificationCode('123456'); - - // And I click the "Confirm" button - await confirmSignInPage.submitConfirmSignIn(); - - // Then I see "The code entered is not correct." - confirmSignInPage.expectInvalidVerificationCode(); - - await tester.bloc.close(); - }); - }); - }); -} diff --git a/packages/authenticator/amplify_authenticator/example/integration_test/sign_in_mfa_email_totp_test.dart b/packages/authenticator/amplify_authenticator/example/integration_test/sign_in_mfa_email_totp_test.dart deleted file mode 100644 index fcee99259c..0000000000 --- a/packages/authenticator/amplify_authenticator/example/integration_test/sign_in_mfa_email_totp_test.dart +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -import 'package:amplify_auth_integration_test/amplify_auth_integration_test.dart'; -import 'package:amplify_authenticator_test/amplify_authenticator_test.dart'; -import 'package:amplify_flutter/amplify_flutter.dart'; -import 'package:amplify_integration_test/amplify_integration_test.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'test_runner.dart'; -import 'utils/test_utils.dart'; - -void main() { - testRunner.setupTests(); - - group('sign-in-email-totp-mfa', () { - testRunner.withEnvironment(mfaRequiredEmailTotp, (env) { - // Scenario: Sign in using a totp code when both EMAIL and TOTP are enabled - testWidgets('can select TOTP MFA', (tester) async { - final username = env.generateUsername(); - final password = generatePassword(); - - await adminCreateUser( - username, - password, - autoConfirm: true, - verifyAttributes: false, - attributes: { - AuthUserAttributeKey.email: username, - }, - ); - - await loadAuthenticator(tester: tester); - - expect( - tester.bloc.stream, - emitsInOrder([ - UnauthenticatedState.signIn, - UnauthenticatedState.confirmSignInWithOtpCode, - isA(), - UnauthenticatedState.signIn, - isA(), - UnauthenticatedState.confirmSignInWithTotpMfaCode, - isA(), - emitsDone, - ]), - ); - - final signInPage = SignInPage(tester: tester); - final confirmSignInPage = ConfirmSignInPage(tester: tester); - - final otpResult = await getOtpCode(UserAttribute.email(username)); - - // When I type my "username" - await signInPage.enterUsername(username); - - // And I type my password - await signInPage.enterPassword(password); - - // And I click the "Sign in" button - await signInPage.submitSignIn(); - - // Then I will be redirected to the confirm email mfa page - await confirmSignInPage.expectConfirmSignInWithOtpCodeIsPresent(); - - // When I type a valid confirmation code - await confirmSignInPage.enterVerificationCode(await otpResult.code); - - // And I click the "Confirm" button - await confirmSignInPage.submitConfirmSignIn(); - - // Then I see the authenticated app - await signInPage.expectAuthenticated(); - - // When I enable TOTP for MFA instead of the default set up by cognito (EMAIL) - await setUpTotp(); - - // And I sign out using Auth.signOut() - await Amplify.Auth.signOut(); - await tester.pumpAndSettle(); - - // Then I see the sign in page - signInPage.expectEmail(); - - // When I type my "username" - await signInPage.enterUsername(username); - - // And I type my password - await signInPage.enterPassword(password); - - // And I click the "Sign in" button - await signInPage.submitSignIn(); - - // Then I will be redirected to the MFA selection page - await confirmSignInPage.expectConfirmSignInMfaSelectionIsPresent(); - - // When I select "TOTP" - await confirmSignInPage.selectMfaMethod(mfaMethod: MfaType.totp); - - // And I click the "Confirm" button - await confirmSignInPage.submitConfirmSignInMfaSelection(); - - // Then I will be redirected to the TOTP MFA code page - await confirmSignInPage.expectConfirmSignInWithTotpMfaCodeIsPresent(); - - final code_2 = await generateTotpCode(); - - // When I type a valid TOTP code - await confirmSignInPage.enterVerificationCode(code_2); - - // And I click the "Confirm" button - await confirmSignInPage.submitConfirmSignIn(); - - // Then I see the authenticated app - await signInPage.expectAuthenticated(); - - await tester.bloc.close(); - }); - - // Scenario: Sign in using a EMAIL code when both EMAIL and TOTP are enabled - testWidgets('can select EMAIL MFA', (tester) async { - final username = env.generateUsername(); - final password = generatePassword(); - - await adminCreateUser( - username, - password, - autoConfirm: true, - verifyAttributes: false, - attributes: { - AuthUserAttributeKey.email: username, - }, - ); - - await loadAuthenticator(tester: tester); - - expect( - tester.bloc.stream, - emitsInOrder([ - UnauthenticatedState.signIn, - UnauthenticatedState.confirmSignInWithOtpCode, - isA(), - UnauthenticatedState.signIn, - isA(), - UnauthenticatedState.confirmSignInWithOtpCode, - isA(), - emitsDone, - ]), - ); - - final signInPage = SignInPage(tester: tester); - final confirmSignInPage = ConfirmSignInPage(tester: tester); - - final otpResult = await getOtpCode(UserAttribute.email(username)); - - // When I type my "username" - await signInPage.enterUsername(username); - - // And I type my password - await signInPage.enterPassword(password); - - // And I click the "Sign in" button - await signInPage.submitSignIn(); - - // Then I will be redirected to the confirm email mfa page - await confirmSignInPage.expectConfirmSignInWithOtpCodeIsPresent(); - - // When I type a valid confirmation code - await confirmSignInPage.enterVerificationCode(await otpResult.code); - - // And I click the "Confirm" button - await confirmSignInPage.submitConfirmSignIn(); - - // Then I see the authenticated app - await signInPage.expectAuthenticated(); - - // When I enable TOTP for MFA instead of the default set up by cognito (EMAIL) - await setUpTotp(); - - // And I sign out using Auth.signOut() - await Amplify.Auth.signOut(); - await tester.pumpAndSettle(); - - // Then I see the sign in page - signInPage.expectEmail(); - - // When I type my "username" - await signInPage.enterUsername(username); - - // And I type my password - await signInPage.enterPassword(password); - - // And I click the "Sign in" button - await signInPage.submitSignIn(); - - // Then I will be redirected to the MFA selection page - await confirmSignInPage.expectConfirmSignInMfaSelectionIsPresent(); - - final otpResult2 = await getOtpCode(UserAttribute.email(username)); - - // When I select "EMAIL" - await confirmSignInPage.selectMfaMethod(mfaMethod: MfaType.email); - - // And I click the "Confirm" button - await confirmSignInPage.submitConfirmSignInMfaSelection(); - - // Then I will be redirected to the confirm EMAIL mfa page - await confirmSignInPage.expectConfirmSignInWithOtpCodeIsPresent(); - - // When I type a valid confirmation code - await confirmSignInPage.enterVerificationCode(await otpResult2.code); - - // And I click the "Confirm" button - await confirmSignInPage.submitConfirmSignIn(); - - // Then I see the authenticated app - await signInPage.expectAuthenticated(); - - await tester.bloc.close(); - }); - }); - }); -} diff --git a/packages/authenticator/amplify_authenticator/example/integration_test/sign_in_mfa_sms_email_test.dart b/packages/authenticator/amplify_authenticator/example/integration_test/sign_in_mfa_sms_email_test.dart deleted file mode 100644 index c01460f6d5..0000000000 --- a/packages/authenticator/amplify_authenticator/example/integration_test/sign_in_mfa_sms_email_test.dart +++ /dev/null @@ -1,218 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -import 'package:amplify_auth_cognito/amplify_auth_cognito.dart'; -import 'package:amplify_auth_integration_test/amplify_auth_integration_test.dart'; -import 'package:amplify_authenticator_test/amplify_authenticator_test.dart'; -import 'package:amplify_flutter/amplify_flutter.dart'; -import 'package:amplify_integration_test/amplify_integration_test.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'test_runner.dart'; -import 'utils/test_utils.dart'; - -void main() { - testRunner.setupTests(); - - group('sign-in-sms-totp-mfa', () { - testRunner.withEnvironment(mfaRequiredEmailSms, (env) { - // Scenario: Sign in using a totp code when both SMS and EMAIL are enabled - // Note: When email and sms are both enabled, - // one of them must be selected as preferred. - // This is different from other mfa methods and - // is expected behavior from cognito - testWidgets('can select EMAIL MFA', (tester) async { - final username = env.generateUsername(); - final password = generatePassword(); - final phoneNumber = generateUSPhoneNumber(); - - await adminCreateUser( - username, - password, - autoConfirm: true, - verifyAttributes: false, - attributes: { - AuthUserAttributeKey.phoneNumber: phoneNumber.toE164(), - AuthUserAttributeKey.email: username, - }, - ); - - await loadAuthenticator(tester: tester); - - expect( - tester.bloc.stream, - emitsInOrder([ - UnauthenticatedState.signIn, - UnauthenticatedState.confirmSignInMfa, - isA(), - UnauthenticatedState.signIn, - UnauthenticatedState.confirmSignInWithOtpCode, - isA(), - emitsDone, - ]), - ); - - final signInPage = SignInPage(tester: tester); - final confirmSignInPage = ConfirmSignInPage(tester: tester); - - final smsResult = - await getOtpCode(UserAttribute.phone(phoneNumber.toE164())); - - // When I type my "username" - await signInPage.enterUsername(username); - - // And I type my password - await signInPage.enterPassword(password); - - // And I click the "Sign in" button - await signInPage.submitSignIn(); - - // Then I will be redirected to the confirm sms mfa page - await confirmSignInPage.expectConfirmSignInMFAIsPresent(); - - // When I type a valid confirmation code - await confirmSignInPage.enterVerificationCode(await smsResult.code); - - // And I click the "Confirm" button - await confirmSignInPage.submitConfirmSignIn(); - - // Then I see the authenticated app - await signInPage.expectAuthenticated(); - - // When I enable EMAIL for MFA instead of the default set up by cognito (SMS) - await setUpEmailMfa(); - - // And I sign out using Auth.signOut() - await Amplify.Auth.signOut(); - await tester.pumpAndSettle(); - - final code_2 = await getOtpCode(env.getLoginAttribute(username)); - - // Then I see the sign in page - signInPage.expectEmail(); - - // When I type my "username" - await signInPage.enterUsername(username); - - // And I type my password - await signInPage.enterPassword(password); - - // And I click the "Sign in" button - await signInPage.submitSignIn(); - - // Then I will be redirected to the EMAIL MFA code page - await confirmSignInPage.expectConfirmSignInWithOtpCodeIsPresent(); - - // When I type a valid EMAIL MFA code - await confirmSignInPage.enterVerificationCode(await code_2.code); - - // And I click the "Confirm" button - await confirmSignInPage.submitConfirmSignIn(); - - // Then I see the authenticated app - await signInPage.expectAuthenticated(); - - await tester.bloc.close(); - }); - - // Scenario: Sign in using a SMS code when both SMS and TOTP are enabled - testWidgets('can select SMS MFA', (tester) async { - final username = env.generateUsername(); - final password = generatePassword(); - final phoneNumber = generateUSPhoneNumber(); - - await adminCreateUser( - username, - password, - autoConfirm: true, - verifyAttributes: false, - attributes: { - AuthUserAttributeKey.phoneNumber: phoneNumber.toE164(), - AuthUserAttributeKey.email: username, - }, - ); - - await loadAuthenticator(tester: tester); - - expect( - tester.bloc.stream, - emitsInOrder([ - UnauthenticatedState.signIn, - UnauthenticatedState.confirmSignInMfa, - isA(), - UnauthenticatedState.signIn, - UnauthenticatedState.confirmSignInMfa, - isA(), - emitsDone, - ]), - ); - - final signInPage = SignInPage(tester: tester); - final confirmSignInPage = ConfirmSignInPage(tester: tester); - - final smsResult_1 = - await getOtpCode(UserAttribute.phone(phoneNumber.toE164())); - - // When I type my "username" - await signInPage.enterUsername(username); - - // And I type my password - await signInPage.enterPassword(password); - - // And I click the "Sign in" button - await signInPage.submitSignIn(); - - // Then I will be redirected to the confirm sms mfa page - await confirmSignInPage.expectConfirmSignInMFAIsPresent(); - - // When I type a valid confirmation code - await confirmSignInPage.enterVerificationCode(await smsResult_1.code); - - // And I click the "Confirm" button - await confirmSignInPage.submitConfirmSignIn(); - - // Then I see the authenticated app - await signInPage.expectAuthenticated(); - - // When I enable EMAIL for MFA instead of the default set up by cognito (SMS) - await setUpEmailMfa(); - - final plugin = Amplify.Auth.getPlugin(AmplifyAuthCognito.pluginKey); - await plugin.updateMfaPreference(sms: MfaPreference.preferred); - - // And I sign out using Auth.signOut() - await Amplify.Auth.signOut(); - await tester.pumpAndSettle(); - - final smsResult_2 = - await getOtpCode(UserAttribute.phone(phoneNumber.toE164())); - - // Then I see the sign in page - signInPage.expectEmail(); - - // When I type my "username" - await signInPage.enterUsername(username); - - // And I type my password - await signInPage.enterPassword(password); - - // And I click the "Sign in" button - await signInPage.submitSignIn(); - - // Then I will be redirected to the confirm sms mfa page - await confirmSignInPage.expectConfirmSignInMFAIsPresent(); - - // When I type a valid confirmation code - await confirmSignInPage.enterVerificationCode(await smsResult_2.code); - - // And I click the "Confirm" button - await confirmSignInPage.submitConfirmSignIn(); - - // Then I see the authenticated app - await signInPage.expectAuthenticated(); - - await tester.bloc.close(); - }); - }); - }); -} diff --git a/packages/authenticator/amplify_authenticator/example/integration_test/sign_in_mfa_username_login_test.dart b/packages/authenticator/amplify_authenticator/example/integration_test/sign_in_mfa_username_login_test.dart deleted file mode 100644 index 823fa1ee51..0000000000 --- a/packages/authenticator/amplify_authenticator/example/integration_test/sign_in_mfa_username_login_test.dart +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -import 'package:amplify_auth_integration_test/amplify_auth_integration_test.dart'; -import 'package:amplify_authenticator_test/amplify_authenticator_test.dart'; -import 'package:amplify_flutter/amplify_flutter.dart'; -import 'package:amplify_integration_test/amplify_integration_test.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'test_runner.dart'; -import 'utils/test_utils.dart'; - -void main() { - testRunner.setupTests(); - - group('sign-in-email-totp-mfa', () { - testRunner.withEnvironment(mfaRequiredUsernameLogin, (env) { - // Scenario: Select EMAIL MFA to set up from the setup selection page - testWidgets('can select EMAIL MFA to set up', (tester) async { - final username = env.generateUsername(); - final password = generatePassword(); - final email = generateEmail(); - - await adminCreateUser( - username, - password, - autoConfirm: true, - verifyAttributes: false, - autoFillAttributes: false, - ); - - await loadAuthenticator(tester: tester); - - expect( - tester.bloc.stream, - emitsInOrder([ - UnauthenticatedState.signIn, - isA(), - UnauthenticatedState.continueSignInWithEmailMfaSetup, - UnauthenticatedState.confirmSignInWithOtpCode, - isA(), - emitsDone, - ]), - ); - - final signInPage = SignInPage(tester: tester); - final confirmSignInPage = ConfirmSignInPage(tester: tester); - final emailMfaSetupPage = EmailMfaSetupPage(tester: tester); - - final otpResult = await getOtpCode(UserAttribute.email(email)); - - // When I type my "username" - await signInPage.enterUsername(username); - - // And I type my password - await signInPage.enterPassword(password); - - // And I click the "Sign in" button - await signInPage.submitSignIn(); - - // Then I will be redirected to the MFA setup selection page - await confirmSignInPage - .expectContinueSignInWithMfaSetupSelectionIsPresent(); - - // When I select "EMAIL" - await confirmSignInPage.selectMfaSetupMethod(mfaMethod: MfaType.email); - - // And I click the "Confirm" button - await confirmSignInPage.submitConfirmSignInMfaSetupSelection(); - - // Then I will be redirected to the EMAIL MFA setup page - await emailMfaSetupPage.expectEmailMfaSetupIsPresent(); - - // When I type a valid email - await emailMfaSetupPage.enterEmail(email); - - // And I click the "Confirm" button - await emailMfaSetupPage.submitEmail(); - - // When I type a valid confirmation code - await confirmSignInPage.enterVerificationCode(await otpResult.code); - - // And I click the "Confirm" button - await confirmSignInPage.submitConfirmSignIn(); - - // Then I see the authenticated app - await signInPage.expectAuthenticated(); - - await tester.bloc.close(); - }); - - // Scenario: Select TOTP MFA to set up from the setup selection page - testWidgets('can select TOTP MFA to set up', (tester) async { - final username = env.generateUsername(); - final password = generatePassword(); - late String sharedSecret; - - await adminCreateUser( - username, - password, - autoConfirm: true, - verifyAttributes: false, - autoFillAttributes: false, - ); - - await loadAuthenticator(tester: tester); - - tester.bloc.stream.listen((event) { - if (event is ContinueSignInTotpSetup) { - sharedSecret = event.totpSetupDetails.sharedSecret; - } - }); - - expect( - tester.bloc.stream, - emitsInOrder([ - UnauthenticatedState.signIn, - isA(), - isA(), - isA(), - emitsDone, - ]), - ); - - final signInPage = SignInPage(tester: tester); - final confirmSignInPage = ConfirmSignInPage(tester: tester); - - // When I type my "username" - await signInPage.enterUsername(username); - - // And I type my password - await signInPage.enterPassword(password); - - // And I click the "Sign in" button - await signInPage.submitSignIn(); - - // Then I will be redirected to the MFA setup selection page - await confirmSignInPage - .expectContinueSignInWithMfaSetupSelectionIsPresent(); - - // When I select "TOTP" - await confirmSignInPage.selectMfaSetupMethod(mfaMethod: MfaType.totp); - - // And I click the "Confirm" button - await confirmSignInPage.submitConfirmSignInMfaSetupSelection(); - - // Then I will be redirected to the TOTP MFA setup page - await confirmSignInPage.expectSignInTotpSetupIsPresent(); - - final totpCode = await generateTotpCode(sharedSecret); - - // When I type a valid TOTP code - await confirmSignInPage.enterVerificationCode(totpCode); - - // And I click the "Confirm" button - await confirmSignInPage.submitConfirmSignIn(); - - // Then I see the authenticated app - await signInPage.expectAuthenticated(); - - await tester.bloc.close(); - }); - - // Scenario: Sign in using an invalid TOTP code - testWidgets('sign in with invalid TOTP code', (tester) async { - final username = env.generateUsername(); - final password = generatePassword(); - late String sharedSecret; - - await adminCreateUser( - username, - password, - autoConfirm: true, - verifyAttributes: false, - autoFillAttributes: false, - ); - - await loadAuthenticator(tester: tester); - - tester.bloc.stream.listen((event) { - if (event is ContinueSignInTotpSetup) { - sharedSecret = event.totpSetupDetails.sharedSecret; - } - }); - - expect( - tester.bloc.stream, - emitsInOrder([ - UnauthenticatedState.signIn, - isA(), - isA(), - isA(), - UnauthenticatedState.signIn, - UnauthenticatedState.confirmSignInWithTotpMfaCode, - emitsDone, - ]), - ); - - final signInPage = SignInPage(tester: tester); - final confirmSignInPage = ConfirmSignInPage(tester: tester); - - // When I type my "username" - await signInPage.enterUsername(username); - - // And I type my password - await signInPage.enterPassword(password); - - // And I click the "Sign in" button - await signInPage.submitSignIn(); - - // Then I will be redirected to the MFA setup selection page - await confirmSignInPage - .expectContinueSignInWithMfaSetupSelectionIsPresent(); - - // When I select "TOTP" - await confirmSignInPage.selectMfaSetupMethod(mfaMethod: MfaType.totp); - - // And I click the "Confirm" button - await confirmSignInPage.submitConfirmSignInMfaSetupSelection(); - - // Then I will be redirected to the TOTP MFA setup page - await confirmSignInPage.expectSignInTotpSetupIsPresent(); - - final totpCode = await generateTotpCode(sharedSecret); - - // When I type a valid TOTP code - await confirmSignInPage.enterVerificationCode(totpCode); - - // And I click the "Confirm" button - await confirmSignInPage.submitConfirmSignIn(); - - // Then I see the authenticated app - await signInPage.expectAuthenticated(); - - // Sign out to test invalid TOTP code during sign-in - await Amplify.Auth.signOut(); - await tester.pumpAndSettle(); - - // When I attempt to sign in again - await signInPage.enterUsername(username); - await signInPage.enterPassword(password); - await signInPage.submitSignIn(); - - // Then I will be redirected to the TOTP MFA code page - await confirmSignInPage.expectConfirmSignInWithTotpMfaCodeIsPresent(); - - // When I type an invalid TOTP code - await confirmSignInPage.enterVerificationCode('000000'); - - // And I click the "Confirm" button - await confirmSignInPage.submitConfirmSignIn(); - - // Then I see "Invalid code" error message - confirmSignInPage.expectInvalidVerificationCode(); - - await tester.bloc.close(); - }); - }); - }); -} diff --git a/packages/authenticator/amplify_authenticator/lib/amplify_authenticator.dart b/packages/authenticator/amplify_authenticator/lib/amplify_authenticator.dart index 81d94d88a8..bd71bfdf0b 100644 --- a/packages/authenticator/amplify_authenticator/lib/amplify_authenticator.dart +++ b/packages/authenticator/amplify_authenticator/lib/amplify_authenticator.dart @@ -76,9 +76,7 @@ export 'src/widgets/form.dart' ConfirmSignInMFAForm, ConfirmSignInNewPasswordForm, ContinueSignInWithMfaSelectionForm, - ContinueSignInWithMfaSetupSelectionForm, ContinueSignInWithTotpSetupForm, - ContinueSignInWithEmailMfaSetupForm, ConfirmSignUpForm, ResetPasswordForm, ConfirmResetPasswordForm, @@ -712,14 +710,9 @@ class _AuthenticatorState extends State { confirmSignInMFAForm: ConfirmSignInMFAForm(), continueSignInWithMfaSelectionForm: ContinueSignInWithMfaSelectionForm(), - continueSignInWithMfaSetupSelectionForm: - ContinueSignInWithMfaSetupSelectionForm(), continueSignInWithTotpSetupForm: ContinueSignInWithTotpSetupForm(), - continueSignInWithEmailMfaSetupForm: - ContinueSignInWithEmailMfaSetupForm(), confirmSignInWithTotpMfaCodeForm: ConfirmSignInMFAForm(), - confirmSignInWithOtpCodeForm: ConfirmSignInMFAForm(), verifyUserForm: VerifyUserForm(), confirmVerifyUserForm: ConfirmVerifyUserForm(), child: widget.child, diff --git a/packages/authenticator/amplify_authenticator/lib/src/blocs/auth/auth_bloc.dart b/packages/authenticator/amplify_authenticator/lib/src/blocs/auth/auth_bloc.dart index 00c6eb222d..4c729b9078 100644 --- a/packages/authenticator/amplify_authenticator/lib/src/blocs/auth/auth_bloc.dart +++ b/packages/authenticator/amplify_authenticator/lib/src/blocs/auth/auth_bloc.dart @@ -227,14 +227,10 @@ class StateMachineBloc yield UnauthenticatedState.confirmSignInNewPassword; case AuthSignInStep.confirmSignInWithTotpMfaCode: yield UnauthenticatedState.confirmSignInWithTotpMfaCode; - case AuthSignInStep.confirmSignInWithOtpCode: - yield UnauthenticatedState.confirmSignInWithOtpCode; case AuthSignInStep.continueSignInWithMfaSelection: yield ContinueSignInWithMfaSelection( allowedMfaTypes: result.nextStep.allowedMfaTypes, ); - case AuthSignInStep.continueSignInWithMfaSetupSelection: - yield await _handleMfaSetupSelection(result); case AuthSignInStep.continueSignInWithTotpSetup: assert( result.nextStep.totpSetupDetails != null, @@ -244,8 +240,6 @@ class StateMachineBloc result.nextStep.totpSetupDetails!, totpOptions, ); - case AuthSignInStep.continueSignInWithEmailMfaSetup: - yield UnauthenticatedState.continueSignInWithEmailMfaSetup; case AuthSignInStep.resetPassword: yield UnauthenticatedState.resetPassword; case AuthSignInStep.confirmSignUp: @@ -339,15 +333,19 @@ class StateMachineBloc allowedMfaTypes: result.nextStep.allowedMfaTypes, ), ); - case AuthSignInStep.continueSignInWithMfaSetupSelection: - _emit(await _handleMfaSetupSelection(result)); - case AuthSignInStep.continueSignInWithEmailMfaSetup: - _emit(UnauthenticatedState.continueSignInWithEmailMfaSetup); + case AuthSignInStep.continueSignInWithTotpSetup: + assert( + result.nextStep.totpSetupDetails != null, + 'Sign In Result should have totpSetupDetails', + ); + _emit( + await ContinueSignInTotpSetup.setupURI( + result.nextStep.totpSetupDetails!, + totpOptions, + ), + ); case AuthSignInStep.confirmSignInWithTotpMfaCode: _emit(UnauthenticatedState.confirmSignInWithTotpMfaCode); - case AuthSignInStep.confirmSignInWithOtpCode: - _notifyCodeSent(result.nextStep.codeDeliveryDetails?.destination); - _emit(UnauthenticatedState.confirmSignInWithOtpCode); case AuthSignInStep.resetPassword: _emit(UnauthenticatedState.confirmResetPassword); case AuthSignInStep.confirmSignUp: @@ -543,50 +541,6 @@ class StateMachineBloc yield* const Stream.empty(); } - Future _handleMfaSetupSelection( - SignInResult result, - ) async { - final allowedMfaTypes = result.nextStep.allowedMfaTypes; - - if (allowedMfaTypes == null) { - throw const InvalidUserPoolConfigurationException( - 'No MFA types are supported', - recoverySuggestion: 'Check your user pool MFA configuration.', - ); - } - - final mfaTypesForSetup = allowedMfaTypes.toSet()..remove(MfaType.sms); - - if (mfaTypesForSetup.length != 1) { - return ContinueSignInWithMfaSetupSelection( - allowedMfaTypes: allowedMfaTypes, - ); - } - - final mfaType = mfaTypesForSetup.first; - - switch (mfaType) { - case MfaType.totp: - assert( - result.nextStep.totpSetupDetails != null, - 'Sign In Result should have totpSetupDetails', - ); - return ContinueSignInTotpSetup.setupURI( - result.nextStep.totpSetupDetails!, - totpOptions, - ); - - case MfaType.email: - return UnauthenticatedState.continueSignInWithEmailMfaSetup; - - default: - throw InvalidUserPoolConfigurationException( - 'Unsupported MFA type: ${mfaType.name}', - recoverySuggestion: 'Check your user pool MFA configuration.', - ); - } - } - @override Future close() async { await Future.wait([ diff --git a/packages/authenticator/amplify_authenticator/lib/src/enums/authenticator_step.dart b/packages/authenticator/amplify_authenticator/lib/src/enums/authenticator_step.dart index 8fcc406563..a90f0f8b0a 100644 --- a/packages/authenticator/amplify_authenticator/lib/src/enums/authenticator_step.dart +++ b/packages/authenticator/amplify_authenticator/lib/src/enums/authenticator_step.dart @@ -61,29 +61,18 @@ enum AuthenticatorStep { /// an MFA method. continueSignInWithMfaSelection, - /// The user is on the Continue Sign In with MFA Setup Selection step. - /// The sign-in is not complete and the user must select an MFA method to setup. - continueSignInWithMfaSetupSelection, - /// The user is on the Continue Sign In with TOTP setup step. /// /// The sign-in is not complete and a TOTP authenticator app must be /// registered before continuing. continueSignInWithTotpSetup, - /// The sign-in is not complete and an Email MFA must be set up before - /// continuing. - continueSignInWithEmailMfaSetup, - /// The user is on the Confirm Sign In with TOTP MFA step. /// /// The sign-in is not complete and must be confirmed with a TOTP code /// from a registered authenticator app. confirmSignInWithTotpMfaCode, - /// The sign-in is not complete and must be confirmed with an email code. - confirmSignInWithOtpCode, - /// The user is on the Reset Password step. resetPassword, diff --git a/packages/authenticator/amplify_authenticator/lib/src/enums/email_setup_types.dart b/packages/authenticator/amplify_authenticator/lib/src/enums/email_setup_types.dart deleted file mode 100644 index 88252cb4e5..0000000000 --- a/packages/authenticator/amplify_authenticator/lib/src/enums/email_setup_types.dart +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -enum EmailSetupField { - email, -} diff --git a/packages/authenticator/amplify_authenticator/lib/src/enums/enums.dart b/packages/authenticator/amplify_authenticator/lib/src/enums/enums.dart index 3a4b577678..f523de2aa8 100644 --- a/packages/authenticator/amplify_authenticator/lib/src/enums/enums.dart +++ b/packages/authenticator/amplify_authenticator/lib/src/enums/enums.dart @@ -4,7 +4,6 @@ export 'authenticator_step.dart'; export 'confirm_signin_types.dart'; export 'confirm_signup_types.dart'; -export 'email_setup_types.dart'; export 'gender.dart'; export 'reset_password_field.dart'; export 'signin_types.dart'; diff --git a/packages/authenticator/amplify_authenticator/lib/src/keys.dart b/packages/authenticator/amplify_authenticator/lib/src/keys.dart index 2ad76b7c01..49510ea7cf 100644 --- a/packages/authenticator/amplify_authenticator/lib/src/keys.dart +++ b/packages/authenticator/amplify_authenticator/lib/src/keys.dart @@ -52,8 +52,6 @@ const keyCustomChallengeConfirmSignInFormField = Key('customChallengeConfirmSignInFormField'); const keyMfaMethodRadioConfirmSignInFormField = Key('mfaMethodRadioConfirmSignInFormField'); -const keyMfaSetupMethodRadioConfirmSignInFormField = - Key('mfaSetupMethodRadioConfirmSignInFormField'); const keyUsernameConfirmSignInFormField = Key('usernameConfirmSignInFormField'); const keyPasswordConfirmSignInFormField = Key('passwordConfirmSignInFormField'); const keyNewPasswordConfirmSignInFormField = @@ -109,10 +107,6 @@ const keyGoToSignInButton = Key('goToSignInButton'); const keyConfirmSignInButton = Key('confirmSignInButton'); const keyConfirmSignInMfaSelectionButton = Key('confirmSignInMfaSelectionButton'); -const keyConfirmSignInMfaSetupSelectionButton = - Key('confirmSignInMfaSetupSelectionButton'); -const keyConfirmSignInWithEmailMfaSetupButton = - Key('confirmSignInWithEmailMfaSetupButton'); const keyConfirmSignInCustomButton = Key('confirmSignInCustomButton'); const keyLostCodeButton = Key('lostCodeButton'); const keySendCodeButton = Key('sendCodeButton'); @@ -146,6 +140,3 @@ const keyAuthenticatorBanner = Key('authenticatorBanner'); const keyQrCodeTotpSetupFormField = Key('qrCodeTotpSetupFormField'); const keyCopyKeyTotpSetupFormField = Key('copyKeyTotpSetupFormField'); const keyTotpSetupFormField = Key('totpSetupFormField'); - -// Email setup form keys -const keyEmailSetupFormField = Key('emailSetupFormField'); diff --git a/packages/authenticator/amplify_authenticator/lib/src/l10n/generated/input_localizations.dart b/packages/authenticator/amplify_authenticator/lib/src/l10n/generated/input_localizations.dart index b34f12cf8e..178e5b3eeb 100644 --- a/packages/authenticator/amplify_authenticator/lib/src/l10n/generated/input_localizations.dart +++ b/packages/authenticator/amplify_authenticator/lib/src/l10n/generated/input_localizations.dart @@ -297,12 +297,6 @@ abstract class AuthenticatorInputLocalizations { /// **'Authenticator App (TOTP)'** String get selectTotp; - /// Label for the radio button to select email as the user's chosen MFA method. - /// - /// In en, this message translates to: - /// **'Email'** - String get selectEmail; - /// The instructional text for submitting a TOTP pass code /// /// In en, this message translates to: diff --git a/packages/authenticator/amplify_authenticator/lib/src/l10n/generated/input_localizations_en.dart b/packages/authenticator/amplify_authenticator/lib/src/l10n/generated/input_localizations_en.dart index 6b6d42a494..dcd9c0139c 100644 --- a/packages/authenticator/amplify_authenticator/lib/src/l10n/generated/input_localizations_en.dart +++ b/packages/authenticator/amplify_authenticator/lib/src/l10n/generated/input_localizations_en.dart @@ -153,9 +153,6 @@ class AuthenticatorInputLocalizationsEn @override String get selectTotp => 'Authenticator App (TOTP)'; - @override - String get selectEmail => 'Email'; - @override String get totpCodePrompt => 'Please enter the code from your registered Authenticator app'; diff --git a/packages/authenticator/amplify_authenticator/lib/src/l10n/generated/title_localizations.dart b/packages/authenticator/amplify_authenticator/lib/src/l10n/generated/title_localizations.dart index abe2edf4ce..6d69ec3571 100644 --- a/packages/authenticator/amplify_authenticator/lib/src/l10n/generated/title_localizations.dart +++ b/packages/authenticator/amplify_authenticator/lib/src/l10n/generated/title_localizations.dart @@ -141,24 +141,6 @@ abstract class AuthenticatorTitleLocalizations { /// **'Enter your one-time passcode'** String get confirmSignInWithTotpMfaCode; - /// Title of the Confirm Sign In with Email MFA Code step and form - /// - /// In en, this message translates to: - /// **'Enter your one-time passcode'** - String get confirmSignInWithOtpCode; - - /// Title of the Continue Sign In with Email MFA Setup step and form - /// - /// In en, this message translates to: - /// **'Add Email for Two-Factor Authentication'** - String get continueSignInWithEmailMfaSetup; - - /// Title of the Continue Sign In with MFA Setup Selection step and form - /// - /// In en, this message translates to: - /// **'Choose your preferred two-factor authentication method to set up'** - String get continueSignInWithMfaSetupSelection; - /// Title of the Reset Password step and form /// /// In en, this message translates to: diff --git a/packages/authenticator/amplify_authenticator/lib/src/l10n/generated/title_localizations_en.dart b/packages/authenticator/amplify_authenticator/lib/src/l10n/generated/title_localizations_en.dart index 938f974e9f..02fb43da7d 100644 --- a/packages/authenticator/amplify_authenticator/lib/src/l10n/generated/title_localizations_en.dart +++ b/packages/authenticator/amplify_authenticator/lib/src/l10n/generated/title_localizations_en.dart @@ -30,17 +30,6 @@ class AuthenticatorTitleLocalizationsEn @override String get confirmSignInWithTotpMfaCode => 'Enter your one-time passcode'; - @override - String get confirmSignInWithOtpCode => 'Enter your one-time passcode'; - - @override - String get continueSignInWithEmailMfaSetup => - 'Add Email for Two-Factor Authentication'; - - @override - String get continueSignInWithMfaSetupSelection => - 'Choose your preferred two-factor authentication method to set up'; - @override String get resetPassword => 'Send Code'; diff --git a/packages/authenticator/amplify_authenticator/lib/src/l10n/input_resolver.dart b/packages/authenticator/amplify_authenticator/lib/src/l10n/input_resolver.dart index 0eb96b26f1..ad9eed1b0c 100644 --- a/packages/authenticator/amplify_authenticator/lib/src/l10n/input_resolver.dart +++ b/packages/authenticator/amplify_authenticator/lib/src/l10n/input_resolver.dart @@ -33,7 +33,6 @@ enum InputField { rememberDevice, selectSms, selectTotp, - selectEmail, totpCodePrompt, usernameType, } @@ -172,11 +171,6 @@ class InputResolverKey { field: InputField.selectSms, ); - static const selectEmail = InputResolverKey._( - InputResolverKeyType.title, - field: InputField.selectEmail, - ); - static const totpCodePrompt = InputResolverKey._( InputResolverKeyType.title, field: InputField.totpCodePrompt, @@ -462,8 +456,6 @@ class InputResolver extends Resolver { return AuthenticatorLocalizations.inputsOf(context).selectSms; case InputField.selectTotp: return AuthenticatorLocalizations.inputsOf(context).selectTotp; - case InputField.selectEmail: - return AuthenticatorLocalizations.inputsOf(context).selectEmail; case InputField.totpCodePrompt: return AuthenticatorLocalizations.inputsOf(context).totpCodePrompt; case InputField.usernameType: diff --git a/packages/authenticator/amplify_authenticator/lib/src/l10n/src/inputs/inputs_en.arb b/packages/authenticator/amplify_authenticator/lib/src/l10n/src/inputs/inputs_en.arb index e32dd76731..90399598d1 100644 --- a/packages/authenticator/amplify_authenticator/lib/src/l10n/src/inputs/inputs_en.arb +++ b/packages/authenticator/amplify_authenticator/lib/src/l10n/src/inputs/inputs_en.arb @@ -216,9 +216,5 @@ "totpCodePrompt": "Please enter the code from your registered Authenticator app", "@totpCodePrompt": { "description": "The instructional text for submitting a TOTP pass code" - }, - "selectEmail": "Email", - "@selectEmail": { - "description": "Label for the radio button to select email as the user's chosen MFA method." - }, + } } diff --git a/packages/authenticator/amplify_authenticator/lib/src/l10n/title_resolver.dart b/packages/authenticator/amplify_authenticator/lib/src/l10n/title_resolver.dart index 318753c227..bbbf34925c 100644 --- a/packages/authenticator/amplify_authenticator/lib/src/l10n/title_resolver.dart +++ b/packages/authenticator/amplify_authenticator/lib/src/l10n/title_resolver.dart @@ -49,24 +49,6 @@ class TitleResolver extends Resolver { .confirmSignInWithTotpMfaCode; } - /// The title for the confirm sign in (email MFA code) Widget. - String confirmSignInWithOtpCode(BuildContext context) { - return AuthenticatorLocalizations.titlesOf(context) - .confirmSignInWithOtpCode; - } - - /// The title for the continue sign in (email MFA setup) Widget. - String continueSignInWithEmailMfaSetup(BuildContext context) { - return AuthenticatorLocalizations.titlesOf(context) - .continueSignInWithEmailMfaSetup; - } - - /// The title for the continue sign in (mfa setup selection) Widget. - String continueSignInWithMfaSetupSelection(BuildContext context) { - return AuthenticatorLocalizations.titlesOf(context) - .continueSignInWithMfaSetupSelection; - } - /// The title for the reset password Widget. String resetPassword(BuildContext context) { return AuthenticatorLocalizations.titlesOf(context).resetPassword; @@ -99,12 +81,6 @@ class TitleResolver extends Resolver { return continueSignInWithTotpSetup(context); case AuthenticatorStep.confirmSignInWithTotpMfaCode: return confirmSignInWithTotpMfaCode(context); - case AuthenticatorStep.confirmSignInWithOtpCode: - return confirmSignInWithOtpCode(context); - case AuthenticatorStep.continueSignInWithEmailMfaSetup: - return continueSignInWithEmailMfaSetup(context); - case AuthenticatorStep.continueSignInWithMfaSetupSelection: - return continueSignInWithMfaSetupSelection(context); case AuthenticatorStep.resetPassword: return resetPassword(context); case AuthenticatorStep.confirmResetPassword: diff --git a/packages/authenticator/amplify_authenticator/lib/src/screens/authenticator_screen.dart b/packages/authenticator/amplify_authenticator/lib/src/screens/authenticator_screen.dart index 2524d2cb35..181816a0ba 100644 --- a/packages/authenticator/amplify_authenticator/lib/src/screens/authenticator_screen.dart +++ b/packages/authenticator/amplify_authenticator/lib/src/screens/authenticator_screen.dart @@ -40,18 +40,6 @@ class AuthenticatorScreen extends StatelessAuthenticatorComponent { const AuthenticatorScreen.confirmSignInWithTotpMfaCode({Key? key}) : this(key: key, step: AuthenticatorStep.confirmSignInWithTotpMfaCode); - const AuthenticatorScreen.confirmSignInWithOtpCode({Key? key}) - : this(key: key, step: AuthenticatorStep.confirmSignInWithOtpCode); - - const AuthenticatorScreen.continueSignInWithEmailMfaSetup({Key? key}) - : this(key: key, step: AuthenticatorStep.continueSignInWithEmailMfaSetup); - - const AuthenticatorScreen.continueSignInWithMfaSetupSelection({Key? key}) - : this( - key: key, - step: AuthenticatorStep.continueSignInWithMfaSetupSelection, - ); - const AuthenticatorScreen.resetPassword({Key? key}) : this(key: key, step: AuthenticatorStep.resetPassword); @@ -103,9 +91,6 @@ class AuthenticatorScreen extends StatelessAuthenticatorComponent { case AuthenticatorStep.confirmResetPassword: case AuthenticatorStep.verifyUser: case AuthenticatorStep.confirmVerifyUser: - case AuthenticatorStep.confirmSignInWithOtpCode: - case AuthenticatorStep.continueSignInWithEmailMfaSetup: - case AuthenticatorStep.continueSignInWithMfaSetupSelection: child = _FormWrapperView(step: step); case AuthenticatorStep.loading: throw StateError('Invalid step: $this'); @@ -314,9 +299,6 @@ extension on AuthenticatorStep { case AuthenticatorStep.verifyUser: case AuthenticatorStep.confirmVerifyUser: case AuthenticatorStep.loading: - case AuthenticatorStep.confirmSignInWithOtpCode: - case AuthenticatorStep.continueSignInWithEmailMfaSetup: - case AuthenticatorStep.continueSignInWithMfaSetupSelection: throw StateError('Invalid step: $this'); } } diff --git a/packages/authenticator/amplify_authenticator/lib/src/state/auth_state.dart b/packages/authenticator/amplify_authenticator/lib/src/state/auth_state.dart index ed4d213700..5a948e05bf 100644 --- a/packages/authenticator/amplify_authenticator/lib/src/state/auth_state.dart +++ b/packages/authenticator/amplify_authenticator/lib/src/state/auth_state.dart @@ -46,12 +46,6 @@ class UnauthenticatedState extends AuthState static const confirmSignInWithTotpMfaCode = UnauthenticatedState( step: AuthenticatorStep.confirmSignInWithTotpMfaCode, ); - static const continueSignInWithEmailMfaSetup = UnauthenticatedState( - step: AuthenticatorStep.continueSignInWithEmailMfaSetup, - ); - static const confirmSignInWithOtpCode = UnauthenticatedState( - step: AuthenticatorStep.confirmSignInWithOtpCode, - ); static const resetPassword = UnauthenticatedState(step: AuthenticatorStep.resetPassword); static const confirmResetPassword = @@ -117,21 +111,6 @@ class ContinueSignInWithMfaSelection extends UnauthenticatedState { String get runtimeTypeName => 'ContinueSignInWithMfaSelection'; } -class ContinueSignInWithMfaSetupSelection extends UnauthenticatedState { - const ContinueSignInWithMfaSetupSelection({ - Set? allowedMfaTypes, - }) : allowedMfaTypes = allowedMfaTypes ?? const {}, - super(step: AuthenticatorStep.continueSignInWithMfaSetupSelection); - - final Set allowedMfaTypes; - - @override - List get props => [step, allowedMfaTypes]; - - @override - String get runtimeTypeName => 'ContinueSignInWithMfaSetupSelection'; -} - class ContinueSignInTotpSetup extends UnauthenticatedState { const ContinueSignInTotpSetup(this.totpSetupDetails, this.totpSetupUri) : super(step: AuthenticatorStep.continueSignInWithTotpSetup); diff --git a/packages/authenticator/amplify_authenticator/lib/src/state/authenticator_state.dart b/packages/authenticator/amplify_authenticator/lib/src/state/authenticator_state.dart index 836c4f1a01..10bdef835b 100644 --- a/packages/authenticator/amplify_authenticator/lib/src/state/authenticator_state.dart +++ b/packages/authenticator/amplify_authenticator/lib/src/state/authenticator_state.dart @@ -160,18 +160,6 @@ class AuthenticatorState extends ChangeNotifier { notifyListeners(); } - /// The value for the email MFA setup form field - /// - /// This value will be used during continue email MFA setup - String get mfaEmail => _mfaEmail; - - set mfaEmail(String value) { - _mfaEmail = value.trim(); - notifyListeners(); - } - - String _mfaEmail = ''; - MfaType? _selectedMfaMethod; TotpSetupDetails? get totpSetupDetails { @@ -407,23 +395,6 @@ class AuthenticatorState extends ChangeNotifier { _setIsBusy(false); } - /// Select MFA setup preference using the values for [selectedMfaMethod] - Future continueSignInWithMfaSetupSelection() async { - if (!_formKey.currentState!.validate()) { - return; - } - - _setIsBusy(true); - - final confirm = AuthConfirmSignInData( - confirmationValue: _selectedMfaMethod!.name, - ); - - _authBloc.add(AuthConfirmSignIn(confirm)); - await nextBlocEvent(); - _setIsBusy(false); - } - /// Complete TOTP setup using the values for [confirmationCode] /// and any user attributes. Future confirmTotp() async { @@ -443,40 +414,6 @@ class AuthenticatorState extends ChangeNotifier { _setIsBusy(false); } - /// complete Email MFA setup using the values for [confirmationCode] - Future confirmEmailMfa() async { - if (!_formKey.currentState!.validate()) { - return; - } - - _setIsBusy(true); - - final confirm = AuthConfirmSignInData( - confirmationValue: _confirmationCode.trim(), - ); - - _authBloc.add(AuthConfirmSignIn(confirm)); - await nextBlocEvent(); - _setIsBusy(false); - } - - /// Complete MFA setup using the values for [confirmationCode] - Future continueEmailMfaSetup() async { - if (!_formKey.currentState!.validate()) { - return; - } - - _setIsBusy(true); - - final confirm = AuthConfirmSignInData( - confirmationValue: _mfaEmail.trim(), - ); - - _authBloc.add(AuthConfirmSignIn(confirm)); - await nextBlocEvent(); - _setIsBusy(false); - } - /// Complete the force password change with [newPassword] Future confirmSignInNewPassword() async { if (!_formKey.currentState!.validate()) { @@ -707,7 +644,6 @@ class AuthenticatorState extends ChangeNotifier { authAttributes.clear(); _publicChallengeParams.clear(); _selectedMfaMethod = null; - _mfaEmail = ''; } void _resetFormKey() { diff --git a/packages/authenticator/amplify_authenticator/lib/src/state/inherited_forms.dart b/packages/authenticator/amplify_authenticator/lib/src/state/inherited_forms.dart index 12717df25b..a2a0dfa5ae 100644 --- a/packages/authenticator/amplify_authenticator/lib/src/state/inherited_forms.dart +++ b/packages/authenticator/amplify_authenticator/lib/src/state/inherited_forms.dart @@ -16,11 +16,8 @@ class InheritedForms extends InheritedWidget { required this.confirmResetPasswordForm, required this.confirmSignInNewPasswordForm, required this.continueSignInWithMfaSelectionForm, - required this.continueSignInWithMfaSetupSelectionForm, required this.continueSignInWithTotpSetupForm, - required this.continueSignInWithEmailMfaSetupForm, required this.confirmSignInWithTotpMfaCodeForm, - required this.confirmSignInWithOtpCodeForm, required this.verifyUserForm, required this.confirmVerifyUserForm, required super.child, @@ -33,12 +30,8 @@ class InheritedForms extends InheritedWidget { final ConfirmSignInMFAForm confirmSignInMFAForm; final ConfirmSignInNewPasswordForm confirmSignInNewPasswordForm; final ContinueSignInWithMfaSelectionForm continueSignInWithMfaSelectionForm; - final ContinueSignInWithMfaSetupSelectionForm - continueSignInWithMfaSetupSelectionForm; final ContinueSignInWithTotpSetupForm continueSignInWithTotpSetupForm; - final ContinueSignInWithEmailMfaSetupForm continueSignInWithEmailMfaSetupForm; final ConfirmSignInMFAForm confirmSignInWithTotpMfaCodeForm; - final ConfirmSignInMFAForm confirmSignInWithOtpCodeForm; final ResetPasswordForm resetPasswordForm; final ConfirmResetPasswordForm confirmResetPasswordForm; final VerifyUserForm verifyUserForm; @@ -62,16 +55,10 @@ class InheritedForms extends InheritedWidget { return confirmSignInNewPasswordForm; case AuthenticatorStep.continueSignInWithMfaSelection: return continueSignInWithMfaSelectionForm; - case AuthenticatorStep.continueSignInWithMfaSetupSelection: - return continueSignInWithMfaSetupSelectionForm; case AuthenticatorStep.continueSignInWithTotpSetup: return continueSignInWithTotpSetupForm; case AuthenticatorStep.confirmSignInWithTotpMfaCode: return confirmSignInWithTotpMfaCodeForm; - case AuthenticatorStep.continueSignInWithEmailMfaSetup: - return continueSignInWithEmailMfaSetupForm; - case AuthenticatorStep.confirmSignInWithOtpCode: - return confirmSignInWithOtpCodeForm; case AuthenticatorStep.resetPassword: return resetPasswordForm; case AuthenticatorStep.confirmResetPassword: @@ -117,13 +104,7 @@ class InheritedForms extends InheritedWidget { oldWidget.continueSignInWithTotpSetupForm != continueSignInWithTotpSetupForm || oldWidget.confirmSignInWithTotpMfaCodeForm != - confirmSignInWithTotpMfaCodeForm || - oldWidget.confirmSignInWithOtpCodeForm != - confirmSignInWithOtpCodeForm || - oldWidget.continueSignInWithEmailMfaSetupForm != - continueSignInWithEmailMfaSetupForm || - oldWidget.continueSignInWithMfaSetupSelectionForm != - continueSignInWithMfaSetupSelectionForm; + confirmSignInWithTotpMfaCodeForm; } } diff --git a/packages/authenticator/amplify_authenticator/lib/src/version.dart b/packages/authenticator/amplify_authenticator/lib/src/version.dart index 3692591227..3f25c8a68c 100644 --- a/packages/authenticator/amplify_authenticator/lib/src/version.dart +++ b/packages/authenticator/amplify_authenticator/lib/src/version.dart @@ -1,2 +1,2 @@ // Generated code. Do not modify. -const packageVersion = '2.3.0'; +const packageVersion = '2.2.0'; diff --git a/packages/authenticator/amplify_authenticator/lib/src/widgets/button.dart b/packages/authenticator/amplify_authenticator/lib/src/widgets/button.dart index ccd43114da..c2c92e87bb 100644 --- a/packages/authenticator/amplify_authenticator/lib/src/widgets/button.dart +++ b/packages/authenticator/amplify_authenticator/lib/src/widgets/button.dart @@ -253,50 +253,6 @@ class ContinueSignInMFASelectionButton extends AuthenticatorElevatedButton { state.continueSignInWithMfaSelection(); } -/// {@category Prebuilt Widgets} -/// {@template amplify_authenticator.continue_sign_in_mfa_setup_selection_button} -/// A prebuilt button for Sign In with MFA setup selection. -/// -/// Uses [ButtonResolverKey.continueLabel] for localization -/// {@endtemplate} -class ContinueSignInMFASetupSelectionButton - extends AuthenticatorElevatedButton { - /// {@macro amplify_authenticator.continue_sign_in_mfa_setup_selection_button} - const ContinueSignInMFASetupSelectionButton({Key? key}) - : super( - key: key ?? keyConfirmSignInMfaSetupSelectionButton, - ); - - @override - ButtonResolverKey get labelKey => ButtonResolverKey.continueLabel; - - @override - void onPressed(BuildContext context, AuthenticatorState state) => - state.continueSignInWithMfaSetupSelection(); -} - -/// {@category Prebuilt Widgets} -/// {@template amplify_authenticator.continue_sign_in_with_email_mfa_setup_button} -/// A prebuilt button for Sign In with Email MFA setup. -/// -/// Uses [ButtonResolverKey.continueLabel] for localization -/// {@endtemplate} -class ContinueSignInWithEmailMfaSetupButton - extends AuthenticatorElevatedButton { - /// {@macro amplify_authenticator.continue_sign_in_with_email_mfa_setup_button} - const ContinueSignInWithEmailMfaSetupButton({Key? key}) - : super( - key: key ?? keyConfirmSignInWithEmailMfaSetupButton, - ); - - @override - ButtonResolverKey get labelKey => ButtonResolverKey.continueLabel; - - @override - void onPressed(BuildContext context, AuthenticatorState state) => - state.continueEmailMfaSetup(); -} - /// {@category Prebuilt Widgets} /// {@template amplify_authenticator.confirm_sign_in_mfa_button} /// A prebuilt button for completing Sign In with and MFA code. diff --git a/packages/authenticator/amplify_authenticator/lib/src/widgets/form.dart b/packages/authenticator/amplify_authenticator/lib/src/widgets/form.dart index abad5f4369..301b61177c 100644 --- a/packages/authenticator/amplify_authenticator/lib/src/widgets/form.dart +++ b/packages/authenticator/amplify_authenticator/lib/src/widgets/form.dart @@ -544,7 +544,7 @@ class ConfirmSignInCustomAuthForm extends AuthenticatorForm { /// {@category Prebuilt Widgets} /// {@template amplify_authenticator.confirm_sign_in_mfa_form} /// A prebuilt form for completing the sign in process with an MFA code, from -/// either SMS, TOTP, or Email. +/// either SMS or TOTP. /// {@endtemplate} class ConfirmSignInMFAForm extends AuthenticatorForm { /// {@macro amplify_authenticator.confirm_sign_in_mfa_form} @@ -623,30 +623,6 @@ class ContinueSignInWithMfaSelectionForm extends AuthenticatorForm { AuthenticatorFormState(); } -/// {@category Prebuilt Widgets} -/// {@template amplify_authenticator.continue_sign_in_with__mfa_setup_selection_form} -/// A prebuilt form for selecting an MFA method during setup. -/// {@endtemplate} -class ContinueSignInWithMfaSetupSelectionForm extends AuthenticatorForm { - /// {@macro amplify_authenticator.continue_sign_in_with__mfa_setup_selection_form} - ContinueSignInWithMfaSetupSelectionForm({ - super.key, - }) : super._( - fields: [ - ConfirmSignInFormField.mfaSetupSelection(), - ], - actions: const [ - ContinueSignInMFASetupSelectionButton(), - BackToSignInButton(), - ], - ); - - @override - AuthenticatorFormState - createState() => - AuthenticatorFormState(); -} - /// {@category Prebuilt Widgets} /// {@template amplify_authenticator.continue_sign_in_with_totp_setup_form} /// A prebuilt form for completing the totp setup process. @@ -670,28 +646,6 @@ class ContinueSignInWithTotpSetupForm extends AuthenticatorForm { AuthenticatorFormState(); } -/// {@category Prebuilt Widgets} -/// {@template amplify_authenticator.continue_sign_in_with_email_mfa_setup_form} -/// A prebuilt form for completing the email mfa setup process. -/// {@endtemplate} -class ContinueSignInWithEmailMfaSetupForm extends AuthenticatorForm { - ContinueSignInWithEmailMfaSetupForm({ - super.key, - }) : super._( - fields: [ - const EmailSetupFormField.email(), - ], - actions: const [ - ContinueSignInWithEmailMfaSetupButton(), - BackToSignInButton(), - ], - ); - - @override - AuthenticatorFormState createState() => - AuthenticatorFormState(); -} - /// {@category Prebuilt Widgets} /// {@template amplify_authenticator.send_code_form} /// A prebuilt form for initiating the reset password flow. diff --git a/packages/authenticator/amplify_authenticator/lib/src/widgets/form_field.dart b/packages/authenticator/amplify_authenticator/lib/src/widgets/form_field.dart index 83f862044e..f53a94b831 100644 --- a/packages/authenticator/amplify_authenticator/lib/src/widgets/form_field.dart +++ b/packages/authenticator/amplify_authenticator/lib/src/widgets/form_field.dart @@ -28,9 +28,7 @@ import 'package:qr_flutter/qr_flutter.dart'; part 'form_fields/confirm_sign_in_form_field.dart'; part 'form_fields/confirm_sign_up_form_field.dart'; -part 'form_fields/email_setup_form_field.dart'; part 'form_fields/mfa_selection_form_field.dart'; -part 'form_fields/mfa_setup_selection_form_field.dart'; part 'form_fields/phone_number_field.dart'; part 'form_fields/reset_password_form_field.dart'; part 'form_fields/sign_in_form_field.dart'; @@ -231,17 +229,11 @@ abstract class AuthenticatorFormFieldState< state.confirmSignInCustomAuth(); case AuthenticatorStep.confirmSignInMfa: state.confirmSignInMFA(); - case AuthenticatorStep.confirmSignInWithOtpCode: - state.confirmEmailMfa(); case AuthenticatorStep.confirmSignInNewPassword: state.confirmSignInNewPassword(); case AuthenticatorStep.confirmSignInWithTotpMfaCode: case AuthenticatorStep.continueSignInWithTotpSetup: state.confirmTotp(); - case AuthenticatorStep.continueSignInWithEmailMfaSetup: - state.continueEmailMfaSetup(); - case AuthenticatorStep.continueSignInWithMfaSetupSelection: - state.continueSignInWithMfaSetupSelection(); case AuthenticatorStep.resetPassword: state.resetPassword(); case AuthenticatorStep.confirmResetPassword: diff --git a/packages/authenticator/amplify_authenticator/lib/src/widgets/form_fields/confirm_sign_in_form_field.dart b/packages/authenticator/amplify_authenticator/lib/src/widgets/form_fields/confirm_sign_in_form_field.dart index 22d1253f39..d4b39d1d22 100644 --- a/packages/authenticator/amplify_authenticator/lib/src/widgets/form_fields/confirm_sign_in_form_field.dart +++ b/packages/authenticator/amplify_authenticator/lib/src/widgets/form_fields/confirm_sign_in_form_field.dart @@ -79,7 +79,7 @@ abstract class ConfirmSignInFormField autofillHints: autofillHints, ); - /// Creates an mfa preference selection component. + /// Creates a mfa preference selection component. static ConfirmSignInFormField mfaSelection({ Key? key, }) => @@ -88,15 +88,6 @@ abstract class ConfirmSignInFormField field: ConfirmSignInField.mfaMethod, ); - /// creates an mfa preference setup selection component. - static ConfirmSignInFormField mfaSetupSelection({ - Key? key, - }) => - _MfaSetupMethodRadioField( - key: key ?? keyMfaSetupMethodRadioConfirmSignInFormField, - field: ConfirmSignInField.mfaMethod, - ); - /// Creates a verification code component. static ConfirmSignInFormField verificationCode({ Key? key, diff --git a/packages/authenticator/amplify_authenticator/lib/src/widgets/form_fields/email_setup_form_field.dart b/packages/authenticator/amplify_authenticator/lib/src/widgets/form_fields/email_setup_form_field.dart deleted file mode 100644 index 9884b69122..0000000000 --- a/packages/authenticator/amplify_authenticator/lib/src/widgets/form_fields/email_setup_form_field.dart +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -part of '../form_field.dart'; - -/// {@category Prebuilt Widgets} -/// {@template amplify_authenticator.email_setup_form_field} -/// A prebuilt form field widget for use on the Email MFA setup step. -/// {@endtemplate} -class EmailSetupFormField - extends AuthenticatorFormField { - /// {@macro amplify_authenticator.email_setup_form_field} - /// - /// Either [titleKey] or [title] is required. - const EmailSetupFormField._({ - super.key, - required super.field, - super.titleKey, - super.hintTextKey, - super.title, - super.hintText, - super.validator, - super.autofillHints, - }) : super._(); - - /// Creates an email FormField for the email setup step. - const EmailSetupFormField.email({ - Key? key, - FormFieldValidator? validator, - Iterable? autofillHints, - }) : this._( - key: key ?? keyEmailSetupFormField, - field: EmailSetupField.email, - titleKey: InputResolverKey.emailTitle, - hintTextKey: InputResolverKey.emailHint, - validator: validator, - autofillHints: autofillHints, - ); - - @override - bool get required => true; - - @override - AuthenticatorFormFieldState - createState() => _EmailSetupFormFieldState(); -} - -class _EmailSetupFormFieldState extends AuthenticatorFormFieldState< - EmailSetupField, String, EmailSetupFormField> with AuthenticatorTextField { - @override - TextInputType get keyboardType { - return TextInputType.emailAddress; - } - - @override - Iterable? get autofillHints { - return [AutofillHints.email]; - } - - @override - ValueChanged get onChanged { - return (v) => state.mfaEmail = v; - } - - @override - FormFieldValidator get validator { - return validateEmail( - isOptional: isOptional, - context: context, - inputResolver: stringResolver.inputs, - ); - } -} diff --git a/packages/authenticator/amplify_authenticator/lib/src/widgets/form_fields/mfa_selection_form_field.dart b/packages/authenticator/amplify_authenticator/lib/src/widgets/form_fields/mfa_selection_form_field.dart index 8d73d1aae2..f5587071d0 100644 --- a/packages/authenticator/amplify_authenticator/lib/src/widgets/form_fields/mfa_selection_form_field.dart +++ b/packages/authenticator/amplify_authenticator/lib/src/widgets/form_fields/mfa_selection_form_field.dart @@ -41,11 +41,6 @@ class _MfaSelectionFieldState extends _ConfirmSignInFormFieldState label: InputResolverKey.selectSms, value: MfaType.sms, ), - if (_allowedMfaTypes.contains(MfaType.email)) - const InputSelection( - label: InputResolverKey.selectEmail, - value: MfaType.email, - ), ]; @override diff --git a/packages/authenticator/amplify_authenticator/lib/src/widgets/form_fields/mfa_setup_selection_form_field.dart b/packages/authenticator/amplify_authenticator/lib/src/widgets/form_fields/mfa_setup_selection_form_field.dart deleted file mode 100644 index 76b4084337..0000000000 --- a/packages/authenticator/amplify_authenticator/lib/src/widgets/form_fields/mfa_setup_selection_form_field.dart +++ /dev/null @@ -1,63 +0,0 @@ -// mfa_setup_selection_form_field.dart - -// Copyright Amazon.com, Inc. or its affiliates. -// All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -part of '../form_field.dart'; - -/// {@category Prebuilt Widgets} -/// {@template amplify_authenticator.mfa_setup_selection_form_field} -/// A prebuilt form widget for use on the MFA setup selection step. -/// {@endtemplate} -class _MfaSetupMethodRadioField extends ConfirmSignInFormField { - const _MfaSetupMethodRadioField({ - super.key, - required super.field, - }) : super._(); - - @override - _MfaSetupSelectionFieldState createState() => _MfaSetupSelectionFieldState(); -} - -class _MfaSetupSelectionFieldState extends _ConfirmSignInFormFieldState - with AuthenticatorRadioField { - Set get _allowedMfaTypes { - final state = InheritedAuthBloc.of(context).currentState; - assert( - state is ContinueSignInWithMfaSetupSelection, - 'Expected ContinueSignInWithMfaSetupSelection for current screen', - ); - return (state as ContinueSignInWithMfaSetupSelection).allowedMfaTypes; - } - - @override - List> get selections => [ - if (_allowedMfaTypes.contains(MfaType.totp)) - const InputSelection( - label: InputResolverKey.selectTotp, - value: MfaType.totp, - ), - if (_allowedMfaTypes.contains(MfaType.email)) - const InputSelection( - label: InputResolverKey.selectEmail, - value: MfaType.email, - ), - ]; - - @override - MfaType get initialValue => selections.first.value; - - @override - void initState() { - super.initState(); - WidgetsBinding.instance.addPostFrameCallback((_) { - state.selectedMfaMethod = initialValue; - }); - } - - @override - ValueChanged get onChanged { - return (MfaType method) => state.selectedMfaMethod = method; - } -} diff --git a/packages/authenticator/amplify_authenticator/pubspec.yaml b/packages/authenticator/amplify_authenticator/pubspec.yaml index c72d807aeb..8410a0b182 100644 --- a/packages/authenticator/amplify_authenticator/pubspec.yaml +++ b/packages/authenticator/amplify_authenticator/pubspec.yaml @@ -1,6 +1,6 @@ name: amplify_authenticator description: A prebuilt Sign In and Sign Up experience for the Amplify Auth category -version: 2.3.0 +version: 2.2.0 homepage: https://ui.docs.amplify.aws/flutter/connected-components/authenticator repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/authenticator/amplify_authenticator issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues @@ -10,9 +10,9 @@ environment: flutter: ">=3.19.0" dependencies: - amplify_auth_cognito: ">=2.5.0 <2.6.0" - amplify_core: ">=2.5.0 <2.6.0" - amplify_flutter: ">=2.5.0 <2.6.0" + amplify_auth_cognito: ">=2.4.2 <2.5.0" + amplify_core: ">=2.4.2 <2.5.0" + amplify_flutter: ">=2.4.1 <2.5.0" async: ^2.10.0 aws_common: ">=0.7.4 <0.8.0" collection: ^1.15.0 diff --git a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_confirmSignInWithOtpCodeStep_defaultMaterialTheme_darkMode_desktopGeometry.png b/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_confirmSignInWithOtpCodeStep_defaultMaterialTheme_darkMode_desktopGeometry.png deleted file mode 100644 index a6420c3365..0000000000 Binary files a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_confirmSignInWithOtpCodeStep_defaultMaterialTheme_darkMode_desktopGeometry.png and /dev/null differ diff --git a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_confirmSignInWithOtpCodeStep_defaultMaterialTheme_darkMode_mobileGeometry.png b/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_confirmSignInWithOtpCodeStep_defaultMaterialTheme_darkMode_mobileGeometry.png deleted file mode 100644 index a846131d90..0000000000 Binary files a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_confirmSignInWithOtpCodeStep_defaultMaterialTheme_darkMode_mobileGeometry.png and /dev/null differ diff --git a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_confirmSignInWithOtpCodeStep_defaultMaterialTheme_lightMode_desktopGeometry.png b/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_confirmSignInWithOtpCodeStep_defaultMaterialTheme_lightMode_desktopGeometry.png deleted file mode 100644 index 26e399a433..0000000000 Binary files a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_confirmSignInWithOtpCodeStep_defaultMaterialTheme_lightMode_desktopGeometry.png and /dev/null differ diff --git a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_confirmSignInWithOtpCodeStep_defaultMaterialTheme_lightMode_mobileGeometry.png b/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_confirmSignInWithOtpCodeStep_defaultMaterialTheme_lightMode_mobileGeometry.png deleted file mode 100644 index 1f1bee56e3..0000000000 Binary files a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_confirmSignInWithOtpCodeStep_defaultMaterialTheme_lightMode_mobileGeometry.png and /dev/null differ diff --git a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithEmailMfaSetupStep_defaultMaterialTheme_darkMode_desktopGeometry.png b/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithEmailMfaSetupStep_defaultMaterialTheme_darkMode_desktopGeometry.png deleted file mode 100644 index 046d31c7c3..0000000000 Binary files a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithEmailMfaSetupStep_defaultMaterialTheme_darkMode_desktopGeometry.png and /dev/null differ diff --git a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithEmailMfaSetupStep_defaultMaterialTheme_darkMode_mobileGeometry.png b/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithEmailMfaSetupStep_defaultMaterialTheme_darkMode_mobileGeometry.png deleted file mode 100644 index 565ef42835..0000000000 Binary files a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithEmailMfaSetupStep_defaultMaterialTheme_darkMode_mobileGeometry.png and /dev/null differ diff --git a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithEmailMfaSetupStep_defaultMaterialTheme_lightMode_desktopGeometry.png b/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithEmailMfaSetupStep_defaultMaterialTheme_lightMode_desktopGeometry.png deleted file mode 100644 index 9b30f02df2..0000000000 Binary files a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithEmailMfaSetupStep_defaultMaterialTheme_lightMode_desktopGeometry.png and /dev/null differ diff --git a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithEmailMfaSetupStep_defaultMaterialTheme_lightMode_mobileGeometry.png b/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithEmailMfaSetupStep_defaultMaterialTheme_lightMode_mobileGeometry.png deleted file mode 100644 index c9fed4c010..0000000000 Binary files a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithEmailMfaSetupStep_defaultMaterialTheme_lightMode_mobileGeometry.png and /dev/null differ diff --git a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithMfaSelectionStep_defaultMaterialTheme_darkMode_desktopGeometry.png b/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithMfaSelectionStep_defaultMaterialTheme_darkMode_desktopGeometry.png index 8a75ce5fa1..53c27c7301 100644 Binary files a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithMfaSelectionStep_defaultMaterialTheme_darkMode_desktopGeometry.png and b/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithMfaSelectionStep_defaultMaterialTheme_darkMode_desktopGeometry.png differ diff --git a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithMfaSelectionStep_defaultMaterialTheme_darkMode_mobileGeometry.png b/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithMfaSelectionStep_defaultMaterialTheme_darkMode_mobileGeometry.png index dd709da29a..21795345c9 100644 Binary files a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithMfaSelectionStep_defaultMaterialTheme_darkMode_mobileGeometry.png and b/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithMfaSelectionStep_defaultMaterialTheme_darkMode_mobileGeometry.png differ diff --git a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithMfaSelectionStep_defaultMaterialTheme_lightMode_desktopGeometry.png b/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithMfaSelectionStep_defaultMaterialTheme_lightMode_desktopGeometry.png index 6e1e3bda1d..17569d4a11 100644 Binary files a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithMfaSelectionStep_defaultMaterialTheme_lightMode_desktopGeometry.png and b/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithMfaSelectionStep_defaultMaterialTheme_lightMode_desktopGeometry.png differ diff --git a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithMfaSelectionStep_defaultMaterialTheme_lightMode_mobileGeometry.png b/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithMfaSelectionStep_defaultMaterialTheme_lightMode_mobileGeometry.png index 26145cb92c..1a8803016a 100644 Binary files a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithMfaSelectionStep_defaultMaterialTheme_lightMode_mobileGeometry.png and b/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithMfaSelectionStep_defaultMaterialTheme_lightMode_mobileGeometry.png differ diff --git a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithMfaSetupSelectionStep_defaultMaterialTheme_darkMode_desktopGeometry.png b/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithMfaSetupSelectionStep_defaultMaterialTheme_darkMode_desktopGeometry.png deleted file mode 100644 index c7f2fbe43b..0000000000 Binary files a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithMfaSetupSelectionStep_defaultMaterialTheme_darkMode_desktopGeometry.png and /dev/null differ diff --git a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithMfaSetupSelectionStep_defaultMaterialTheme_darkMode_mobileGeometry.png b/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithMfaSetupSelectionStep_defaultMaterialTheme_darkMode_mobileGeometry.png deleted file mode 100644 index a25542f90f..0000000000 Binary files a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithMfaSetupSelectionStep_defaultMaterialTheme_darkMode_mobileGeometry.png and /dev/null differ diff --git a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithMfaSetupSelectionStep_defaultMaterialTheme_lightMode_desktopGeometry.png b/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithMfaSetupSelectionStep_defaultMaterialTheme_lightMode_desktopGeometry.png deleted file mode 100644 index 07ff1fc98c..0000000000 Binary files a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithMfaSetupSelectionStep_defaultMaterialTheme_lightMode_desktopGeometry.png and /dev/null differ diff --git a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithMfaSetupSelectionStep_defaultMaterialTheme_lightMode_mobileGeometry.png b/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithMfaSetupSelectionStep_defaultMaterialTheme_lightMode_mobileGeometry.png deleted file mode 100644 index 5f27b9f6a5..0000000000 Binary files a/packages/authenticator/amplify_authenticator/test/ui/goldens/theme_emailConfig_continueSignInWithMfaSetupSelectionStep_defaultMaterialTheme_lightMode_mobileGeometry.png and /dev/null differ diff --git a/packages/authenticator/amplify_authenticator_test/lib/amplify_authenticator_test.dart b/packages/authenticator/amplify_authenticator_test/lib/amplify_authenticator_test.dart index 49b9300e16..d247d71507 100644 --- a/packages/authenticator/amplify_authenticator_test/lib/amplify_authenticator_test.dart +++ b/packages/authenticator/amplify_authenticator_test/lib/amplify_authenticator_test.dart @@ -18,7 +18,6 @@ export 'src/pages/authenticator_page.dart'; export 'src/pages/confirm_sign_in_page.dart'; export 'src/pages/confirm_sign_up_page.dart'; export 'src/pages/confirm_verify_user_page.dart'; -export 'src/pages/email_mfa_setup_page.dart'; export 'src/pages/forgot_password_page.dart'; export 'src/pages/sign_in_page.dart'; export 'src/pages/sign_up_page.dart'; diff --git a/packages/authenticator/amplify_authenticator_test/lib/src/amplify_outputs/email_or_phone_config.dart b/packages/authenticator/amplify_authenticator_test/lib/src/amplify_outputs/email_or_phone_config.dart index a7cc4c93ac..ad5ef29355 100644 --- a/packages/authenticator/amplify_authenticator_test/lib/src/amplify_outputs/email_or_phone_config.dart +++ b/packages/authenticator/amplify_authenticator_test/lib/src/amplify_outputs/email_or_phone_config.dart @@ -29,4 +29,4 @@ const emailOrPhoneConfig = '''{ "SMS" ] } -}'''; +}'''; \ No newline at end of file diff --git a/packages/authenticator/amplify_authenticator_test/lib/src/mock_authenticator_app.dart b/packages/authenticator/amplify_authenticator_test/lib/src/mock_authenticator_app.dart index af0fbc10f5..51f4a84830 100644 --- a/packages/authenticator/amplify_authenticator_test/lib/src/mock_authenticator_app.dart +++ b/packages/authenticator/amplify_authenticator_test/lib/src/mock_authenticator_app.dart @@ -72,7 +72,6 @@ class _MockAuthenticatorAppState extends State { allowedMfaTypes: { MfaType.totp, MfaType.sms, - MfaType.email, }, ), ); @@ -88,16 +87,6 @@ class _MockAuthenticatorAppState extends State { ), ), ); - case AuthenticatorStep.continueSignInWithMfaSetupSelection: - baseBloc.setState( - const ContinueSignInWithMfaSetupSelection( - allowedMfaTypes: { - MfaType.sms, - MfaType.totp, - MfaType.email, - }, - ), - ); default: baseBloc.add(const AuthLoad()); break; diff --git a/packages/authenticator/amplify_authenticator_test/lib/src/pages/authenticator_page.dart b/packages/authenticator/amplify_authenticator_test/lib/src/pages/authenticator_page.dart index 78eb6148c6..4b4da3226b 100644 --- a/packages/authenticator/amplify_authenticator_test/lib/src/pages/authenticator_page.dart +++ b/packages/authenticator/amplify_authenticator_test/lib/src/pages/authenticator_page.dart @@ -42,21 +42,6 @@ abstract class AuthenticatorPage { expect(usernameFieldHint, isPresent ? findsOneWidget : findsNothing); } - /// Then I see "Email" as an input field - void expectEmail({ - String label = 'Email', - bool isPresent = true, - }) { - // email field is present - expect(usernameField, findsOneWidget); - // login type is "email" - final usernameFieldHint = find.descendant( - of: usernameField, - matching: find.text(label), - ); - expect(usernameFieldHint, isPresent ? findsOneWidget : findsNothing); - } - /// Expects the current step to be [step]. void expectStep(AuthenticatorStep step) { final currentScreen = tester.widget( diff --git a/packages/authenticator/amplify_authenticator_test/lib/src/pages/confirm_sign_in_page.dart b/packages/authenticator/amplify_authenticator_test/lib/src/pages/confirm_sign_in_page.dart index 5d2d352509..84c8f8cbfb 100644 --- a/packages/authenticator/amplify_authenticator_test/lib/src/pages/confirm_sign_in_page.dart +++ b/packages/authenticator/amplify_authenticator_test/lib/src/pages/confirm_sign_in_page.dart @@ -25,12 +25,8 @@ class ConfirmSignInPage extends AuthenticatorPage { Finder get confirmSignInButton => find.byKey(keyConfirmSignInButton); Finder get confirmSignInMfaSelectionButton => find.byKey(keyConfirmSignInMfaSelectionButton); - Finder get confirmSignInMfaSetupSelectionButton => - find.byKey(keyConfirmSignInMfaSetupSelectionButton); Finder get selectMfaRadio => find.byKey(keyMfaMethodRadioConfirmSignInFormField); - Finder get selectMfaSetupRadio => - find.byKey(keyMfaSetupMethodRadioConfirmSignInFormField); Finder get backToSignIn => find.byKey(keyBackToSignInButton); /// Then I see "Confirm Sign In - New Password" @@ -63,28 +59,6 @@ class ConfirmSignInPage extends AuthenticatorPage { ); } - /// Then I see "Select an MFA Method to set up" - Future expectContinueSignInWithMfaSetupSelectionIsPresent() async { - final currentScreen = tester.widget( - find.byType(AuthenticatorScreen), - ); - expect( - currentScreen.step, - equals(AuthenticatorStep.continueSignInWithMfaSetupSelection), - ); - } - - /// Then I see "Enter your one-time passcode for Email" - Future expectConfirmSignInWithOtpCodeIsPresent() async { - final currentScreen = tester.widget( - find.byType(AuthenticatorScreen), - ); - expect( - currentScreen.step, - equals(AuthenticatorStep.confirmSignInWithOtpCode), - ); - } - /// Then I see "Setup an Authentication App" Future expectSignInTotpSetupIsPresent() async { final currentScreen = tester.widget( @@ -112,12 +86,6 @@ class ConfirmSignInPage extends AuthenticatorPage { expect(newPasswordField, findsOneWidget); } - /// Then I see "Invalid verification code" - @override - void expectInvalidVerificationCode() { - expectError('Invalid code'); - } - /// When I enter a verification code Future enterVerificationCode(String code) async { await tester.ensureVisible(verificationField); @@ -155,34 +123,9 @@ class ConfirmSignInPage extends AuthenticatorPage { }) async { expect(selectMfaRadio, findsOneWidget); - // if mfaMethod is email, don't make it uppercase except for the first letter - // if mfa method is totp, make it all uppercase final mfaMethodWidget = find.descendant( of: selectMfaRadio, - matching: find.textContaining( - mfaMethod == MfaType.email - ? 'Email' - : '(${mfaMethod.name.toUpperCase()})', - ), - ); - - await tester.tap(mfaMethodWidget); - await tester.pumpAndSettle(); - } - - // When I select a MFA setup method - Future selectMfaSetupMethod({ - required MfaType mfaMethod, - }) async { - expect(selectMfaSetupRadio, findsOneWidget); - - final mfaMethodWidget = find.descendant( - of: selectMfaSetupRadio, - matching: find.textContaining( - mfaMethod == MfaType.email - ? 'Email' - : '(${mfaMethod.name.toUpperCase()})', - ), + matching: find.textContaining('(${mfaMethod.name.toUpperCase()})'), ); await tester.tap(mfaMethodWidget); @@ -196,13 +139,6 @@ class ConfirmSignInPage extends AuthenticatorPage { await tester.pumpAndSettle(); } - /// When I click the continue sign in with MFA setup selection button - Future submitConfirmSignInMfaSetupSelection() async { - await tester.ensureVisible(confirmSignInMfaSetupSelectionButton); - await tester.tap(confirmSignInMfaSetupSelectionButton); - await tester.pumpAndSettle(); - } - /// When I navigate to the "Sign In" step. Future navigateToSignIn() async { await tester.tap(backToSignIn); diff --git a/packages/authenticator/amplify_authenticator_test/lib/src/pages/email_mfa_setup_page.dart b/packages/authenticator/amplify_authenticator_test/lib/src/pages/email_mfa_setup_page.dart deleted file mode 100644 index 546049a4b6..0000000000 --- a/packages/authenticator/amplify_authenticator_test/lib/src/pages/email_mfa_setup_page.dart +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -import 'package:amplify_authenticator/amplify_authenticator.dart'; -// ignore: implementation_imports -import 'package:amplify_authenticator/src/keys.dart'; -// ignore: implementation_imports -import 'package:amplify_authenticator/src/screens/authenticator_screen.dart'; -import 'package:amplify_authenticator_test/src/pages/authenticator_page.dart'; -import 'package:flutter_test/flutter_test.dart'; - -class EmailMfaSetupPage extends AuthenticatorPage { - EmailMfaSetupPage({required super.tester}); - - @override - Finder get usernameField => throw UnimplementedError(); - - Finder get emailField => find.byKey(keyEmailSetupFormField); - Finder get continueSignIn => - find.byKey(keyConfirmSignInWithEmailMfaSetupButton); - - /// When I type my email - Future enterEmail(String email) async { - await tester.ensureVisible(emailField); - await tester.enterText(emailField, email); - await tester.pumpAndSettle(); - } - - /// Then I see "Add Email for Two-Factor Authentication" - Future expectEmailMfaSetupIsPresent() async { - final currentScreen = tester.widget( - find.byType(AuthenticatorScreen), - ); - expect( - currentScreen.step, - equals(AuthenticatorStep.continueSignInWithEmailMfaSetup), - ); - } - - /// When I enter an email - Future submitEmail() async { - await tester.ensureVisible(continueSignIn); - await tester.tap(continueSignIn); - await tester.pumpAndSettle(); - } -} diff --git a/packages/common/amplify_db_common/CHANGELOG.md b/packages/common/amplify_db_common/CHANGELOG.md index 058a24c256..f048f06a47 100644 --- a/packages/common/amplify_db_common/CHANGELOG.md +++ b/packages/common/amplify_db_common/CHANGELOG.md @@ -1,8 +1,3 @@ -## 0.4.6 - -### Fixes -- fix(common): db_common windows sqlite3 collision ([#5481](https://github.com/aws-amplify/amplify-flutter/pull/5481)) - ## 0.4.5 - Minor bug fixes and improvements diff --git a/packages/common/amplify_db_common/example/pubspec.yaml b/packages/common/amplify_db_common/example/pubspec.yaml index aee1e97d19..52a0bd554f 100644 --- a/packages/common/amplify_db_common/example/pubspec.yaml +++ b/packages/common/amplify_db_common/example/pubspec.yaml @@ -11,10 +11,6 @@ dependencies: drift: ">=2.18.0 <2.19.0" flutter: sdk: flutter - # Unused in example app, rather included to validate - # windows app will build when there is a downstream dependency on sqlite3 - # https://github.com/aws-amplify/amplify-flutter/issues/5477 - sqlite3: ">=2.0.0 <2.4.7" dev_dependencies: amplify_lints: ^2.0.0 diff --git a/packages/common/amplify_db_common/pubspec.yaml b/packages/common/amplify_db_common/pubspec.yaml index 2cfec1a9f1..cc0abb2aba 100644 --- a/packages/common/amplify_db_common/pubspec.yaml +++ b/packages/common/amplify_db_common/pubspec.yaml @@ -1,6 +1,6 @@ name: amplify_db_common description: Common utilities for working with databases such as SQLite. -version: 0.4.6 +version: 0.4.5 homepage: https://github.com/aws-amplify/amplify-flutter/tree/main repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/common/amplify_db_common issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues @@ -10,7 +10,7 @@ environment: flutter: ">=3.19.0" dependencies: - amplify_db_common_dart: ">=0.4.7 <0.5.0" + amplify_db_common_dart: ">=0.4.6 <0.5.0" drift: ">=2.18.0 <2.19.0" flutter: sdk: flutter diff --git a/packages/common/amplify_db_common/windows/CMakeLists.txt b/packages/common/amplify_db_common/windows/CMakeLists.txt index b9788c4158..a5de5d3f88 100644 --- a/packages/common/amplify_db_common/windows/CMakeLists.txt +++ b/packages/common/amplify_db_common/windows/CMakeLists.txt @@ -16,14 +16,15 @@ add_library(${PLUGIN_NAME} SHARED "amplify_db_common_plugin.cpp" ) -# ## +### # Below here, keep in sync with: https://github.com/simolus3/sqlite3.dart/blob/main/sqlite3_flutter_libs/windows/CMakeLists.txt -# ## +### # Essentially, the idea of this build script is to compile a sqlite3.dll # and make Fluter bundle that with the final app. # It looks like we can't avoid building a sqlite3_flutter_libs.dll too, # but that's not on me. + apply_standard_settings(${PLUGIN_NAME}) set_target_properties(${PLUGIN_NAME} PROPERTIES CXX_VISIBILITY_PRESET hidden) @@ -33,70 +34,57 @@ target_include_directories(${PLUGIN_NAME} INTERFACE target_link_libraries(${PLUGIN_NAME} PRIVATE flutter flutter_wrapper_plugin) include(FetchContent) - -# Only add the sqlite3 library if it hasn't been defined already. -if(NOT TARGET sqlite3) - if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0") - # cmake 3.24.0 added the `DOWNLOAD_EXTRACT_TIMESTAMP` and prints an ugly warning when - # the default is used, so override it to the recommended behavior. - # We can't really ask users to use a cmake that recent, so there's this if here. - FetchContent_Declare( - sqlite3 - URL https://sqlite.org/2023/sqlite-autoconf-3430000.tar.gz - DOWNLOAD_EXTRACT_TIMESTAMP NEW - ) - else() - FetchContent_Declare( - sqlite3 - URL https://sqlite.org/2023/sqlite-autoconf-3430000.tar.gz - ) - endif() - - FetchContent_MakeAvailable(sqlite3) - - # Define the sqlite3 library only if it wasn't already defined. - add_library(sqlite3 SHARED "sqlite3_flutter.c") - - target_include_directories(sqlite3 PRIVATE "${sqlite3_SOURCE_DIR}") - target_compile_options(sqlite3 PRIVATE "$<$>:-O2>" "/w") - - # Note: Keep in sync with https://github.com/simolus3/sqlite-native-libraries/blob/master/sqlite3-native-library/cpp/CMakeLists.txt - target_compile_definitions(sqlite3 PRIVATE - SQLITE_ENABLE_FTS5 - SQLITE_ENABLE_RTREE - SQLITE_DQS=0 - SQLITE_DEFAULT_MEMSTATUS=0 - SQLITE_TEMP_STORE=2 - SQLITE_MAX_EXPR_DEPTH=0 - SQLITE_OMIT_AUTHORIZATION - SQLITE_OMIT_DECLTYPE - SQLITE_OMIT_DEPRECATED - SQLITE_OMIT_GET_TABLE - SQLITE_OMIT_LOAD_EXTENSION - SQLITE_OMIT_PROGRESS_CALLBACK - SQLITE_OMIT_SHARED_CACHE - SQLITE_OMIT_TCL_VARIABLE - SQLITE_OMIT_TRACE - SQLITE_USE_ALLOCA - SQLITE_UNTESTABLE - SQLITE_HAVE_ISNAN - SQLITE_HAVE_LOCALTIME_R - SQLITE_HAVE_LOCALTIME_S +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0") + # cmake 3.24.0 added the `DOWNLOAD_EXTRACT_TIMESTAMP` and prints an ugly warning when + # the default is used, so override it to the recommended behavior. + # We can't really ask users to use a cmake that recent, so there's this if here. + FetchContent_Declare( + sqlite3 + URL https://sqlite.org/2023/sqlite-autoconf-3430000.tar.gz + DOWNLOAD_EXTRACT_TIMESTAMP NEW ) - - # Create an alias for this version of sqlite3. - add_library(sqlite3_amplify_db_common ALIAS sqlite3) else() - # If sqlite3 already exists, create an alias for amplify plugin to avoid duplication. - add_library(sqlite3_amplify_db_common ALIAS sqlite3) + FetchContent_Declare( + sqlite3 + URL https://sqlite.org/2023/sqlite-autoconf-3430000.tar.gz + ) endif() +FetchContent_MakeAvailable(sqlite3) + +add_library(sqlite3 SHARED "sqlite3_flutter.c") -target_link_libraries(${PLUGIN_NAME} PRIVATE sqlite3_amplify_db_common) +target_include_directories(sqlite3 PRIVATE "${sqlite3_SOURCE_DIR}") +target_compile_options(sqlite3 PRIVATE "$<$>:-O2>" "/w") + +# Note: Keep in sync with https://github.com/simolus3/sqlite-native-libraries/blob/master/sqlite3-native-library/cpp/CMakeLists.txt +target_compile_definitions(sqlite3 PRIVATE + SQLITE_ENABLE_FTS5 + SQLITE_ENABLE_RTREE + SQLITE_DQS=0 + SQLITE_DEFAULT_MEMSTATUS=0 + SQLITE_TEMP_STORE=2 + SQLITE_MAX_EXPR_DEPTH=0 + SQLITE_OMIT_AUTHORIZATION + SQLITE_OMIT_DECLTYPE + SQLITE_OMIT_DEPRECATED + SQLITE_OMIT_GET_TABLE + SQLITE_OMIT_LOAD_EXTENSION + SQLITE_OMIT_PROGRESS_CALLBACK + SQLITE_OMIT_SHARED_CACHE + SQLITE_OMIT_TCL_VARIABLE + SQLITE_OMIT_TRACE + SQLITE_USE_ALLOCA + SQLITE_UNTESTABLE + SQLITE_HAVE_ISNAN + SQLITE_HAVE_LOCALTIME_R + SQLITE_HAVE_LOCALTIME_S +) -add_dependencies(${PLUGIN_NAME} sqlite3_amplify_db_common) +# Ensure sqlite3 actually gets build +add_dependencies(${PLUGIN_NAME} sqlite3) -# List of absolute paths to libraries that should be bundled with the plugin. +# List of absolute paths to libraries that should be bundled with the plugin set(amplify_db_common_bundled_libraries - "$" + "$" PARENT_SCOPE ) diff --git a/packages/common/amplify_db_common_dart/CHANGELOG.md b/packages/common/amplify_db_common_dart/CHANGELOG.md index 27df41af81..e21c828293 100644 --- a/packages/common/amplify_db_common_dart/CHANGELOG.md +++ b/packages/common/amplify_db_common_dart/CHANGELOG.md @@ -1,8 +1,3 @@ -## 0.4.7 - -### Fixes -- fix(common): db_common windows sqlite3 collision ([#5481](https://github.com/aws-amplify/amplify-flutter/pull/5481)) - ## 0.4.6 - Minor bug fixes and improvements diff --git a/packages/common/amplify_db_common_dart/pubspec.yaml b/packages/common/amplify_db_common_dart/pubspec.yaml index e43cf60061..7ede684144 100644 --- a/packages/common/amplify_db_common_dart/pubspec.yaml +++ b/packages/common/amplify_db_common_dart/pubspec.yaml @@ -1,6 +1,6 @@ name: amplify_db_common_dart description: Common utilities for working with databases such as sqlite. Used throughout Amplify packages. -version: 0.4.7 +version: 0.4.6 homepage: https://github.com/aws-amplify/amplify-flutter/tree/main repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/common/amplify_db_common_dart issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues @@ -9,13 +9,13 @@ environment: sdk: ^3.3.0 dependencies: - amplify_core: ">=2.5.0 <2.6.0" + amplify_core: ">=2.4.1 <2.5.0" async: ^2.10.0 aws_common: ">=0.7.3 <0.8.0" drift: ">=2.18.0 <2.19.0" meta: ^1.7.0 path: ">=1.8.0 <2.0.0" - sqlite3: ">=2.0.0 <2.4.7" + sqlite3: ">=2.0.0 <2.4.3" dev_dependencies: amplify_lints: ">=3.1.0 <3.2.0" diff --git a/packages/notifications/push/amplify_push_notifications/CHANGELOG.md b/packages/notifications/push/amplify_push_notifications/CHANGELOG.md index 6949519835..ecf9fa7938 100644 --- a/packages/notifications/push/amplify_push_notifications/CHANGELOG.md +++ b/packages/notifications/push/amplify_push_notifications/CHANGELOG.md @@ -1,7 +1,3 @@ -## 2.5.0 - -- Minor bug fixes and improvements - ## 2.4.2 - Minor bug fixes and improvements diff --git a/packages/notifications/push/amplify_push_notifications/pubspec.yaml b/packages/notifications/push/amplify_push_notifications/pubspec.yaml index 46ae170af5..a3046d98bd 100644 --- a/packages/notifications/push/amplify_push_notifications/pubspec.yaml +++ b/packages/notifications/push/amplify_push_notifications/pubspec.yaml @@ -1,6 +1,6 @@ name: amplify_push_notifications description: The Amplify Flutter Push Notifications package implementing features agnostic of an AWS Service such as Pinpoint. -version: 2.5.0 +version: 2.4.2 homepage: https://docs.amplify.aws/lib/q/platform/flutter/ issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues @@ -9,7 +9,7 @@ environment: flutter: ">=3.19.0" dependencies: - amplify_core: ">=2.5.0 <2.6.0" + amplify_core: ">=2.4.2 <2.5.0" amplify_secure_storage: ">=0.5.5 <0.6.0" async: ^2.10.0 flutter: diff --git a/packages/notifications/push/amplify_push_notifications_pinpoint/CHANGELOG.md b/packages/notifications/push/amplify_push_notifications_pinpoint/CHANGELOG.md index 969683cc11..c3960c24e2 100644 --- a/packages/notifications/push/amplify_push_notifications_pinpoint/CHANGELOG.md +++ b/packages/notifications/push/amplify_push_notifications_pinpoint/CHANGELOG.md @@ -1,7 +1,3 @@ -## 2.5.0 - -- Minor bug fixes and improvements - ## 2.4.1 - Minor bug fixes and improvements diff --git a/packages/notifications/push/amplify_push_notifications_pinpoint/pubspec.yaml b/packages/notifications/push/amplify_push_notifications_pinpoint/pubspec.yaml index db98957000..a1438d94ab 100644 --- a/packages/notifications/push/amplify_push_notifications_pinpoint/pubspec.yaml +++ b/packages/notifications/push/amplify_push_notifications_pinpoint/pubspec.yaml @@ -1,6 +1,6 @@ name: amplify_push_notifications_pinpoint description: The Amplify Flutter Push Notifications category plugin using the AWS Pinpoint provider. -version: 2.5.0 +version: 2.4.1 homepage: https://docs.amplify.aws/lib/q/platform/flutter/ issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues @@ -14,12 +14,12 @@ platforms: android: dependencies: - amplify_analytics_pinpoint: ">=2.5.0 <2.6.0" - amplify_analytics_pinpoint_dart: ">=0.4.6 <0.5.0" - amplify_auth_cognito: ">=2.5.0 <2.6.0" - amplify_core: ">=2.5.0 <2.6.0" - amplify_flutter: ">=2.5.0 <2.6.0" - amplify_push_notifications: ">=2.5.0 <2.6.0" + amplify_analytics_pinpoint: ">=2.4.0 <2.5.0" + amplify_analytics_pinpoint_dart: ">=0.4.5 <0.5.0" + amplify_auth_cognito: ">=2.4.0 <2.5.0" + amplify_core: ">=2.4.1 <2.5.0" + amplify_flutter: ">=2.4.0 <2.5.0" + amplify_push_notifications: ">=2.4.0 <2.5.0" amplify_secure_storage: ">=0.5.5 <0.6.0" flutter: sdk: flutter diff --git a/packages/storage/amplify_storage_s3/CHANGELOG.md b/packages/storage/amplify_storage_s3/CHANGELOG.md index b76ffff04d..5c9f366395 100644 --- a/packages/storage/amplify_storage_s3/CHANGELOG.md +++ b/packages/storage/amplify_storage_s3/CHANGELOG.md @@ -1,7 +1,3 @@ -## 2.5.0 - -- Minor bug fixes and improvements - ## 2.4.1 - Minor bug fixes and improvements diff --git a/packages/storage/amplify_storage_s3/pubspec.yaml b/packages/storage/amplify_storage_s3/pubspec.yaml index 3f5f03c6d2..66cc48427a 100644 --- a/packages/storage/amplify_storage_s3/pubspec.yaml +++ b/packages/storage/amplify_storage_s3/pubspec.yaml @@ -1,6 +1,6 @@ name: amplify_storage_s3 description: The Amplify Flutter Storage category plugin using the AWS S3 provider. -version: 2.5.0 +version: 2.4.1 homepage: https://docs.amplify.aws/lib/q/platform/flutter/ repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/storage/amplify_storage_s3 issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues @@ -19,9 +19,9 @@ platforms: web: dependencies: - amplify_core: ">=2.5.0 <2.6.0" - amplify_db_common: ">=0.4.6 <0.5.0" - amplify_storage_s3_dart: ">=0.4.6 <0.5.0" + amplify_core: ">=2.4.1 <2.5.0" + amplify_db_common: ">=0.4.5 <0.5.0" + amplify_storage_s3_dart: ">=0.4.5 <0.5.0" aws_common: ">=0.7.3 <0.8.0" flutter: sdk: flutter diff --git a/packages/storage/amplify_storage_s3_dart/CHANGELOG.md b/packages/storage/amplify_storage_s3_dart/CHANGELOG.md index 9ddc326400..5bdcd2ce9f 100644 --- a/packages/storage/amplify_storage_s3_dart/CHANGELOG.md +++ b/packages/storage/amplify_storage_s3_dart/CHANGELOG.md @@ -1,7 +1,3 @@ -## 0.4.6 - -- Minor bug fixes and improvements - ## 0.4.5 - Minor bug fixes and improvements diff --git a/packages/storage/amplify_storage_s3_dart/pubspec.yaml b/packages/storage/amplify_storage_s3_dart/pubspec.yaml index 275c2b3318..75bc76ea93 100644 --- a/packages/storage/amplify_storage_s3_dart/pubspec.yaml +++ b/packages/storage/amplify_storage_s3_dart/pubspec.yaml @@ -1,6 +1,6 @@ name: amplify_storage_s3_dart description: A Dart-only implementation of the Amplify Storage plugin for S3. -version: 0.4.6 +version: 0.4.5 homepage: https://docs.amplify.aws/lib/q/platform/flutter/ repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/storage/amplify_storage_s3_dart issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues @@ -9,8 +9,8 @@ environment: sdk: ^3.3.0 dependencies: - amplify_core: ">=2.5.0 <2.6.0" - amplify_db_common_dart: ">=0.4.7 <0.5.0" + amplify_core: ">=2.4.1 <2.5.0" + amplify_db_common_dart: ">=0.4.6 <0.5.0" async: ^2.10.0 aws_common: ">=0.7.3 <0.8.0" aws_signature_v4: ">=0.6.3 <0.7.0" diff --git a/packages/test/amplify_auth_integration_test/lib/amplify_auth_integration_test.dart b/packages/test/amplify_auth_integration_test/lib/amplify_auth_integration_test.dart index 2e3d46e086..0e94ac7fd3 100644 --- a/packages/test/amplify_auth_integration_test/lib/amplify_auth_integration_test.dart +++ b/packages/test/amplify_auth_integration_test/lib/amplify_auth_integration_test.dart @@ -6,7 +6,6 @@ library amplify_auth_integration_test; export 'src/async_test.dart'; -export 'src/email_utils.dart'; export 'src/environments.dart'; export 'src/test_auth_plugin.dart'; export 'src/test_runner.dart'; diff --git a/packages/test/amplify_auth_integration_test/lib/src/email_utils.dart b/packages/test/amplify_auth_integration_test/lib/src/email_utils.dart deleted file mode 100644 index ffb0534cd0..0000000000 --- a/packages/test/amplify_auth_integration_test/lib/src/email_utils.dart +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -import 'package:amplify_auth_cognito/amplify_auth_cognito.dart'; -import 'package:amplify_flutter/amplify_flutter.dart'; -import 'package:flutter_test/flutter_test.dart'; - -/// Sets up EMAIL MFA for the current user. -Future setUpEmailMfa() async { - final plugin = Amplify.Auth.getPlugin(AmplifyAuthCognito.pluginKey); - await plugin.updateMfaPreference(email: MfaPreference.preferred); -} diff --git a/packages/test/amplify_auth_integration_test/lib/src/environments.dart b/packages/test/amplify_auth_integration_test/lib/src/environments.dart index 1b2ab30f67..f6b9ebee6f 100644 --- a/packages/test/amplify_auth_integration_test/lib/src/environments.dart +++ b/packages/test/amplify_auth_integration_test/lib/src/environments.dart @@ -17,12 +17,6 @@ const List userPoolEnvironments = [ confirmationDeliveryMedium: DeliveryMedium.sms, resetPasswordDeliveryMedium: DeliveryMedium.sms, ), - EnvironmentInfo.withGen2Defaults( - name: 'email-sign-in', - loginMethod: LoginMethod.email, - confirmationDeliveryMedium: DeliveryMedium.email, - resetPasswordDeliveryMedium: DeliveryMedium.email, - ), ]; /// An environment with optional MFA via SMS only. @@ -61,55 +55,6 @@ const mfaRequiredSmsTotp = EnvironmentInfo.withGen1Defaults( mfaInfo: MfaInfo(smsEnabled: true, totpEnabled: true, required: true), ); -/// An environment with required MFA via Email only. -const mfaRequiredEmail = EnvironmentInfo.withGen2Defaults( - name: 'mfa-required-email', - mfaInfo: MfaInfo(emailEnabled: true, required: true), - loginMethod: LoginMethod.email, -); - -/// An environment with optional MFA via Email only. -const mfaOptionalEmail = EnvironmentInfo.withGen2Defaults( - name: 'mfa-optional-email', - mfaInfo: MfaInfo(emailEnabled: true, required: false), - loginMethod: LoginMethod.email, -); - -/// An environment with required MFA via Email & SMS. -const mfaRequiredEmailSms = EnvironmentInfo.withGen2Defaults( - name: 'mfa-required-email-sms', - mfaInfo: MfaInfo(emailEnabled: true, smsEnabled: true, required: true), - loginMethod: LoginMethod.email, -); - -/// An environment with optional MFA via Email & SMS. -const mfaOptionalEmailSms = EnvironmentInfo.withGen2Defaults( - name: 'mfa-optional-email-sms', - mfaInfo: MfaInfo(emailEnabled: true, smsEnabled: true, required: false), - loginMethod: LoginMethod.email, -); - -/// An environment with required MFA via Email & TOTP. -const mfaRequiredEmailTotp = EnvironmentInfo.withGen2Defaults( - name: 'mfa-required-email-totp', - mfaInfo: MfaInfo(emailEnabled: true, totpEnabled: true, required: true), - loginMethod: LoginMethod.email, -); - -/// An environment with optional MFA via Email & TOTP. -const mfaOptionalEmailTotp = EnvironmentInfo.withGen2Defaults( - name: 'mfa-optional-email-totp', - mfaInfo: MfaInfo(emailEnabled: true, totpEnabled: true, required: false), - loginMethod: LoginMethod.email, -); - -/// An environment with required MFA and username login. -const mfaRequiredUsernameLogin = EnvironmentInfo.withGen2Defaults( - name: 'username-login-mfa', - mfaInfo: MfaInfo(totpEnabled: true, emailEnabled: true, required: true), - loginMethod: LoginMethod.username, -); - /// Environments that support MFA const List mfaEnvironments = [ mfaOptionalSms, @@ -118,13 +63,6 @@ const List mfaEnvironments = [ mfaRequiredTotp, mfaOptionalSmsTotp, mfaRequiredSmsTotp, - mfaRequiredEmail, - mfaOptionalEmail, - mfaRequiredEmailSms, - mfaOptionalEmailSms, - mfaRequiredEmailTotp, - mfaOptionalEmailTotp, - mfaRequiredUsernameLogin, ]; /// Environments with a user pool and opt-in device tracking. diff --git a/packages/test/amplify_auth_integration_test/lib/src/test_runner.dart b/packages/test/amplify_auth_integration_test/lib/src/test_runner.dart index 9654971cdd..1401bc4fd6 100644 --- a/packages/test/amplify_auth_integration_test/lib/src/test_runner.dart +++ b/packages/test/amplify_auth_integration_test/lib/src/test_runner.dart @@ -145,7 +145,6 @@ class MfaInfo { this.required = false, this.smsEnabled = false, this.totpEnabled = false, - this.emailEnabled = false, }); /// Whether MFA is required (`true`) or optional (`false`). @@ -156,9 +155,6 @@ class MfaInfo { /// Whether TOTP MFA is available. final bool totpEnabled; - - /// Whether email MFA is available. - final bool emailEnabled; } /// A test environment descriptor. diff --git a/pubspec.yaml b/pubspec.yaml index 298afd11e2..392888e035 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -39,7 +39,7 @@ dependencies: oauth2: ^2.0.2 package_info_plus: ^8.0.0 pigeon: ^11.0.0 - sqlite3: ">=2.0.0 <2.4.7" + sqlite3: ">=2.0.0 <2.4.3" source_gen: ^1.3.2 stack_trace: ^1.10.0 uuid: ">=3.0.6 <5.0.0"