-
Notifications
You must be signed in to change notification settings - Fork 44
Add custom_attributes field to OrganizationMembership #1458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ajworkos
wants to merge
4
commits into
main
Choose a base branch
from
feature/add-idp-attributes-to-org-membership
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
- Add idpAttributes to OrganizationMembership interface - Add idp_attributes to OrganizationMembershipResponse interface - Update serializer to map idp_attributes field - Add idp_attributes to JSON fixtures - Update tests to verify field presence This change adds support for IDP custom attributes on organization memberships, which are sourced from the identity provider and stored as customAttributes in the API. Related to workos/workos PR #50470 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Contributor
Greptile OverviewGreptile SummaryAdded Key Changes
Missing Update
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant SDK as WorkOS SDK
participant API as WorkOS API
participant IDP as Identity Provider
Note over API,IDP: IDP provides custom attributes
IDP->>API: User attributes (department, employee_id, etc.)
API->>API: Store as customAttributes
Client->>SDK: getOrganizationMembership(id)
SDK->>API: GET /organization_memberships/:id
API->>SDK: OrganizationMembershipResponse with idp_attributes
SDK->>SDK: deserializeOrganizationMembership()
SDK->>SDK: Map idp_attributes → idpAttributes
SDK->>Client: OrganizationMembership with idpAttributes
Client->>SDK: listOrganizationMemberships()
SDK->>API: GET /organization_memberships
API->>SDK: List with idp_attributes in each item
SDK->>SDK: deserializeOrganizationMembership() for each
SDK->>Client: Array with idpAttributes
Note over API,Client: Also available in webhooks and events
API->>Client: Webhook: organization_membership.created
Note over Client: Contains idp_attributes field
|
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 files reviewed, 1 comment
Contributor
Additional Comments (1)
Prompt To Fix With AIThis is a comment left during a code review.
Path: src/actions/fixtures/authentication-action-context.json
Line: 29:40
Comment:
Missing `idp_attributes` field in organization_membership object
```suggestion
"organization_membership": {
"object": "organization_membership",
"id": "01JATCNVYCHT1SZGENR4QTXKRK",
"user_id": "01JATCHZVEC5EPANDPEZVM68Y9",
"organization_id": "01JATCMZJY26PQ59XT9BNT0FNN",
"role": {
"slug": "member"
},
"status": "active",
"idp_attributes": {},
"created_at": "2024-10-22T17:12:50.746Z",
"updated_at": "2024-10-22T17:12:50.746Z"
}
```
How can I resolve this? If you propose a fix, please make it concise. |
Fixes missing idp_attributes field in the organization_membership object within the authentication action context fixture, as identified by Greptile bot. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
ajworkos
commented
Feb 1, 2026
14b93a1 to
00e1a9d
Compare
Updated actions.spec.ts to expect idpAttributes, organizationName, lastSignInAt, and locale fields in the serialized objects.
00e1a9d to
48544b3
Compare
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.
Summary
Adds
custom_attributesfield toOrganizationMembershipmodel to expose custom attributes from identity providers.Changes
custom_attributesfield to OrganizationMembership type/model{}API Field Details
The field will be present in:
JSON field name:
custom_attributes(snake_case)