Skip to content

fix: return mail and userPrincipalName for GroupMembership user members#116

Merged
stevendborrelli merged 2 commits into
mainfrom
issue-115
Jun 20, 2026
Merged

fix: return mail and userPrincipalName for GroupMembership user members#116
stevendborrelli merged 2 commits into
mainfrom
issue-115

Conversation

@ytsarev

@ytsarev ytsarev commented Jun 19, 2026

Copy link
Copy Markdown
Member

Description of your changes

Expanded group members are deserialized into typed SDK objects, so user properties (mail, userPrincipalName) and service principal appId live on the typed getters rather than in additionalData. Read from the typed getters with an additionalData fallback, and request the fields explicitly via a nested $select. Adds direct processMember tests covering typed users, service principals, and the DirectoryObject fallback path.

Fixes #115

render test

crossplane render xr.yaml group-membership-example.yaml functions.yaml \
  --function-credentials=./secrets/azure-creds.yaml -rc
..
  groupMembers:
  - displayName: Yury Tsarev
    id: <omitted>
    type: user
    userPrincipalName: yury@upbound.io

I have:

Expanded group members are deserialized into typed SDK objects, so user
properties (mail, userPrincipalName) and service principal appId live on
the typed getters rather than in additionalData. Read from the typed
getters with an additionalData fallback, and request the fields explicitly
via a nested $select. Adds direct processMember tests covering typed users,
service principals, and the DirectoryObject fallback path.

Fixes #115
@ytsarev ytsarev requested a review from a team June 19, 2026 16:12

@stevendborrelli stevendborrelli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, a couple of comments from a LLM scan.

Comment thread fn.go
Comment thread fn_test.go
Covers the common Entra ID state where a user has a userPrincipalName but
no mail attribute: mail is omitted while userPrincipalName and type=user
are still returned. Addresses review feedback on PR #116.
@stevendborrelli stevendborrelli merged commit 810ff0c into main Jun 20, 2026
5 checks passed
@stevendborrelli stevendborrelli deleted the issue-115 branch June 20, 2026 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The GroupMembership query returns only id, displayName, and type for each member, omitting mail, userPrincipalName

2 participants