You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AmplifyPlugins/API/AWSAPICategoryPluginIntegrationTests/GraphQL/GraphQLWithIAMIntegrationTests/README.md
+73-31Lines changed: 73 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@ The following steps demonstrate how to set up an GraphQL endpoint with AppSync.
4
4
5
5
### Set-up
6
6
7
+
Latest tested with amplify CLI version 8.0.1 `amplify -v`
8
+
7
9
1.`amplify init`
8
10
9
11
2.`amplify add api`
@@ -19,46 +21,86 @@ The following steps demonstrate how to set up an GraphQL endpoint with AppSync.
19
21
20
22
3.`amplify add auth`
21
23
```perl
22
-
? Do you want to use the default authentication and security configuration? `Default configuration`
23
-
? How do you want users to be able to sign in? `Username`
24
-
? Do you want to configure advanced settings? `No, I am done.`
24
+
Do you want to use the default authentication and security configuration?
25
+
Manual configuration
26
+
Select the authentication/authorization services that you want to use:
27
+
User Sign-Up, Sign-In, connected with AWS IAM controls (Enables ...)
28
+
Please provide a friendly name for your resource that will be used to label this category in the project:
29
+
<amplifyintegtest>
30
+
Please enter a name for your identity pool.
31
+
<amplifyintegtestCIDP>
32
+
Allow unauthenticated logins? (Provides scoped down permissions that you can control via AWS IAM)
33
+
Yes
34
+
Do you want to enable 3rd party authentication providers in your identity pool?
35
+
No
36
+
Please provide a name for your user pool:
37
+
<amplifyintegCUP>
38
+
39
+
How do you want users to be able to sign in?
40
+
Username
41
+
Do you want to add User Pool Groups?
42
+
No
43
+
Do you want to add an admin queries API?
44
+
Yes
45
+
? Do you want to restrict access to the admin queries API to a specific Group
46
+
No
47
+
Multifactor authentication (MFA) user login options:
48
+
OFF
49
+
50
+
Email based user registration/forgot password:
51
+
Enabled (Requires per-user email entry at registration)
52
+
Please specify an email verification subject:
53
+
Your verification code
54
+
Please specify an email verification message:
55
+
Your verification code is {####}
56
+
Do you want to override the default password policy for this User Pool?
57
+
No
58
+
59
+
What attributes are required for signing up?
60
+
(Press Space to deselect Email, if selected, then press Enter with none selected)
61
+
Specify the app's refresh token expiration period (in days):
62
+
30
63
+
Do you want to specify the user attributes this app can read and write?
64
+
No
65
+
Do you want to enable any of the following capabilities?
66
+
(press Enter with none selected)
67
+
Do you want to use an OAuth flow?
68
+
No
69
+
? Do you want to configure Lambda Triggers for Cognito?
70
+
Yes
71
+
? Which triggers do you want to enable for Cognito
72
+
Pre Sign-up
73
+
[Choose as many that you would like to manually verify later]
74
+
? What functionality do you want to use for Pre Sign-up
75
+
Create your own module
76
+
Succesfully added the Lambda function locally
77
+
? Do you want to edit your custom function now? Yes
78
+
Please edit the file in your editor:
25
79
```
26
80
27
-
4.`amplify push`
81
+
For Pre Sign-up lambda
28
82
29
-
5. Copy `amplifyconfiguration.json` over as `GraphQLWithIAMIntegrationTests-amplifyconfiguration.json` to `~/.aws-amplify/amplify-ios/testconfiguration/`
83
+
```
84
+
exports.handler = (event) => {
85
+
event.response.autoConfirmUser = true;
86
+
};
87
+
```
30
88
31
-
6.`amplify console auth` and choose `Identity Pool`. Click on **Edit Identity pool** and make note of IAM Role that is assigned for the Authenticated role.
89
+
Continue in the terminal;
32
90
33
-
7. Click on `Unauthenticated identities` and check off *Enable access to unauthenticated identities*, and Save Changes. This will allow users that are using the app but are not signed in to assume the unauthenticated role when making calls to the API.
8. Navigate to [AWS IAM Console](https://console.aws.amazon.com/iam/home) and select Roles, find the role attached to the Identity Pool's Authenticated role.
96
+
4. If you are using the latest CLI, update cli.json to include `"useExperimentalPipelinedTransformer": false` to ensure that it will use the v1 transformer and then `amplify push`
36
97
37
-
9. Click on Attach Policies, choose **AWSAppSyncInvokeFullAccess**, and attach the policy. This will allow users that are signed into the app to have access to invoke AppSync APIs.
98
+
5. Copy `amplifyconfiguration.json` over as `GraphQLWithIAMIntegrationTests-amplifyconfiguration.json` to `~/.aws-amplify/amplify-ios/testconfiguration/`
38
99
39
-
10. Create `GraphQLWithIAMIntegrationTests-credentials.json` inside `~/.aws-amplify/amplify-ios/testconfiguration/` with a json object containing `username`, and `password`, used to create the cognito user in the userpool.
100
+
6. `amplify console auth` and choose `Identity Pool`. Click on **Edit Identity pool** and make note of IAM Role that is assigned for the Authenticated role.
40
101
41
-
```json
42
-
{
43
-
"username": "[USERNAME]",
44
-
"password": "[PASSWORD]"
45
-
}
46
-
```
102
+
7. Navigate to [AWS IAM Console](https://console.aws.amazon.com/iam/home) and select Roles, find the role attached to the Identity Pool's Authenticated role.
47
103
48
-
11. Create a new users in the userpool. First, retrieve the Cognito User Pool's Pool Id, you can find this in `amplifyconfiguration.json` under
49
-
```
50
-
"CognitoUserPool": {
51
-
"Default": {
52
-
"PoolId": "[POOL_ID]",
53
-
```
54
-
Run the `admin-create-user` command to create a new user
See https://docs.aws.amazon.com/cli/latest/reference/cognito-idp/index.html#cli-aws-cognito-idp for more details using AWS CLI.
104
+
8. Click on Attach Policies, choose **AWSAppSyncInvokeFullAccess**, and attach the policy. This will allow users that are signed into the app to have access to invoke AppSync APIs.
Copy file name to clipboardExpand all lines: AmplifyPlugins/API/AWSAPICategoryPluginIntegrationTests/GraphQL/GraphQLWithLambdaAuthIntegrationTests/README.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@ The following steps demonstrate how to set up an GraphQL endpoint with AppSync.
4
4
5
5
### Set-up
6
6
7
+
Latest tested with amplify CLI version 8.0.1 `amplify -v`
8
+
7
9
1.`amplify init`
8
10
9
11
2.`amplify add api`
@@ -17,7 +19,7 @@ The following steps demonstrate how to set up an GraphQL endpoint with AppSync.
17
19
? Choose a schema template: `Single object with fields (e.g., “Todo” with ID, name, description)`
18
20
```
19
21
20
-
3.`amplify push`
22
+
3.If you are using the latest CLI, update cli.json to include `"useExperimentalPipelinedTransformer": false` to ensure that it will use the v1 transformer and then `amplify push`
21
23
22
24
4. Copy `amplifyconfiguration.json` over as `GraphQLWithLambdaAuthIntegrationTests-amplifyconfiguration.json` inside `~/.aws-amplify/amplify-ios/testconfiguration/`
23
25
5. Replace the authorization type `API_KEY` with `AWS_LAMBDA` in `GraphQLWithLambdaAuthIntegrationTests-amplifyconfiguration.json`
Copy file name to clipboardExpand all lines: AmplifyPlugins/API/AWSAPICategoryPluginIntegrationTests/GraphQL/GraphQLWithUserPoolIntegrationTests/AuthDirective/GraphQLAuthDirectiveIntegrationTests.swift
+9-15Lines changed: 9 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -20,31 +20,25 @@ class GraphQLAuthDirectiveIntegrationTests: XCTestCase {
Copy file name to clipboardExpand all lines: AmplifyPlugins/API/AWSAPICategoryPluginIntegrationTests/GraphQL/GraphQLWithUserPoolIntegrationTests/README.md
+21-38Lines changed: 21 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@ The following steps demonstrate how to set up an GraphQL endpoint with AppSync.
4
4
5
5
### Set-up
6
6
7
+
Latest tested with amplify CLI version 8.0.1 `amplify -v`
8
+
7
9
* Note that these integration tests are only compatible with the V1 Transformer. *
8
10
9
11
1.`amplify init`
@@ -14,31 +16,7 @@ The following steps demonstrate how to set up an GraphQL endpoint with AppSync.
14
16
? Please select from one of the below mentioned services: GraphQL
15
17
? Provide API name: `<APIName>`
16
18
? Choose the default authorization type for the API `Amazon Cognito User Pool`
17
-
? Do you want to use the default authentication and security configuration? `Default configuration`
18
-
? How do you want users to be able to sign in? `Email`
19
-
? Do you want to configure advanced settings? `No, I am done.`
20
-
? Do you want to configure advanced settings for the GraphQL API `No, I am done.`
21
-
? Do you have an annotated GraphQL schema? `No`
22
-
? Do you want a guided schema creation? `Yes`
23
-
? What best describes your project: `Single object with fields (e.g., “Todo” with ID, name, description)`
24
-
? Do you want to edit the schema now? `No`
25
-
```
26
-
27
-
The guided schema provided should look like this:
28
-
```json
29
-
type Todo @model {
30
-
id: ID!
31
-
name: String!
32
-
description: String
33
-
}
34
-
```
35
-
36
-
3. Some of the tests rely on the Auth plugin to be setup as a prerequisite
37
-
38
-
`amplify add auth`
39
-
40
-
```
41
-
Do you want to use the default authentication and security configuration?
19
+
? Do you want to use the default authentication and security configuration?
42
20
Manual configuration
43
21
Select the authentication/authorization services that you want to use:
44
22
User Sign-Up, Sign-In, connected with AWS IAM controls (Enables ...)
@@ -47,7 +25,7 @@ Please provide a friendly name for your resource that will be used to label this
47
25
Please enter a name for your identity pool.
48
26
<amplifyintegtestCIDP>
49
27
Allow unauthenticated logins? (Provides scoped down permissions that you can control via AWS IAM)
50
-
Yes
28
+
No
51
29
Do you want to enable 3rd party authentication providers in your identity pool?
52
30
No
53
31
Please provide a name for your user pool:
@@ -86,11 +64,8 @@ Do you want to use an OAuth flow?
86
64
Do you want to configure Lambda Triggers for Cognito?
87
65
Yes
88
66
Which triggers do you want to enable for Cognito
89
-
Custom Message
90
67
Pre Sign-up
91
68
[Choose as many that you would like to manually verify later]
92
-
What functionality do you want to use for Custom Message
93
-
Create your own module
94
69
What functionality do you want to use for Pre Sign-up
? Do you want to configure advanced settings for the GraphQL API `No, I am done.`
93
+
? Do you have an annotated GraphQL schema? `No`
94
+
? Do you want a guided schema creation? `Yes`
95
+
? What best describes your project: `Single object with fields (e.g., “Todo” with ID, name, description)`
96
+
? Do you want to edit the schema now? `No`
124
97
```
125
98
99
+
The guided schema provided should look like this:
100
+
```json
101
+
type Todo @model {
102
+
id: ID!
103
+
name: String!
104
+
description: String
105
+
}
106
+
```
126
107
108
+
3. If you are using the latest CLI, update cli.json to include `"useExperimentalPipelinedTransformer": false` to ensure that it will use the v1 transformer.
127
109
128
110
4. `amplify push`
111
+
129
112
```perl
130
113
? Are you sure you want to continue? `Yes`
131
114
? Do you want to generate code for your newly created GraphQL API `No`
0 commit comments