Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(authenticator): email otp tests #5563

Merged
merged 163 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
1b5d2bd
chore: add mfaType enum values,
khatruong2009 Aug 2, 2024
a6492d7
chore: add sign in step enums
khatruong2009 Aug 2, 2024
755f30d
chore: add ChallengeName
khatruong2009 Aug 2, 2024
95f658b
Revert "chore: add ChallengeName"
khatruong2009 Aug 5, 2024
1f72aca
Update packages/amplify_core/lib/src/types/auth/sign_in/auth_sign_in_…
khatruong2009 Aug 6, 2024
a5abb1e
chore add email mfa to sdk_bridge and state machine
khatruong2009 Sep 10, 2024
edaf999
chore: add email mfa to constants.dart
khatruong2009 Sep 10, 2024
630adad
chore: add email to updateMfaPreference API
khatruong2009 Sep 10, 2024
3f4efce
chore: generate code for mfa types/methods and sign in step
khatruong2009 Sep 10, 2024
438f800
chore: merge main (#5449)
khatruong2009 Sep 12, 2024
b4a8ceb
chore(auth): re-generate auth cognito sdk for email mfa (#5455)
NikaHsn Sep 13, 2024
d7f3d5d
chore: fix merge changes and sdk challenge name
khatruong2009 Sep 13, 2024
c98ce74
chore: fix name of challenge to match with SDK changes and updated st…
khatruong2009 Sep 17, 2024
c1d33e3
chore: edit doc comment in auth_plugin_impl
khatruong2009 Sep 17, 2024
18a5316
chore: add emailMfaSettings to setMfaSettings
khatruong2009 Sep 17, 2024
d484c55
chore: formatting
khatruong2009 Sep 18, 2024
f604447
chore: update docs comment in constants
khatruong2009 Sep 18, 2024
b0c03b7
chore: add docs and formatting
khatruong2009 Sep 18, 2024
5153683
chore: revert package-lock.json changes
khatruong2009 Sep 18, 2024
1d37cae
chore: update mfaSetup to MfaSetupSelection
khatruong2009 Sep 18, 2024
e69d96b
chore: refactor setMfaSettings method to handle multiple mfa preferre…
khatruong2009 Sep 18, 2024
764f16d
chore: fix mfaType switch statement to reflect new name
khatruong2009 Sep 19, 2024
26becec
chore: refactor setMfaSettings method
khatruong2009 Sep 20, 2024
86a3228
chore: mark sdk_exception file as generated
khatruong2009 Sep 20, 2024
13e60c4
chore: update core docs
khatruong2009 Sep 20, 2024
0d725dc
chore: update integ tests
khatruong2009 Sep 30, 2024
69abe75
chore: update core docs example
khatruong2009 Oct 4, 2024
970bf15
chore: add authenticator state/step enums
khatruong2009 Oct 4, 2024
5586c16
chore: change state machine and auth bloc to automatically move state…
khatruong2009 Oct 4, 2024
4725074
chore: add email mfa to test_runner
khatruong2009 Oct 4, 2024
f0b69a3
chore: dart format
khatruong2009 Oct 4, 2024
afeddae
chore: add ChallengeName
khatruong2009 Aug 2, 2024
67658ec
Revert "chore: add ChallengeName"
khatruong2009 Aug 5, 2024
4f28b48
chore: merge main (#5449)
khatruong2009 Sep 12, 2024
5159b96
chore: revert package-lock.json changes
khatruong2009 Sep 18, 2024
5008f09
chore: add new AuthenticatorStep to switch statements in screen
khatruong2009 Aug 28, 2024
28c81c5
chore: add input resolvers and localizations
khatruong2009 Aug 30, 2024
7636a9c
chore: add keys and enums
khatruong2009 Aug 30, 2024
b0dd395
chore: add select email input resolver
khatruong2009 Aug 30, 2024
775a34c
chore: add EmailSetupField type for authenticator
khatruong2009 Sep 3, 2024
2fab8ed
chore: add switch cases for future implementations of the forms
khatruong2009 Sep 3, 2024
29ab2d4
chore: add authenticator step cases for sign in with email mfa
khatruong2009 Sep 4, 2024
759cc42
chore: remove code from email setup field because only email is needed
khatruong2009 Sep 4, 2024
3086212
chore: add mfa email to authenticator state
khatruong2009 Sep 4, 2024
6e2c8e3
chore: add email mfa setup form and form field
khatruong2009 Sep 4, 2024
8209373
chore: adding steps to authenticator state machine
khatruong2009 Sep 5, 2024
dfecc73
chore: remove this verification code form field key since we already …
khatruong2009 Sep 6, 2024
1fd23c4
chore: add authenticator screen keys for new screens
khatruong2009 Sep 6, 2024
c1140a1
chore: remove dart auto formatted code
khatruong2009 Sep 6, 2024
a73932a
chore: add new email mfa setup form to inherited forms switch statement
khatruong2009 Sep 6, 2024
988bb2a
chore: add cases to oldWidget
khatruong2009 Sep 6, 2024
334ba5f
chore: add todo to add case for continueSignInWithMfaSetupSelection
khatruong2009 Sep 6, 2024
987361d
chore: remove duplicate localization and fix docs comments
khatruong2009 Sep 19, 2024
dd7d785
chore: add continueSignInWithMfaSetupSelectionForm
khatruong2009 Sep 19, 2024
a15898f
chore: dart format and fix typos
khatruong2009 Sep 19, 2024
8b69fe6
chore: fix mfaSetup fields and input_resolver duplicate
khatruong2009 Sep 19, 2024
59cc900
chore: remove duplicate analytics backend section
khatruong2009 Sep 25, 2024
ceb0564
chore: use confirmSignInWithEmailMfaCode instead of confirmSignInMfa
khatruong2009 Sep 26, 2024
215dd2e
chore: dart format
khatruong2009 Oct 2, 2024
e16d6af
chore: add trailing comma
khatruong2009 Oct 2, 2024
b0023ac
chore: dart format
khatruong2009 Oct 2, 2024
7b901af
chore: fix auth.dart docs
khatruong2009 Oct 7, 2024
66097f2
chore: moved ChallengeNameType.mfaSetup switch statement logic to a h…
khatruong2009 Oct 7, 2024
0fdcc15
chore: flatten an if statement in the helper method by adding mfaType…
khatruong2009 Oct 7, 2024
e630a30
chore: dart format
khatruong2009 Oct 7, 2024
334e8b3
chore: remove extra if checks and add null check
khatruong2009 Oct 7, 2024
87bb72b
chore: dart format
khatruong2009 Oct 7, 2024
c4ee27d
chore: add back in mfaTypesForSetup instead of allowedMfaTypes
khatruong2009 Oct 7, 2024
c89773b
chore: add ChallengeName
khatruong2009 Aug 2, 2024
255aaa6
Revert "chore: add ChallengeName"
khatruong2009 Aug 5, 2024
d7a5700
chore: merge main (#5449)
khatruong2009 Sep 12, 2024
479a034
chore: revert package-lock.json changes
khatruong2009 Sep 18, 2024
1eefc27
chore: add new AuthenticatorStep to switch statements in screen
khatruong2009 Aug 28, 2024
fd0db6f
chore: add input resolvers and localizations
khatruong2009 Aug 30, 2024
2f466d7
chore: add keys and enums
khatruong2009 Aug 30, 2024
69fa04e
chore: add select email input resolver
khatruong2009 Aug 30, 2024
059213d
chore: add EmailSetupField type for authenticator
khatruong2009 Sep 3, 2024
111f35e
chore: add switch cases for future implementations of the forms
khatruong2009 Sep 3, 2024
8f2ccdf
chore: add authenticator step cases for sign in with email mfa
khatruong2009 Sep 4, 2024
db1409a
chore: remove code from email setup field because only email is needed
khatruong2009 Sep 4, 2024
bafad94
chore: add mfa email to authenticator state
khatruong2009 Sep 4, 2024
c4b809b
chore: add email mfa setup form and form field
khatruong2009 Sep 4, 2024
a07f13b
chore: adding steps to authenticator state machine
khatruong2009 Sep 5, 2024
0b09af1
chore: remove this verification code form field key since we already …
khatruong2009 Sep 6, 2024
362f97c
chore: add authenticator screen keys for new screens
khatruong2009 Sep 6, 2024
6dfa933
chore: remove dart auto formatted code
khatruong2009 Sep 6, 2024
49d1d28
chore: add new email mfa setup form to inherited forms switch statement
khatruong2009 Sep 6, 2024
845892e
chore: add cases to oldWidget
khatruong2009 Sep 6, 2024
8000bec
chore: add todo to add case for continueSignInWithMfaSetupSelection
khatruong2009 Sep 6, 2024
d6cd995
chore: remove duplicate localization and fix docs comments
khatruong2009 Sep 19, 2024
9af619d
chore: add continueSignInWithMfaSetupSelectionForm
khatruong2009 Sep 19, 2024
a8b41e9
chore: dart format and fix typos
khatruong2009 Sep 19, 2024
3b50a1b
chore: fix mfaSetup fields and input_resolver duplicate
khatruong2009 Sep 19, 2024
dab8ff4
chore: remove duplicate analytics backend section
khatruong2009 Sep 25, 2024
8b7771d
chore: use confirmSignInWithEmailMfaCode instead of confirmSignInMfa
khatruong2009 Sep 26, 2024
93a8b75
chore: dart format
khatruong2009 Oct 2, 2024
64f25ad
chore: add trailing comma
khatruong2009 Oct 2, 2024
7fd3b39
chore: dart format
khatruong2009 Oct 2, 2024
dd76942
chore: doc fixes
khatruong2009 Oct 11, 2024
d602bef
chore: fixed else statement circular loop
khatruong2009 Oct 11, 2024
e98a31c
chore: dart format
khatruong2009 Oct 11, 2024
d7ebd26
chore: dart format authenticator
khatruong2009 Oct 11, 2024
aad9883
chore: add trailing comma
khatruong2009 Oct 11, 2024
9d9abe8
chore: dart format
khatruong2009 Oct 11, 2024
0641f33
temp state machine changes
khatruong2009 Oct 9, 2024
d7dc6bc
chore: fix inherited_forms steps
khatruong2009 Oct 11, 2024
2cd215b
chore: adjust continue sign in with email mfa setup form
khatruong2009 Oct 11, 2024
495ff1e
chore: refactor large nested if statement blocks in state machine
khatruong2009 Oct 11, 2024
e1bf813
chore: auth_bloc refactor to separate logic into a helper function an…
khatruong2009 Oct 11, 2024
cd610ea
chore: fix the email setup form field
khatruong2009 Oct 14, 2024
1d44a2e
chore: fix totp selection flow
khatruong2009 Oct 14, 2024
02fb1a6
chore: remove safePrint
khatruong2009 Oct 14, 2024
85368f1
chore: dart format
khatruong2009 Oct 14, 2024
e7e0888
chore: refactor setMfaSettings to make it easier to read with helper …
khatruong2009 Oct 15, 2024
4135f06
chore: refactor auth_bloc with helper function used in two switch sta…
khatruong2009 Oct 15, 2024
eb93be4
chore: refactor auth bloc helper method to remove nested if/else stat…
khatruong2009 Oct 15, 2024
daacad7
chore: refactor sign in state machine and add in constants for email …
khatruong2009 Oct 15, 2024
a3c57e9
chore: fix missing !
khatruong2009 Oct 15, 2024
7129360
chore: run dart format
khatruong2009 Oct 15, 2024
4c470eb
Merge branch 'feat/email-otp-mfa-enum' into feat/email-otp-authenticator
khatruong2009 Oct 15, 2024
562f35c
Merge branch 'feat/email-otp-authenticator' into feat/email-otp-tests
khatruong2009 Oct 15, 2024
e984747
chore: e2e test init commit
khatruong2009 Oct 17, 2024
58b64d4
chore: add temporary backends for e2e testing
khatruong2009 Oct 18, 2024
3a997fe
chore: fix auth_cognito tests to match expected behavior
khatruong2009 Oct 19, 2024
769bada
chore: add authenticator test for sign in with email mfa
khatruong2009 Oct 19, 2024
47d510f
chore: add and update utilities for integ tests
khatruong2009 Oct 19, 2024
06e2019
chore: add authenticator email sms test
khatruong2009 Oct 21, 2024
0467aba
chore: add backend for email and totp mfa
khatruong2009 Oct 21, 2024
d4dfeea
chore: add backend to the deploy gen 2 script
khatruong2009 Oct 21, 2024
53ef164
chore: add mfa-totp optional and required environments to script
khatruong2009 Oct 21, 2024
46e30ee
chore: add expect email method for authenticator page tests
khatruong2009 Oct 21, 2024
104c248
chore: dart format
khatruong2009 Oct 21, 2024
2c6ca44
chore: add email-totp optional test to auth cognito package
khatruong2009 Oct 21, 2024
b41ae49
chore: add confirm sign in page utility to tap email mfa option
khatruong2009 Oct 21, 2024
c7d574d
chore: add authenticator test for email otp
khatruong2009 Oct 21, 2024
d3173eb
chore: add email-totp required tests
khatruong2009 Oct 21, 2024
a94edd6
chore: add setup selection step to form field state
khatruong2009 Oct 22, 2024
d85e665
chore: add authenticator tests for mfa setup selection
khatruong2009 Oct 22, 2024
453a175
chore: add new backend for username only login
khatruong2009 Oct 22, 2024
d196c8f
chore: use provided cognitoPlugin utility
khatruong2009 Oct 22, 2024
0bd0842
chore: add find email mfa radio select widget
khatruong2009 Oct 22, 2024
14bb1eb
chore: add test for mfa setup selection screen in amplify auth cognito
khatruong2009 Oct 22, 2024
63077c8
chore: dart format and remove unused variables
khatruong2009 Oct 22, 2024
3a8a1f1
chore: remove commented code and print statements
khatruong2009 Oct 22, 2024
d5ec3c3
chore: remove unnecessary variable assignments
khatruong2009 Oct 22, 2024
e355d02
chore: add invalid mfa code tests to authenticator
khatruong2009 Oct 22, 2024
1d03046
chore: dart format
khatruong2009 Oct 22, 2024
6de4283
Merge branch 'feat/email-otp-mfa' into feat/email-otp-tests
khatruong2009 Oct 22, 2024
944fc4b
chore: remove username login sms user pool from sms tests because it …
khatruong2009 Oct 23, 2024
fd45d04
Merge branch 'feat/email-otp-mfa' into feat/email-otp-tests
khatruong2009 Oct 23, 2024
ddb8ab7
chore: add tests to main_test file and make some backend changes
khatruong2009 Oct 23, 2024
c418a33
chore: add authenticator tests to main_test file and move getOtpCode …
khatruong2009 Oct 23, 2024
54155cf
chore: move new mfa tests to be closer to the old ones
khatruong2009 Oct 23, 2024
ce4bd2f
chore: dart format
khatruong2009 Oct 23, 2024
645a971
chore: move mfa tests to the top so that they run first (testing)
khatruong2009 Oct 24, 2024
1d50b58
chore: comment out non mfa tests to see if they pass
khatruong2009 Oct 24, 2024
0672db3
Revert "chore: comment out non mfa tests to see if they pass"
khatruong2009 Oct 24, 2024
c4bfbba
chore: trim down on overlapping tests and moved getOtpCode earlier in…
khatruong2009 Oct 24, 2024
b5f6dcb
chore: dart format
khatruong2009 Oct 24, 2024
c9a6424
chore: dart format
khatruong2009 Oct 24, 2024
a19b523
chore: dart format
khatruong2009 Oct 24, 2024
e63b865
Feat(authenticator) email otp tests goldens (#5603)
tyllark Oct 24, 2024
6cd3a62
chore: API Name Change Amendment (#5602)
khatruong2009 Oct 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions infra-gen2/backends/auth/mfa-optional-email-sms/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# amplify
node_modules
.amplify
amplify_outputs*
amplifyconfiguration*
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// 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,
// },
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// 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);
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"compilerOptions": {
"target": "es2022",
"module": "es2022",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"paths": {
"$amplify/*": [
"../.amplify/generated/*"
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "mfa-optional-email-sms",
"version": "1.0.0",
"main": "index.js"
}
5 changes: 5 additions & 0 deletions infra-gen2/backends/auth/mfa-optional-email-totp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# amplify
node_modules
.amplify
amplify_outputs*
amplifyconfiguration*
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// 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,
// },
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// 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);
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"compilerOptions": {
"target": "es2022",
"module": "es2022",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"paths": {
"$amplify/*": [
"../.amplify/generated/*"
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "mfa-optional-email-totp",
"version": "1.0.0",
"main": "index.js"
}
5 changes: 5 additions & 0 deletions infra-gen2/backends/auth/mfa-optional-email/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# amplify
node_modules
.amplify
amplify_outputs*
amplifyconfiguration*
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// 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,
// },
});
25 changes: 25 additions & 0 deletions infra-gen2/backends/auth/mfa-optional-email/amplify/backend.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// 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);
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"compilerOptions": {
"target": "es2022",
"module": "es2022",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"paths": {
"$amplify/*": [
"../.amplify/generated/*"
]
}
}
}
5 changes: 5 additions & 0 deletions infra-gen2/backends/auth/mfa-optional-email/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "mfa-optional-email",
"version": "1.0.0",
"main": "index.js"
}
5 changes: 5 additions & 0 deletions infra-gen2/backends/auth/mfa-required-email-sms/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# amplify
node_modules
.amplify
amplify_outputs*
amplifyconfiguration*
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// 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,
// },
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// 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);
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"compilerOptions": {
"target": "es2022",
"module": "es2022",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"paths": {
"$amplify/*": [
"../.amplify/generated/*"
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "mfa-required-email-sms",
"version": "1.0.0",
"main": "index.js"
}
5 changes: 5 additions & 0 deletions infra-gen2/backends/auth/mfa-required-email-totp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# amplify
node_modules
.amplify
amplify_outputs*
amplifyconfiguration*
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// 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,
// },
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// 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);
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"compilerOptions": {
"target": "es2022",
"module": "es2022",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"paths": {
"$amplify/*": [
"../.amplify/generated/*"
]
}
}
}
Loading
Loading