Skip to content

CXP-545 Add field mask to ListUsers #110

Open
JavierCarnelli-ConductorOne wants to merge 1 commit into
mainfrom
fix/cxp-545
Open

CXP-545 Add field mask to ListUsers #110
JavierCarnelli-ConductorOne wants to merge 1 commit into
mainfrom
fix/cxp-545

Conversation

@JavierCarnelli-ConductorOne
Copy link
Copy Markdown
Contributor

Adds a field mask to the Users query to to prevent Lambda OOM/timeout on large directories

Projection("full") without a field mask returns every user attribute (aliases, phones, addresses, ssh keys, etc.). For tenants with many custom-schema fields this inflates each page to megabytes, causing Lambda OOM or 300s timeout and an Unhandled crash (CXP-545).

Add a listUsersFields constant that restricts the response to the 19 fields the connector actually reads. This eliminates the unused bulk while preserving customSchemas, organizations, relations, posixAccounts and externalIds. MaxResults stays at 200 since the mask reduces per-page payload size by ~80-90% for attribute-heavy directories.

…ge directories

Projection("full") without a field mask returns every user attribute
(aliases, phones, addresses, ssh keys, etc.). For tenants with many
custom-schema fields this inflates each page to megabytes, causing
Lambda OOM or 300s timeout and an Unhandled crash (CXP-545).

Add a listUsersFields constant that restricts the response to the 19
fields the connector actually reads. This eliminates the unused bulk
while preserving customSchemas, organizations, relations, posixAccounts
and externalIds. MaxResults stays at 200 since the mask reduces
per-page payload size by ~80-90% for attribute-heavy directories.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 26, 2026

CXP-545

@github-actions
Copy link
Copy Markdown
Contributor

Connector PR Review: CXP-545 Add field mask to ListUsers

Blocking Issues: 0 | Suggestions: 0 | Threads Resolved: 0
Review mode: full
View review run

Review Summary

This PR adds a googleapi.Field mask to the ListUsers call to restrict the response to only the 19 user fields the connector reads, preventing Lambda OOM/timeout for tenants with large custom schemas. I verified the field mask against every user.* field access in user.go — all consumed fields (id, primaryEmail, name, thumbnailPhotoUrl, archived, suspended, suspensionReason, deletionTime, isEnrolledIn2Sv, creationTime, lastLoginTime, orgUnitPath, includeInGlobalAddressList, customerId, relations, organizations, customSchemas, posixAccounts, externalIds) are present, and nextPageToken is included at the top level for pagination. No fields are missing and no unused fields are included.

Security Issues

None found.

Correctness Issues

None found.

Suggestions

None.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

No blocking issues found.

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