Skip to content

Commit a806a31

Browse files
csrbarberclaude
andauthored
Add permission and organization role support (#548)
* Add authorization permissions support Introduce the authorization module with CRUD operations for permissions including create, list (paginated), get, update (PATCH), and delete. Register the module on both sync and async clients. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add authorization organization roles support (#549) * Add authorization organization roles support Add CRUD operations for organization roles including create, list, get, update, set/add/remove permissions on the authorization module. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * format * Add authorization environment roles support (#550) * Add authorization environment roles support Add CRUD operations for environment roles including create, list, get, update, set/add permissions on the authorization module. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Use Role union type for list/get organization role endpoints The list and get organization role endpoints can return both EnvironmentRole and OrganizationRole types. This aligns the Python SDK return types with the Node SDK. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add authorization event and webhook types (#551) * Add authorization event and webhook types Add event and webhook types for organization_role (created, updated, deleted) and permission (created, updated, deleted) to support authorization-related event streaming and webhook delivery. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Distinct type for organization role events * mypy --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * Remove aliasing, format * Format, types --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a734f62 commit a806a31

20 files changed

+1359
-43
lines changed

src/workos/_base_client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from workos._client_configuration import ClientConfiguration
66
from workos.api_keys import ApiKeysModule
77
from workos.audit_logs import AuditLogsModule
8+
from workos.authorization import AuthorizationModule
89
from workos.directory_sync import DirectorySyncModule
910
from workos.events import EventsModule
1011
from workos.fga import FGAModule
@@ -74,6 +75,10 @@ def __init__(
7475
@abstractmethod
7576
def api_keys(self) -> ApiKeysModule: ...
7677

78+
@property
79+
@abstractmethod
80+
def authorization(self) -> AuthorizationModule: ...
81+
7782
@property
7883
@abstractmethod
7984
def audit_logs(self) -> AuditLogsModule: ...

src/workos/async_client.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from workos._base_client import BaseClient
44
from workos.api_keys import AsyncApiKeys
55
from workos.audit_logs import AsyncAuditLogs
6+
from workos.authorization import AsyncAuthorization
67
from workos.directory_sync import AsyncDirectorySync
78
from workos.events import AsyncEvents
89
from workos.fga import FGAModule
@@ -55,6 +56,12 @@ def api_keys(self) -> AsyncApiKeys:
5556
self._api_keys = AsyncApiKeys(self._http_client)
5657
return self._api_keys
5758

59+
@property
60+
def authorization(self) -> AsyncAuthorization:
61+
if not getattr(self, "_authorization", None):
62+
self._authorization = AsyncAuthorization(self._http_client)
63+
return self._authorization
64+
5865
@property
5966
def sso(self) -> AsyncSSO:
6067
if not getattr(self, "_sso", None):

0 commit comments

Comments
 (0)