Skip to content

Commit 7fe0cd6

Browse files
chore(authenticator): email otp tests and API amendment (#5563)
1 parent 35a92b7 commit 7fe0cd6

File tree

98 files changed

+3717
-84
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+3717
-84
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# amplify
2+
node_modules
3+
.amplify
4+
amplify_outputs*
5+
amplifyconfiguration*
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
import { defineAuth } from "@aws-amplify/backend";
5+
6+
export const auth = defineAuth({
7+
name: "mfa-optional-email-sms",
8+
loginWith: {
9+
email: true,
10+
},
11+
12+
// TODO(khatruong2009): Uncomment the following line when the feature is ready.
13+
// multifactor: {
14+
// mode: "OPTIONAL",
15+
// email: true,
16+
// sms: true,
17+
// },
18+
});
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
import { defineBackend } from "@aws-amplify/backend";
5+
import { addAuthUserExtensions } from "infra-common";
6+
import { auth } from "./auth/resource";
7+
8+
const backend = defineBackend({
9+
auth,
10+
});
11+
12+
const resources = backend.auth.resources;
13+
const { userPool, cfnResources } = resources;
14+
const { stack } = userPool;
15+
const { cfnUserPool } = cfnResources;
16+
17+
// Adds infra for creating/deleting users via App Sync and fetching confirmation
18+
// and MFA codes from App Sync.
19+
const customOutputs = addAuthUserExtensions({
20+
name: "mfa-optional-email-sms",
21+
stack,
22+
userPool,
23+
cfnUserPool,
24+
});
25+
backend.addOutput(customOutputs);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"type": "module"
3+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es2022",
4+
"module": "es2022",
5+
"moduleResolution": "bundler",
6+
"resolveJsonModule": true,
7+
"esModuleInterop": true,
8+
"forceConsistentCasingInFileNames": true,
9+
"strict": true,
10+
"skipLibCheck": true,
11+
"paths": {
12+
"$amplify/*": [
13+
"../.amplify/generated/*"
14+
]
15+
}
16+
}
17+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "mfa-optional-email-sms",
3+
"version": "1.0.0",
4+
"main": "index.js"
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# amplify
2+
node_modules
3+
.amplify
4+
amplify_outputs*
5+
amplifyconfiguration*
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
import { defineAuth } from "@aws-amplify/backend";
5+
6+
export const auth = defineAuth({
7+
name: "mfa-optional-email-totp",
8+
loginWith: {
9+
email: true,
10+
},
11+
12+
// TODO(khatruong2009): Uncomment the following line when the feature is ready.
13+
// multifactor: {
14+
// mode: "OPTIONAL",
15+
// email: true,
16+
// totp: true,
17+
// },
18+
});
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
import { defineBackend } from "@aws-amplify/backend";
5+
import { addAuthUserExtensions } from "infra-common";
6+
import { auth } from "./auth/resource";
7+
8+
const backend = defineBackend({
9+
auth,
10+
});
11+
12+
const resources = backend.auth.resources;
13+
const { userPool, cfnResources } = resources;
14+
const { stack } = userPool;
15+
const { cfnUserPool } = cfnResources;
16+
17+
// Adds infra for creating/deleting users via App Sync and fetching confirmation
18+
// and MFA codes from App Sync.
19+
const customOutputs = addAuthUserExtensions({
20+
name: "mfa-optional-email-totp",
21+
stack,
22+
userPool,
23+
cfnUserPool,
24+
});
25+
backend.addOutput(customOutputs);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"type": "module"
3+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es2022",
4+
"module": "es2022",
5+
"moduleResolution": "bundler",
6+
"resolveJsonModule": true,
7+
"esModuleInterop": true,
8+
"forceConsistentCasingInFileNames": true,
9+
"strict": true,
10+
"skipLibCheck": true,
11+
"paths": {
12+
"$amplify/*": [
13+
"../.amplify/generated/*"
14+
]
15+
}
16+
}
17+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "mfa-optional-email-totp",
3+
"version": "1.0.0",
4+
"main": "index.js"
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# amplify
2+
node_modules
3+
.amplify
4+
amplify_outputs*
5+
amplifyconfiguration*
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
import { defineAuth } from "@aws-amplify/backend";
5+
6+
export const auth = defineAuth({
7+
name: "mfa-optional-email",
8+
loginWith: {
9+
email: true,
10+
},
11+
12+
// TODO(khatruong2009): Uncomment the following line when the feature is ready.
13+
// multifactor: {
14+
// mode: "OPTIONAL",
15+
// email: true,
16+
// },
17+
});
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
import { defineBackend } from "@aws-amplify/backend";
5+
import { addAuthUserExtensions } from "infra-common";
6+
import { auth } from "./auth/resource";
7+
8+
const backend = defineBackend({
9+
auth,
10+
});
11+
12+
const resources = backend.auth.resources;
13+
const { userPool, cfnResources } = resources;
14+
const { stack } = userPool;
15+
const { cfnUserPool } = cfnResources;
16+
17+
// Adds infra for creating/deleting users via App Sync and fetching confirmation
18+
// and MFA codes from App Sync.
19+
const customOutputs = addAuthUserExtensions({
20+
name: "mfa-optional-email",
21+
stack,
22+
userPool,
23+
cfnUserPool,
24+
});
25+
backend.addOutput(customOutputs);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"type": "module"
3+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es2022",
4+
"module": "es2022",
5+
"moduleResolution": "bundler",
6+
"resolveJsonModule": true,
7+
"esModuleInterop": true,
8+
"forceConsistentCasingInFileNames": true,
9+
"strict": true,
10+
"skipLibCheck": true,
11+
"paths": {
12+
"$amplify/*": [
13+
"../.amplify/generated/*"
14+
]
15+
}
16+
}
17+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "mfa-optional-email",
3+
"version": "1.0.0",
4+
"main": "index.js"
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# amplify
2+
node_modules
3+
.amplify
4+
amplify_outputs*
5+
amplifyconfiguration*
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
import { defineAuth } from "@aws-amplify/backend";
5+
6+
export const auth = defineAuth({
7+
name: "mfa-required-email-sms",
8+
loginWith: {
9+
email: true,
10+
},
11+
// TODO(khatruong2009): Uncomment the following line when the feature is ready.
12+
// multifactor: {
13+
// mode: "REQUIRED",
14+
// email: true,
15+
// sms: true,
16+
// },
17+
});
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
import { defineBackend } from "@aws-amplify/backend";
5+
import { addAuthUserExtensions } from "infra-common";
6+
import { auth } from "./auth/resource";
7+
8+
const backend = defineBackend({
9+
auth,
10+
});
11+
12+
const resources = backend.auth.resources;
13+
const { userPool, cfnResources } = resources;
14+
const { stack } = userPool;
15+
const { cfnUserPool } = cfnResources;
16+
17+
// Adds infra for creating/deleting users via App Sync and fetching confirmation
18+
// and MFA codes from App Sync.
19+
const customOutputs = addAuthUserExtensions({
20+
name: "mfa-required-email-sms",
21+
stack,
22+
userPool,
23+
cfnUserPool,
24+
});
25+
backend.addOutput(customOutputs);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"type": "module"
3+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es2022",
4+
"module": "es2022",
5+
"moduleResolution": "bundler",
6+
"resolveJsonModule": true,
7+
"esModuleInterop": true,
8+
"forceConsistentCasingInFileNames": true,
9+
"strict": true,
10+
"skipLibCheck": true,
11+
"paths": {
12+
"$amplify/*": [
13+
"../.amplify/generated/*"
14+
]
15+
}
16+
}
17+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "mfa-required-email-sms",
3+
"version": "1.0.0",
4+
"main": "index.js"
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# amplify
2+
node_modules
3+
.amplify
4+
amplify_outputs*
5+
amplifyconfiguration*
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
import { defineAuth } from "@aws-amplify/backend";
5+
6+
export const auth = defineAuth({
7+
name: "mfa-required-email-totp",
8+
loginWith: {
9+
email: true,
10+
},
11+
// TODO(khatruong2009): Uncomment the following line when the feature is ready.
12+
// multifactor: {
13+
// mode: "REQUIRED",
14+
// email: true,
15+
// totp: true,
16+
// },
17+
});
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
import { defineBackend } from "@aws-amplify/backend";
5+
import { addAuthUserExtensions } from "infra-common";
6+
import { auth } from "./auth/resource";
7+
8+
const backend = defineBackend({
9+
auth,
10+
});
11+
12+
const resources = backend.auth.resources;
13+
const { userPool, cfnResources } = resources;
14+
const { stack } = userPool;
15+
const { cfnUserPool } = cfnResources;
16+
17+
// Adds infra for creating/deleting users via App Sync and fetching confirmation
18+
// and MFA codes from App Sync.
19+
const customOutputs = addAuthUserExtensions({
20+
name: "mfa-required-email-totp",
21+
stack,
22+
userPool,
23+
cfnUserPool,
24+
});
25+
backend.addOutput(customOutputs);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"type": "module"
3+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es2022",
4+
"module": "es2022",
5+
"moduleResolution": "bundler",
6+
"resolveJsonModule": true,
7+
"esModuleInterop": true,
8+
"forceConsistentCasingInFileNames": true,
9+
"strict": true,
10+
"skipLibCheck": true,
11+
"paths": {
12+
"$amplify/*": [
13+
"../.amplify/generated/*"
14+
]
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)