This repository was archived by the owner on May 16, 2024. It is now read-only.
Add wildcard option to group field #626
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changed?
Follow up PR to #625
This PR adds functionality to support wildcard in
groupsfield for IdentityConfiguration config. Thus common-fate fetches all the groups that Okta API token has access to.Why?
Current state:
We do ListUsers = ListAllUsersAPICall (code) + numberOfUsers * GetUserGroupsAPICall (code) and we do ListGroups(ListAllGroupsAPICall). Every API call also may include pagination, but we donβt take it into account in these calculations. Also number of operations to parse/create map/etc. is O(numberOfGroups * numberOfUser.
This PR:
We'll call ListGroups first if the
groupsfield is provided, then we will fetch all users for every group and then group membership will be used to fillGroupsfield for every user. In this case we need to fetch users for every groups. So in total it will be ListGroups(ListAllGroupsAPICall) + numberOfGroups * GetGroupUsers + ListAllUsersAPICall (it may be omit, because we already have all the users from groups that commonfate has access to). Number of operations is the same O(numberOfGroups * numberOfUser).Thus this optimization makes sense if
# groups << # users. We'll add this information to docs here - https://github.com/common-fate/docs if the PR is approved.How did you test it?
We tested it in our env.
Potential risks
N/A
Is patch release candidate?
No
Link to relevant docs PRs
#625