Nested group flattening not working
naharoo opened this issue · 3 comments
naharoo commented
Describe the bug
Running the v2.2.1 version of SSOSync doesn't flatten nested Google Workspace Groups.
To Reproduce
- Deploy SSOSync in an AWS account using the Serverless Application Repository template according to the Readme doc.
- Set
name:AWS*
as GoogleGroupMatch - Create Google Workpsace groups
AWS Group 1
andAWS Group 2
- Add an internal user to group
AWS Group 2
- Add the group
AWS Group 2
to groupAWS Group 1
- Trigger the lambda function
Expected behavior
I expect the user and the group to be created in AWS SSO and the user to be added to the group.
Additional context
I guess that the following code snippet from sync.go
file is causing this problem:
for _, m := range groupMembers {
// ...
// handle nested groups, by adding their membership to the end of googleMembers
if m.Type == "GROUP" {
groupMembers = append (groupMembers, s.getGoogleSubGroupMembers(m)...)
continue
}
// ...
}
As you can see it is updating the variable groupMembers
and the loop will not iterate over the newly added items.
ChrisPates commented
Thank you are quite right. More hast less speed, let me take a look and I'll try to get a fix out shortly.
ChrisPates commented
Fix coming through as v2.2.2. Building now.
naharoo commented
@ChrisPates thanks for the quick fix! I can confirm that the group nested feature works like a charm in v2.2.2.