Conversation
The Azure provider's `groups` and `baseGroups` filters previously only matched a group's display name. Azure AD display names are mutable and not unique, so operators commonly configure the stable object ID (GUID) instead. In that case the sync silently matched nothing and completed with zero groups and no diagnostic. - `groups` now matches an enumerated group by display name OR object ID - `baseGroups` resolves an entry via "id eq" when it is a GUID and "displayName eq" otherwise (the two cannot be combined because "id eq '<non-guid>'" is rejected by Microsoft Graph / Request_BadRequest) - a warning is logged when a non-empty `groups` filter matches nothing, so misconfiguration is visible instead of silently succeeding Adds unit tests for azureBaseGroupFilter and azureGroupMatches. Signed-off-by: lw12003 <jiro.higuchi@shi-g.com> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Collaborator
|
Hi @jirolin . There have been a number of changes to the operator recently. Would you be able to rebase/resolve the merge conflicts and we'll get to reviewing the PR? |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
The Azure provider's
groupsandbaseGroupsfilters only match against a group's display name:baseGroupsbuilds the Graph querydisplayName eq '<value>'groupsfilters enumerated groups client-side viaisGroupAllowed(displayName, ...)Azure AD group display names are mutable and not unique, so operators frequently configure the stable, unique object ID (GUID) instead. When an object ID is supplied today nothing matches and
Sync()returns 0 groups, with no error and no warning — the reconcile reports success and, withprune: false, any pre-existing group objects are left in place looking "synced", so the misconfiguration is effectively invisible.Change
groupsnow matches an enumerated group by its display name OR object ID.baseGroupsresolves each entry viaid eq '<guid>'when it is a valid GUID anddisplayName eq '<name>'otherwise. The two forms cannot be merged into a singledisplayName eq '…' or id eq '…'filter, becauseid eq '<non-guid>'is rejected by Microsoft Graph withRequest_BadRequest.groupsfilter matches nothing, so the misconfiguration is visible instead of silently succeeding.All changes are backward compatible — existing display-name configuration keeps working unchanged.
Testing
go build ./...,go vet ./pkg/syncer/go test ./pkg/syncer/(existing suite + new tests pass)TestAzureBaseGroupFilter,TestAzureGroupMatches🤖 Generated with Claude Code