line / centraldogma

Highly-available version-controlled service configuration repository based on Git, ZooKeeper and HTTP/2
https://line.github.io/centraldogma/
Apache License 2.0
604 stars 118 forks source link

Include the project role of a request token or user in project API #989

Closed ikhoon closed 3 months ago

ikhoon commented 4 months ago

Motivation:

I think it is necessary to filter projects to which users belong or display their roles on the screen.

Currently, user information can't be obtained from /api/v1/projects API. So we need to call /api/v1/projects/${projectName} to get the metadata. That means 20 API calls should be made to list 20 projects in /app/projects. It will cause additional loads to servers and increase page loading time.

To resolve the N+1 query problem, I propose to add the role of a requested user to ProjectDto.

Modifications:

Result:

ikhoon commented 4 months ago
image image