From 672ec3440ff11acbe7b729c3dbfc549ab8a8ab32 Mon Sep 17 00:00:00 2001 From: mattgd <matt.dzwonczyk@workos.com> Date: Wed, 16 Apr 2025 22:31:49 -0400 Subject: [PATCH] Add custom_attributes field to SSO Profile. --- 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 6572089e..7990cf9c 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):