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

Amplify CLI adds Admin Queries API with wrong auth type #6983

Closed
4 tasks done
kneekey23 opened this issue Mar 30, 2021 · 4 comments · Fixed by #7118
Closed
4 tasks done

Amplify CLI adds Admin Queries API with wrong auth type #6983

kneekey23 opened this issue Mar 30, 2021 · 4 comments · Fixed by #7118
Assignees
Labels
auth Issues tied to the auth category of the CLI bug Something isn't working referenced-in-release Issues referenced in a published release changelog

Comments

@kneekey23
Copy link

Before opening, please confirm:

  • I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
  • I have searched for duplicate or closed issues.
  • I have read the guide for submitting bug reports.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

v13.7.0

Amplify CLI Version

4.45.2

What operating system are you using?

Mac

Amplify Categories

auth, api

Amplify Commands

add, pull

Describe the bug

When I add the admin queries API it adds it wiht the wrong auth type, as you can see below it adds it with AWS_IAM and not AMAZON_COGNITO_USER_POOLS like it should be

    "api": {
        "plugins": {
            "awsAPIPlugin": {
                "amplifyDatasource": {
                    "endpointType": "GraphQL",
                    "endpoint": "https://z4idgkzgevagjmr4vwfh5ozcsq.appsync-api.us-west-2.amazonaws.com/graphql",
                    "region": "us-west-2",
                    "authorizationType": "AMAZON_COGNITO_USER_POOLS"
                },
                "AdminQueries": {
                    "endpointType": "REST",
                    "endpoint": "https://oall6h52m6.execute-api.us-west-2.amazonaws.com/dev",
                    "region": "us-west-2",
                    "authorizationType": "AWS_IAM"
                }
            }
        }
    },

Expected behavior

I expect the cli to add the admin queries api with the cognito user pool auth.

Reproduction steps

amplify update auth
walk through steps to add admin queries api give cli the group name "Admins"

GraphQL schema(s)

# Put schemas below this line

Log output

# Put your logs below this line


@edwardfoyle
Copy link
Member

@kneekey23 what file is shown above? I don't recognize the format.

@edwardfoyle edwardfoyle added auth Issues tied to the auth category of the CLI pending-triage Issue is pending triage labels Mar 30, 2021
@kneekey23
Copy link
Author

@edwardfoyle this is from the amplifyconfiguration.json on iOS:

{
    "UserAgent": "aws-amplify-cli/2.0",
    "Version": "1.0",
    "api": {
        "plugins": {
            "awsAPIPlugin": {
                "amplifyDatasource": {
                    "endpointType": "GraphQL",
                    "endpoint": "https://XXX.appsync-api.us-west-2.amazonaws.com/graphql",
                    "region": "us-west-2",
                    "authorizationType": "AMAZON_COGNITO_USER_POOLS"
                },
                "AdminQueries": {
                    "endpointType": "REST",
                    "endpoint": "https://XXXX.execute-api.us-west-2.amazonaws.com/dev",
                    "region": "us-west-2",
                    "authorizationType": "AWS_IAM"
                }
            }
        }
    },
    "auth": {
        "plugins": {
            "awsCognitoAuthPlugin": {
                "UserAgent": "aws-amplify/cli",
                "Version": "0.1.0",
                "IdentityManager": {
                    "Default": {}
                },
                "AppSync": {
                    "Default": {
                        "ApiUrl": "https://XXXX.appsync-api.us-west-2.amazonaws.com/graphql",
                        "Region": "us-west-2",
                        "AuthMode": "AMAZON_COGNITO_USER_POOLS",
                        "ClientDatabasePrefix": "amplifyDatasource_AMAZON_COGNITO_USER_POOLS"
                    }
                },
                "CredentialsProvider": {
                    "CognitoIdentity": {
                        "Default": {
                            "PoolId": "us-west-2:XXXXXXXXXXXXXXXX",
                            "Region": "us-west-2"
                        }
                    }
                },
                "CognitoUserPool": {
                    "Default": {
                        "PoolId": "us-west-2_XXXXXXXXX",
                        "AppClientId": "XXXXXXXXXXXXXXX",
                        "Region": "us-west-2",
                        "AppClientSecret": "XXXXXXXXXXXXXXXXXXXXXX"
                    }
                },
                "Auth": {
                    "Default": {
                        "authenticationFlowType": "USER_SRP_AUTH"
                    }
                }
            }
        }
    }
}

@kaustavghosh06 kaustavghosh06 added bug Something isn't working and removed pending-triage Issue is pending triage labels Apr 1, 2021
@kaustavghosh06 kaustavghosh06 added this to To do in Bug bash via automation Apr 5, 2021
@litwicki litwicki moved this from To do to In progress in Bug bash Apr 16, 2021
@ammarkarachi ammarkarachi self-assigned this Apr 16, 2021
@litwicki litwicki assigned yuth and unassigned ammarkarachi Apr 16, 2021
yuth added a commit to yuth/amplify-cli that referenced this issue Apr 16, 2021
Updated the frontend config files to have the correct authorization type for AdminQueries

fix aws-amplify#6983
@yuth yuth moved this from In progress to Review in Bug bash Apr 16, 2021
Bug bash automation moved this from Review to Done Apr 29, 2021
attilah pushed a commit that referenced this issue Apr 29, 2021
)

fixes #6983: Updated the frontend config files to have the correct authorization type for AdminQueries
@siegerts siegerts added the referenced-in-release Issues referenced in a published release changelog label May 4, 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.

@github-actions
Copy link

github-actions bot commented Jun 3, 2021

This issue 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 Jun 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auth Issues tied to the auth category of the CLI bug Something isn't working referenced-in-release Issues referenced in a published release changelog
Projects
Bug bash
  
Done
Bug triage
Awaiting triage
Development

Successfully merging a pull request may close this issue.

6 participants