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

fix: generate correct auth mode for admin queries in amplifyconfiguration.json #7118

Merged
merged 1 commit into from Apr 29, 2021

Conversation

yuth
Copy link
Contributor

@yuth yuth commented Apr 16, 2021

Updated the fronted config files creator to have the correct authorization type for Admin Queries. The earlier implementation had AWS_IAM hardcoded. The updated config looks similar to this

{
  "api": {
        "plugins": {
                "AdminQueries": {
                    "endpointType": "REST",
                    "endpoint": "https://zzzz.execute-api.us-west-2.amazonaws.com/dev",
                    "region": "us-west-2",
                    "authorizationType": "AMAZON_COGNITO_USER_POOLS"
                }
            }
        }
    }
}

fix #6983

Description of changes

Issue #, if available

Description of how you validated changes

Checklist

  • PR description included
  • yarn test passes
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

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

Updated the frontend config files to have the correct authorization type for AdminQueries

fix aws-amplify#6983
@yuth yuth requested a review from a team as a code owner April 16, 2021 22:54
@yuth yuth changed the title fix: render the right auth mode for admin queries in config files fix: generate correct auth mode for admin queries in amplifyconfiguration.json Apr 19, 2021
@kaustavghosh06
Copy link
Contributor

For existing projects, what's the plan for mitigation? Will we auto-add the authorization type in amplify-meta.json?

@yuth
Copy link
Contributor Author

yuth commented Apr 21, 2021

For existing projects, what's the plan for mitigation? Will we auto-add the authorization type in amplify-meta.json?

We are not doing any migration work as the Admin Queries never worked in that case. The fix would be to remove the admin queries and add it back again to get the fix.

@kneekey23
Copy link

kneekey23 commented Apr 21, 2021

@yuth not a great solution, I updated my admin queries functions to have some custom code so removing and re-adding isn't a fun time. id rather just continue to manually fix it after an amplify push

@attilah attilah merged commit 8f8deba into aws-amplify:master Apr 29, 2021
@siegerts
Copy link
Contributor

siegerts commented May 4, 2021

👋 Hi, this issue was referenced in the v4.50.2 release!

Check out the release notes here https://github.com/aws-amplify/amplify-cli/releases/tag/v4.50.2.

@siegerts siegerts added the referenced-in-release Issues referenced in a published release changelog label May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
referenced-in-release Issues referenced in a published release changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Amplify CLI adds Admin Queries API with wrong auth type
8 participants