n4bb12 / verdaccio-github-oauth-ui

📦🔐 GitHub OAuth plugin for Verdaccio
https://verdaccio.org
MIT License
73 stars 45 forks source link

added teams as group #124

Closed melkosoft closed 3 years ago

melkosoft commented 3 years ago

There are several things in your latest release which are wrong: REST API you are using for teams request will return all teams VISIBLE for user. For enterprise github my account as owner of organization may see ALL teams not only teams I am member of. There only way to get teams for user other than going through each team and get list of members - graphQL query. I modified query Bertrand used because without pagination graphQL will return only 100 first results. I am using slug instead of name for team because team name may include spaces which is not very good... I also modified team filter to accept multiple teams as filter and I added teams requested to real_group array for authorization

melkosoft commented 3 years ago

Sorry I was wrong about groups, still better to do filtering by organization and as result have just teams from organization without github/org/team_name. In this case when using $groups in packages section user will use scope like "@team_name/package":

packages:
   "@*/*":
     access: $authenticated
     publish: $group