pipecd
pipecd copied to clipboard
Support GitHub teams(30+) in the single sign-on.
What would you like to be added:
In the Single sign-on feature with Github, it would be great if we could set up permissions with Role-Based Access Control, even if a user belongs to many teams (30+).
Why is this needed:
I am configuring single sign-on for access to PipeCD's Project using Github Enterprise.
The problem I am encountering is that when I assign a role such as editor on PipeCD Project to a newly created team, I get the following error.
auth-handler: Unable to find user {"error": "user (<my name>) not found in any of the 30 project teams"}
According to the github api documentation, only 30 teams are returned by default. https://docs.github.com/en/rest/reference/teams#list-teams-for-the-authenticated-user
Therefore, the current code does not seem to be able to retrieve more than 30 teams. https://github.com/pipe-cd/pipecd/blob/5c1e5197f14b71d/pkg/oauth/github/github.go#L107 https://github.com/google/go-github/blob/3e8a7f0fbe0e4402f9ad/github/teams.go#L529-L531
@misukuro
Hello. Thanks for your report.
You are totally right. Currently, only 30 teams are being fetched to check.
We will find a solution to solve this problem. But as a temporary solution, we can increase the PerPage
value to 100.
So could you please send a pull request to explicitly specify the PerPage
value in ListOptions
to 100 at this line https://github.com/pipe-cd/pipecd/blob/5c1e5197f14b71d/pkg/oauth/github/github.go#L107 ?
@misukuro Btw, if you are encountering this problem in your environment, we can have a new release immediately after having that temporary fix.
@nghialv Hi, thanks for the quick confirmation. I have created a PR for a temporary fix. Could you please review it? https://github.com/pipe-cd/pipecd/pull/3502
@misukuro Thank you for your contribution.
We are reviewing it now and going to make a new release after it got merged. 🙌
@misukuro We have just released v0.27.2
which contains your patch. Please upgrade to that version to fix your described problem.
We also have just upgraded the PipeCD playground environment and confirmed that it works fine. https://play.pipecd.dev/applications?project=play (If you want you can log in to that environment to see the newest version of PipeCD)
Please let us know if you face any other issues. Thanks.
@nghialv I upgraded my environment to v0.27.2 and confirmed that I can now log in. Thanks for your help.
@misukuro Glad to hear that.
Thank you.
quick question: so this issue is solved?
quick question: so this issue is solved?
it's temporary fixed by update the pageSize of Github api request to 100 (previously 30), so if your github org's teams number is lower than that limit, it should be fine 👍
@khanhtc1202 ,
thx for the explanation. Yes, for me this issues is fixed :)
thx again!
@rfelgent you are welcome 😄 Thanks for using PipeCD :)
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity. Feel free to reopen if still applicable.