Skip to content

Add 'additionalFields' Field to extract additional data from MSGraph - #122

Open
JRaver wants to merge 1 commit into
upbound:mainfrom
JRaver:feature/add-additional-user-fields
Open

Add 'additionalFields' Field to extract additional data from MSGraph#122
JRaver wants to merge 1 commit into
upbound:mainfrom
JRaver:feature/add-additional-user-fields

Conversation

@JRaver

@JRaver JRaver commented Jul 27, 2026

Copy link
Copy Markdown

Description of your changes

Adds optional additionalFields []string to the Input type, allowing consumers to include extra Microsoft Graph API attributes in query results beyond the fixed default set. Supported for all four query types: UserValidation, GroupObjectIDs, ServicePrincipalDetails, and GroupMembership.

Implementation notes for reviewers:

Field values are resolved via reflection (GetCity(), GetJobTitle(), etc.) rather than GetAdditionalData(), because the kiota-generated SDK deserializes known Graph properties into typed struct fields — GetAdditionalData() only contains OData extension attributes. The helper falls back to additionalData for true extension attributes.
GroupMembership dynamically builds the nested $expand string (members($select=id,displayName,...,extraField)) to include additional fields in the Graph API request.
Unknown field names are logged at Info level and skipped — no reconcile failure.
Implement #121
Tested with the crossplane v2.3.4

Fixes #
README.md
example/user-validation-additional-fields-example.yaml
fn.go
fn_test.go
input/v1beta1/input.go
input/v1beta1/zz_generated.deepcopy.go
package/input/msgraph.fn.crossplane.io_inputs.yaml

I have:

Signed-off-by: Yevhen Artemenko <eartemenko@playtika.com>
@JRaver
JRaver force-pushed the feature/add-additional-user-fields branch from 5715075 to 75824b3 Compare July 27, 2026 05:48
@JRaver

JRaver commented Jul 28, 2026

Copy link
Copy Markdown
Author

@kaessert @jakubramut Please take a look on the PR when you will have time. Thanks)

@vtl-1

vtl-1 commented Jul 29, 2026

Copy link
Copy Markdown

👍

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.

3 participants