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

test(api): e2e for iam provider on rds models #1957

Merged

Conversation

sundersc
Copy link
Contributor

Adding E2E tests for Auth Directive IAM provider support.

  • Covers IAM public and private rules. (Public rule strictly gives access to unauthRule and private rule gives access to the logged in users).
  • Mutli-auth scenarios with API key, lambda and IAM for queries, mutations and subscriptions.

@sundersc sundersc requested review from a team as code owners October 16, 2023 18:12
@sundersc sundersc changed the base branch from main to feature/rds-support-preview2 October 16, 2023 18:12
Comment on lines +112 to +121
blogIAMUnauthClient = constructBlogHelper(unauthAppSyncClient);
postIAMUnauthClient = constructPostHelper(unauthAppSyncClient);
userIAMUnauthClient = constructUserHelper(unauthAppSyncClient);
profileIAMUnauthClient = constructProfileHelper(unauthAppSyncClient);
blogIAMAuthClient = constructBlogHelper(authAppSyncClient);
postIAMAuthClient = constructPostHelper(authAppSyncClient);
userIAMAuthClient = constructUserHelper(authAppSyncClient);
profileIAMAuthClient = constructProfileHelper(authAppSyncClient);
userApiKeyClient = constructUserHelper(apiKeyClient);
userLambdaClient = constructUserHelper(lambdaClient);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of these clients are unused today but left them here for future work to add more test cases.

cognitoIdentityPoolId: hasIdentityPoolId ? ref('ctx.stash.identityPoolId') : nul(),
...(role.strategy === 'private' && { cognitoIdentityPoolId: identityPoolId ? str(identityPoolId) : nul() }),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to reference the identityPoolId in stash, right? I don't think that value identityPoolId you're referencing exists. This should fail to build if I'm not mistaken.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, just double-checked, and it looks like the build is failing on this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, looks rebase didn't go well. Looking into it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR has been updated now with the correct changes.

packages/amplify-e2e-tests/src/utils/api.ts Show resolved Hide resolved
alharris-at
alharris-at previously approved these changes Oct 16, 2023
@phani-srikar
Copy link
Contributor

The build job is still failing

@sundersc
Copy link
Contributor Author

All the tests are passing now.

@sundersc sundersc merged commit 4845915 into aws-amplify:feature/rds-support-preview2 Oct 18, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants