Assume you have following scenario in your enterprise github.
OrgA (we have 3 repos: repoA1, repoA2, repoA3)
OrgB (we have 3 repos: repoB1, repoB2, repoB3)
Assume that userOne has access to all 6 repos in both the organizations. Therefore, when user visit his GitHub UI, he can see all 6 repos.
However tokenOne created by the userOne only has authorized to access OrgA. which means this token can only access resources from repos : repoA1, repoA2, repoA3
For some reason in our API( /user/repos) when retrieving the repository list, it returns all 6 of them.
If user select any repos from OrgB ( for which tokenOne is not authorized) and tries to fetch further details like releases, pull requests then it will fail due to permission issues for further resources access of OrgB.
Is there a way to fetch only the authorized repo list so that only OrgA repos would be available?
I have tried different APIs but there doesn’t seem to be any direct API neither any indirect way to know the list of authorized org repos through rest API
Shreya Mishra is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.