Merge pull request #27947 from cthtrifork/bugfix/restrictuserstogroup-use-grouppath

This commit is contained in:
Ben Lambert
2024-12-11 08:05:27 +01:00
committed by GitHub
3 changed files with 9 additions and 4 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend-module-gitlab': patch
---
`restrictUsersToGroup` should use the entire group path when getting members
@@ -83,7 +83,7 @@ const httpHandlers = [
}),
rest.get(
`${apiBaseUrlSaas}/groups/subgroup1/members/all`,
`${apiBaseUrlSaas}/groups/group1%2Fsubgroup1/members/all`,
(_req, res, ctx) => {
return res(ctx.json(subgroup_saas_users_response)); // To-DO change
},
@@ -400,14 +400,14 @@ export class GitlabOrgDiscoveryEntityProvider implements EntityProvider {
groups.push(await this.gitLabClient.getGroupByPath(this.config.group)); // adds the parent group for #26554
const rootGroupSplit = this.config.group.split('/');
const rootGroup = this.config.restrictUsersToGroup
? rootGroupSplit[rootGroupSplit.length - 1]
const groupPath = this.config.restrictUsersToGroup
? this.config.group
: rootGroupSplit[0];
users = paginated<GitLabUser>(
options =>
this.gitLabClient.listSaaSUsers(
rootGroup,
groupPath,
options,
this.config.includeUsersWithoutSeat,
),