awslabs / ssosync

Populate AWS SSO directly with your G Suite users and groups using either a CLI or AWS Lambda
Apache License 2.0
517 stars 178 forks source link

Add caching to avoid duplicate user fetches #137

Closed samdotci closed 5 months ago

samdotci commented 1 year ago

Issue #, if available:

N/A

Description of changes:

At present, the getGoogleGroupsAndUsers function iterates over each group, then over each user, fetching each user sequentially from Google.

As a user can be part of multiple groups, we can minimise the number of calls to Google and improve performance. Using the existing gUniqUsers map, we can check if an entry for the user was added in a previous group iteration.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

ChrisPates commented 5 months ago

Addressed by v2.2.0