From 30ddb084d091845c0cd89f6217e96fd4f30a80b1 Mon Sep 17 00:00:00 2001 From: Adam Jenkins Date: Sun, 1 Feb 2026 12:19:06 -0400 Subject: [PATCH 1/2] Add idp_attributes field to OrganizationMembership - Add idp_attributes: map() to type spec - Add :idp_attributes to defstruct - Add idp_attributes: map["idp_attributes"] || %{} to cast/1 with default empty map - CI will run tests (local testing was not possible due to dependency issues) 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 --- lib/workos/user_management/organization_membership.ex | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/workos/user_management/organization_membership.ex b/lib/workos/user_management/organization_membership.ex index 6d59b474..19db5d1c 100644 --- a/lib/workos/user_management/organization_membership.ex +++ b/lib/workos/user_management/organization_membership.ex @@ -9,6 +9,7 @@ defmodule WorkOS.UserManagement.OrganizationMembership do id: String.t(), user_id: String.t(), organization_id: String.t(), + idp_attributes: map(), updated_at: String.t(), created_at: String.t() } @@ -24,6 +25,7 @@ defmodule WorkOS.UserManagement.OrganizationMembership do :id, :user_id, :organization_id, + :idp_attributes, :updated_at, :created_at ] @@ -34,6 +36,7 @@ defmodule WorkOS.UserManagement.OrganizationMembership do id: map["id"], user_id: map["user_id"], organization_id: map["organization_id"], + idp_attributes: map["idp_attributes"] || %{}, updated_at: map["updated_at"], created_at: map["created_at"] } From a928c9b9c6a63152044ad80d72cd3a1e21923860 Mon Sep 17 00:00:00 2001 From: Adam Jenkins Date: Sun, 1 Feb 2026 20:07:51 -0400 Subject: [PATCH 2/2] Rename idp_attributes to custom_attributes --- lib/workos/user_management/organization_membership.ex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/workos/user_management/organization_membership.ex b/lib/workos/user_management/organization_membership.ex index 19db5d1c..f0a614a8 100644 --- a/lib/workos/user_management/organization_membership.ex +++ b/lib/workos/user_management/organization_membership.ex @@ -9,7 +9,7 @@ defmodule WorkOS.UserManagement.OrganizationMembership do id: String.t(), user_id: String.t(), organization_id: String.t(), - idp_attributes: map(), + custom_attributes: map(), updated_at: String.t(), created_at: String.t() } @@ -25,7 +25,7 @@ defmodule WorkOS.UserManagement.OrganizationMembership do :id, :user_id, :organization_id, - :idp_attributes, + :custom_attributes, :updated_at, :created_at ] @@ -36,7 +36,7 @@ defmodule WorkOS.UserManagement.OrganizationMembership do id: map["id"], user_id: map["user_id"], organization_id: map["organization_id"], - idp_attributes: map["idp_attributes"] || %{}, + custom_attributes: map["custom_attributes"] || %{}, updated_at: map["updated_at"], created_at: map["created_at"] }