Skip to content

Commit aca8804

Browse files
ajworkosclaude
andauthored
Add custom_attributes field to OrganizationMembership (#318)
* Add idpAttributes field to OrganizationMembership - Add @Property array<string, mixed> $idpAttributes to PHPDoc - Add "idpAttributes" to RESOURCE_ATTRIBUTES array - Add "idp_attributes" => "idpAttributes" to RESPONSE_TO_RESOURCE_KEY mapping - Update test fixtures to include idp_attributes field - All 13 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> * Rename idp_attributes to custom_attributes --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 8d63a31 commit aca8804

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

lib/Resource/OrganizationMembership.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* @property RoleResponse $role
1515
* @property array<RoleResponse> $roles
1616
* @property 'active'|'inactive'|'pending' $status
17+
* @property array<string, mixed> $customAttributes
1718
* @property string $createdAt
1819
* @property string $updatedAt
1920
*/
@@ -29,6 +30,7 @@ class OrganizationMembership extends BaseWorkOSResource
2930
"role",
3031
"roles",
3132
"status",
33+
"customAttributes",
3234
"createdAt",
3335
"updatedAt"
3436
];
@@ -41,6 +43,7 @@ class OrganizationMembership extends BaseWorkOSResource
4143
"role" => "role",
4244
"roles" => "roles",
4345
"status" => "status",
46+
"custom_attributes" => "customAttributes",
4447
"created_at" => "createdAt",
4548
"updated_at" => "updatedAt"
4649
];

tests/WorkOS/UserManagementTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1750,6 +1750,7 @@ private function organizationMembershipResponseFixture($status = "active")
17501750
],
17511751
],
17521752
"status" => $status,
1753+
"custom_attributes" => [],
17531754
"created_at" => "2021-06-25T19:07:33.155Z",
17541755
"updated_at" => "2021-06-25T19:07:33.155Z",
17551756
]);
@@ -1774,6 +1775,7 @@ private function organizationMembershipListResponseFixture()
17741775
]
17751776
],
17761777
"status" => "active",
1778+
"custom_attributes" => [],
17771779
"created_at" => "2021-06-25T19:07:33.155Z",
17781780
"updated_at" => "2021-06-25T19:07:33.155Z",
17791781
]
@@ -1798,6 +1800,7 @@ private function organizationMembershipFixture()
17981800
new RoleResponse("admin"),
17991801
],
18001802
"status" => "active",
1803+
"customAttributes" => [],
18011804
"createdAt" => "2021-06-25T19:07:33.155Z",
18021805
"updatedAt" => "2021-06-25T19:07:33.155Z",
18031806
];

0 commit comments

Comments
 (0)