From 819d7dc588a9b3dc9963305de37126dd09debac0 Mon Sep 17 00:00:00 2001 From: Matt Dzwonczyk <9063128+mattgd@users.noreply.github.com> Date: Fri, 25 Apr 2025 07:40:04 -0400 Subject: [PATCH 1/2] Add custom_attributes field to SSO Profile. (#434) (cherry picked from commit aa98f87ba356c455bd931c17396b723b4aa49f5e) --- tests/test_sso.py | 2 +- tests/utils/fixtures/mock_profile.py | 6 +++++- workos/types/sso/profile.py | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/test_sso.py b/tests/test_sso.py index 52a79279..47de4fba 100644 --- a/tests/test_sso.py +++ b/tests/test_sso.py @@ -29,7 +29,7 @@ def mock_magic_link_profile(self): idp_id="", first_name=None, last_name=None, - profile=None, + role=None, groups=None, raw_attributes={}, ).dict() diff --git a/tests/utils/fixtures/mock_profile.py b/tests/utils/fixtures/mock_profile.py index 88813eb9..23d73dad 100644 --- a/tests/utils/fixtures/mock_profile.py +++ b/tests/utils/fixtures/mock_profile.py @@ -6,7 +6,7 @@ class MockProfile(Profile): def __init__(self, id: str): super().__init__( object="profile", - id="prof_01DWAS7ZQWM70PV93BFV1V78QV", + id=id or "prof_01DWAS7ZQWM70PV93BFV1V78QV", email="demo@workos-okta.com", first_name="WorkOS", last_name="Demo", @@ -16,10 +16,14 @@ def __init__(self, id: str): connection_id="conn_01EMH8WAK20T42N2NBMNBCYHAG", connection_type="OktaSAML", idp_id="00u1klkowm8EGah2H357", + custom_attributes={ + "license": "professional", + }, raw_attributes={ "email": "demo@workos-okta.com", "first_name": "WorkOS", "last_name": "Demo", "groups": ["Admins", "Developers"], + "license": "professional", }, ) diff --git a/workos/types/sso/profile.py b/workos/types/sso/profile.py index d6af0441..4e3c7235 100644 --- a/workos/types/sso/profile.py +++ b/workos/types/sso/profile.py @@ -23,7 +23,8 @@ class Profile(WorkOSModel): idp_id: str role: Optional[ProfileRole] = None groups: Optional[Sequence[str]] = None - raw_attributes: Mapping[str, Any] + custom_attributes: Optional[Mapping[str, Any]] = None + raw_attributes: Optional[Mapping[str, Any]] = None class ProfileAndToken(WorkOSModel): From 3aca859fd758ba1b263e611db5b04ea3ccc75798 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 29 Jun 2026 14:32:43 +0000 Subject: [PATCH 2/2] chore: bump version to 5.9.1 --- workos/__about__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workos/__about__.py b/workos/__about__.py index 2a9bb5b7..60f80382 100644 --- a/workos/__about__.py +++ b/workos/__about__.py @@ -12,7 +12,7 @@ __package_url__ = "https://github.com/workos-inc/workos-python" -__version__ = "5.9.0" +__version__ = "5.9.1" __author__ = "WorkOS"