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

Unable to see my schema using amplify mock #1866

Closed
2 tasks done
jguipi opened this issue Sep 15, 2023 · 1 comment
Closed
2 tasks done

Unable to see my schema using amplify mock #1866

jguipi opened this issue Sep 15, 2023 · 1 comment
Labels
bug Something isn't working duplicate This issue or pull request already exists mock theme:mock transferred

Comments

@jguipi
Copy link

jguipi commented Sep 15, 2023

How did you install the Amplify CLI?

curl -sL https://aws-amplify.github.io/amplify-cli/install-win -o install.cmd && install.cmd

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

18.16.0

Amplify CLI Version

12.4.0

What operating system are you using?

windows 10

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

No manual changes made

Describe the bug

Summary:
When using the amplify mock api command, I am unable to view my schema and documentation for a project that utilizes IAM (Identity and Access Management) or User Pool as the authentication method. After extensive testing, I have observed that a brand-new project without IAM or User Pool authentication works as expected. This issue appears to be specific to projects using these authentication methods.

Steps to Reproduce:

Create a new Amplify project.
Configure authentication using IAM or User Pool.
Define an API with a GraphQL schema.
Run amplify mock api.
Attempt to access the GraphQL schema and documentation.
Expected Behavior:
I should be able to access and view the GraphQL schema and documentation when running amplify mock api, regardless of the authentication method used.

Actual Behaviour:
When IAM or User Pool authentication is enabled in the project, running amplify mock api results in an inability to access the GraphQL schema. This issue does not occur in projects without IAM or User Pool authentication, it works when I use API key.

I should be able to change the authentication method in the UI as well. It appears that currently, we are limited to using only the API key.
image
image

Additional Information:

Thank you for your attention to this matter, and I appreciate any assistance or insights you can offer to resolve this issue. Not being able to mock different authorization rules slows down the development process, as I am required to push changes to the cloud every time I make a small adjustment, followed by the need to retest.

Expected behavior

Being able to change the authentication method and test various authorization policies without the need to push changes to the cloud would significantly enhance the development process.

Reproduction steps

Create a new Amplify project.
Configure authentication using IAM or User Pool.
Define an API with a GraphQL schema.
Run amplify mock api.
Attempt to access the GraphQL schema and documentation.

Example of authorization policy:

  @auth(
    rules: [
      {allow: public, operations: [read]}
      {allow: private, operations: [read, update], provider: userPools}
      {allow: owner, operations: [get, update]}
      {allow: private, operations: [read], provider: iam}
    ]
  )

Project Identifier

No response

Log output

# Put your logs below this line


Additional information

No response

Before submitting, please confirm:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.
@josefaidt
Copy link
Contributor

Hey @jguipi 👋 thanks for raising this! Unfortunately this is a known issue that the team is investigating. I'm going to transfer this over to our API repo for tracking purposes, and mark as a duplicate of #1369 and #1269

@josefaidt josefaidt transferred this issue from aws-amplify/amplify-cli Sep 18, 2023
@josefaidt josefaidt added transferred bug Something isn't working duplicate This issue or pull request already exists mock theme:mock and removed pending-triage labels Sep 18, 2023
@josefaidt josefaidt closed this as not planned Won't fix, can't repro, duplicate, stale Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists mock theme:mock transferred
Projects
None yet
Development

No branches or pull requests

2 participants