-
Notifications
You must be signed in to change notification settings - Fork 25
Add custom_attributes field to OrganizationMembership #524
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
3
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.
+3
−1
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 idp_attributes: dict[str, Any] to OrganizationMembership model - Update MockOrganizationMembership fixture - All organization_membership tests pass 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 SummaryThis PR adds the Key Changes:
Issues Found:
Confidence Score: 2/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant IDP as Identity Provider
participant API as WorkOS API
participant SDK as Python SDK
participant App as Application Code
IDP->>API: Provides user attributes<br/>(department, employee_id, etc.)
Note over API: Stores as customAttributes<br/>in organizationMembership
App->>SDK: list_organization_memberships()
SDK->>API: GET /organization_memberships
API->>SDK: Returns JSON with customAttributes
Note over SDK: Deserializes to<br/>OrganizationMembership.idp_attributes
SDK->>App: OrganizationMembership object
Note over App: Access IDP attributes:<br/>membership.idp_attributes["department"]
|
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.
2 files reviewed, 3 comments
Use Dict[str, Any] instead of dict[str, Any] for Python 3.8 compatibility. The lowercase dict syntax is only available in Python 3.9+. Fixes issue identified by Greptile bot review. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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)