Skip to content

Commit 25547b6

Browse files
Add "role" to profile (#372)
* Add role to profile * Format
1 parent 11feb89 commit 25547b6

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

tests/test_sso.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def mock_magic_link_profile(self):
2929
idp_id="",
3030
first_name=None,
3131
last_name=None,
32+
profile=None,
3233
groups=None,
3334
raw_attributes={},
3435
).dict()

tests/utils/fixtures/mock_profile.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def __init__(self, id: str):
1010
1111
first_name="WorkOS",
1212
last_name="Demo",
13+
role={"slug": "admin"},
1314
groups=["Admins", "Developers"],
1415
organization_id="org_01FG53X8636WSNW2WEKB2C31ZB",
1516
connection_id="conn_01EMH8WAK20T42N2NBMNBCYHAG",

workos/types/sso/profile.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
from workos.types.sso.connection import ConnectionType
33
from workos.types.workos_model import WorkOSModel
44
from workos.typing.literals import LiteralOrUntyped
5+
from typing_extensions import TypedDict
6+
7+
8+
class ProfileRole(TypedDict):
9+
slug: str
510

611

712
class Profile(WorkOSModel):
@@ -16,6 +21,7 @@ class Profile(WorkOSModel):
1621
first_name: Optional[str] = None
1722
last_name: Optional[str] = None
1823
idp_id: str
24+
role: Optional[ProfileRole] = None
1925
groups: Optional[Sequence[str]] = None
2026
raw_attributes: Mapping[str, Any]
2127

0 commit comments

Comments
 (0)