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

Fixing issue #954 #1029

Merged
merged 1 commit into from Mar 20, 2019
Merged

Conversation

mikeparisstuff
Copy link
Contributor

Issue #, if available:

#954

Description of changes:

This stops creating API keys when user pools auth is enabled.

Changes:

  1. Moves the API key logic into the ModelAuthTransformer instead of the DynamoDBModelTransformer.
  2. The CLI loads the auth transformer always.
  3. Removed deprecated code that used to create a user pool from within the transform. This was only used by tests.
  4. Updated tests such that they create their own user pool and pass it by id to CloudFormation.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ghost ghost assigned mikeparisstuff Mar 12, 2019
@ghost ghost added the review label Mar 12, 2019
Copy link
Contributor

@yuth yuth left a comment

Choose a reason for hiding this comment

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

👍

const userPoolId = userPoolIdSelector(finishedStack.Outputs);
const userPoolClientId = userPoolClientIdSelector(finishedStack.Outputs);

// const userPoolIdSelector = outputValueSelector(ResourceConstants.OUTPUTS.AuthCognitoUserPoolIdOutput)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we get rid of this instead of commenting?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yup

@mikeparisstuff
Copy link
Contributor Author

Before merging this it would be nice to get this CLI integration tests for the api category wired up. I will work on this later this week.

Copy link
Contributor

@yuth yuth left a comment

Choose a reason for hiding this comment

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

Everything looks good. Just don't commit the amplify-e2e-tests/lib folder.

expect(meta.Region).toBeDefined();
const { AuthRoleName, UnauthRoleName, UnauthRoleArn, AuthRoleArn, DeploymentBucketName } = meta;

await expect(UnauthRoleName).toBeIAMRoleWithArn(UnauthRoleArn);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need these assertions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed these assertions.

const { output } = getProjectMeta(projRoot).api.simplemodel;
const { GraphQLAPIIdOutput, GraphQLAPIEndpointOutput, GraphQLAPIKeyOutput } = output;

await expect(GraphQLAPIIdOutput).toBeDefined()
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we assert that these values we have are indeed the right ones using aws-sdk

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a todo in the code for additional checking but I think pulling from the CloudFormation outputs should be enough for now.

@mikeparisstuff
Copy link
Contributor Author

Thanks for the review @yuth. I am going to merge this.

@mikeparisstuff mikeparisstuff merged commit 4b86e18 into aws-amplify:master Mar 20, 2019
@ghost ghost removed the review label Mar 20, 2019
@github-actions
Copy link

This pull request has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants