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

[Bug]: List MyMemberships API not working as expected throwing sql error #7841

Open
2 tasks done
mahmoodfathy opened this issue Apr 24, 2024 · 2 comments · May be fixed by #7869
Open
2 tasks done

[Bug]: List MyMemberships API not working as expected throwing sql error #7841

mahmoodfathy opened this issue Apr 24, 2024 · 2 comments · May be fixed by #7869
Assignees
Labels
bug Something isn't working resources

Comments

@mahmoodfathy
Copy link

Preflight Checklist

  • I could not find a solution in the documentation, the existing issues or discussions
  • I have joined the ZITADEL chat

Environment

Self-hosted

Version

1.49

Database

PostgreSQL

Database Version

latest

Describe the problem caused by this bug

There is a bug in the Auth API : /auth/v1/memberships/me/_search :https://zitadel.com/docs/apis/resources/auth/auth-service-list-my-memberships
whenever you supply it a query filter it responds with the following response:

 data: {
      code: 2,
      message: 'ERROR: column members.grant_id does not exist (SQLSTATE 42703)'
    }
  }

for example when filtering with the projectGrantId , this happens with all possible query filters , for project id , project grant id and orgId , this is zitadel v.1.49 , haven't tested for the latest.

if you supply no filters it responds normally with all memberships

To reproduce

  1. call the /auth/v1/memberships/me/_search with a valid user access token who has a membership
  2. supply any query filter , you will get back the response above
const listMyMembershipsBody: V1ListMyMembershipsRequest = {
  queries: [
    {
      projectGrantQuery: {
        projectGrantId: "263164240339140617",
      },
    },
  ],
};

Screenshots

image

Expected behavior

it should filter the user membership according to the query filter

Operating System

windows

Relevant Configuration

No response

Additional Context

No response

@mahmoodfathy mahmoodfathy added the bug Something isn't working label Apr 24, 2024
@mahmoodfathy mahmoodfathy changed the title [Bug]: [Bug]: List MyMemberships API not working as expected throwing sql error Apr 24, 2024
@hifabienne
Copy link
Member

Hi @mahmoodfathy
Thanks for your report. I quickly tested it, and could reproduce

@doncicuto
Copy link
Contributor

Hei @hifabienne, may I've a look at this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resources
Projects
Status: 🐛 Bugs/Small Issues
Development

Successfully merging a pull request may close this issue.

3 participants