workos 5.35.0__tar.gz → 5.37.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {workos-5.35.0 → workos-5.37.0}/PKG-INFO +1 -1
- {workos-5.35.0 → workos-5.37.0}/tests/test_user_management.py +34 -0
- {workos-5.35.0 → workos-5.37.0}/workos/__about__.py +1 -1
- {workos-5.35.0 → workos-5.37.0}/workos/types/events/__init__.py +1 -1
- {workos-5.35.0 → workos-5.37.0}/workos/types/events/event.py +9 -1
- {workos-5.35.0 → workos-5.37.0}/workos/types/events/event_model.py +6 -1
- {workos-5.35.0 → workos-5.37.0}/workos/types/events/event_type.py +1 -0
- workos-5.35.0/workos/types/events/session_created_payload.py → workos-5.37.0/workos/types/events/session_payload.py +12 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/webhooks/webhook.py +9 -1
- {workos-5.35.0 → workos-5.37.0}/workos/user_management.py +86 -0
- {workos-5.35.0 → workos-5.37.0}/workos.egg-info/PKG-INFO +1 -1
- {workos-5.35.0 → workos-5.37.0}/workos.egg-info/SOURCES.txt +1 -1
- {workos-5.35.0 → workos-5.37.0}/LICENSE +0 -0
- {workos-5.35.0 → workos-5.37.0}/README.md +0 -0
- {workos-5.35.0 → workos-5.37.0}/setup.cfg +0 -0
- {workos-5.35.0 → workos-5.37.0}/setup.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/tests/test_api_keys.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/tests/test_async_http_client.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/tests/test_audit_logs.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/tests/test_client.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/tests/test_directory_sync.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/tests/test_events.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/tests/test_fga.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/tests/test_mfa.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/tests/test_organization_domains.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/tests/test_organizations.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/tests/test_passwordless.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/tests/test_portal.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/tests/test_session.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/tests/test_sso.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/tests/test_sync_http_client.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/tests/test_user_management_list_sessions.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/tests/test_user_management_revoke_session.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/tests/test_vault.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/tests/test_webhooks.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/tests/test_widgets.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/__init__.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/_base_client.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/_client_configuration.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/api_keys.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/async_client.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/audit_logs.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/client.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/directory_sync.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/events.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/exceptions.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/fga.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/mfa.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/organization_domains.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/organizations.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/passwordless.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/portal.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/py.typed +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/session.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/sso.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/__init__.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/api_keys/__init__.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/api_keys/api_keys.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/audit_logs/__init__.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/audit_logs/audit_log_event.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/audit_logs/audit_log_event_actor.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/audit_logs/audit_log_event_context.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/audit_logs/audit_log_event_target.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/audit_logs/audit_log_export.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/audit_logs/audit_log_metadata.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/directory_sync/__init__.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/directory_sync/directory.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/directory_sync/directory_group.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/directory_sync/directory_state.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/directory_sync/directory_type.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/directory_sync/directory_user.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/directory_sync/list_filters.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/events/authentication_payload.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/events/connection_payload_with_legacy_fields.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/events/directory_group_membership_payload.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/events/directory_group_with_previous_attributes.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/events/directory_payload.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/events/directory_payload_with_legacy_fields.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/events/directory_user_with_previous_attributes.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/events/list_filters.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/events/organization_domain_verification_failed_payload.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/events/previous_attributes.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/feature_flags/__init__.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/feature_flags/feature_flag.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/feature_flags/list_filters.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/fga/__init__.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/fga/authorization_resource_types.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/fga/authorization_resources.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/fga/check.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/fga/list_filters.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/fga/warnings.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/fga/warrant.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/list_resource.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/metadata.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/mfa/__init__.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/mfa/authentication_challenge.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/mfa/authentication_challenge_verification_response.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/mfa/authentication_factor.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/mfa/authentication_factor_totp_and_challenge_response.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/mfa/enroll_authentication_factor_type.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/organization_domains/__init__.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/organization_domains/organization_domain.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/organizations/__init__.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/organizations/domain_data_input.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/organizations/list_filters.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/organizations/organization.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/organizations/organization_common.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/passwordless/__init__.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/passwordless/passwordless_session.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/passwordless/passwordless_session_type.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/portal/__init__.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/portal/portal_link.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/portal/portal_link_intent.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/portal/portal_link_intent_options.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/roles/__init__.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/roles/role.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/sso/__init__.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/sso/connection.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/sso/connection_domain.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/sso/profile.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/sso/sso_provider_type.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/user_management/__init__.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/user_management/authenticate_with_common.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/user_management/authentication_response.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/user_management/email_verification.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/user_management/impersonator.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/user_management/invitation.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/user_management/list_filters.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/user_management/magic_auth.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/user_management/oauth_tokens.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/user_management/organization_membership.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/user_management/password_hash_type.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/user_management/password_reset.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/user_management/screen_hint.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/user_management/session.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/user_management/user.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/user_management/user_management_provider_type.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/vault/__init__.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/vault/key.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/vault/object.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/webhooks/__init__.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/webhooks/webhook_model.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/webhooks/webhook_payload.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/widgets/__init__.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/widgets/widget_scope.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/widgets/widget_token_response.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/types/workos_model.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/typing/__init__.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/typing/literals.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/typing/sync_or_async.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/typing/untyped_literal.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/typing/webhooks.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/utils/__init__.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/utils/_base_http_client.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/utils/crypto_provider.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/utils/http_client.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/utils/pagination_order.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/utils/request_helper.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/vault.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/webhooks.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos/widgets.py +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos.egg-info/dependency_links.txt +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos.egg-info/not-zip-safe +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos.egg-info/requires.txt +0 -0
- {workos-5.35.0 → workos-5.37.0}/workos.egg-info/top_level.txt +0 -0
|
@@ -6,6 +6,7 @@ import pytest
|
|
|
6
6
|
|
|
7
7
|
from tests.utils.fixtures.mock_auth_factor_totp import MockAuthenticationFactorTotp
|
|
8
8
|
from tests.utils.fixtures.mock_email_verification import MockEmailVerification
|
|
9
|
+
from tests.utils.fixtures.mock_feature_flag import MockFeatureFlag
|
|
9
10
|
from tests.utils.fixtures.mock_invitation import MockInvitation
|
|
10
11
|
from tests.utils.fixtures.mock_magic_auth import MockMagicAuth
|
|
11
12
|
from tests.utils.fixtures.mock_organization_membership import MockOrganizationMembership
|
|
@@ -146,6 +147,14 @@ class UserManagementFixtures:
|
|
|
146
147
|
invitations_list = [MockInvitation(id=str(i)).dict() for i in range(40)]
|
|
147
148
|
return list_response_of(data=invitations_list)
|
|
148
149
|
|
|
150
|
+
@pytest.fixture
|
|
151
|
+
def mock_feature_flags(self):
|
|
152
|
+
return {
|
|
153
|
+
"data": [MockFeatureFlag(id=f"flag_{str(i)}").dict() for i in range(2)],
|
|
154
|
+
"object": "list",
|
|
155
|
+
"list_metadata": {"before": None, "after": None},
|
|
156
|
+
}
|
|
157
|
+
|
|
149
158
|
|
|
150
159
|
class TestUserManagementBase(UserManagementFixtures):
|
|
151
160
|
@pytest.fixture(autouse=True)
|
|
@@ -1250,3 +1259,28 @@ class TestUserManagement(UserManagementFixtures):
|
|
|
1250
1259
|
|
|
1251
1260
|
with pytest.raises(Exception):
|
|
1252
1261
|
syncify(self.user_management.resend_invitation("invitation_accepted"))
|
|
1262
|
+
|
|
1263
|
+
def test_list_feature_flags(
|
|
1264
|
+
self, mock_feature_flags, capture_and_mock_http_client_request
|
|
1265
|
+
):
|
|
1266
|
+
request_kwargs = capture_and_mock_http_client_request(
|
|
1267
|
+
self.http_client, mock_feature_flags, 200
|
|
1268
|
+
)
|
|
1269
|
+
|
|
1270
|
+
feature_flags_response = syncify(
|
|
1271
|
+
self.user_management.list_feature_flags(
|
|
1272
|
+
user_id="user_01H7ZGXFP5C6BBQY6Z7277ZCT0"
|
|
1273
|
+
)
|
|
1274
|
+
)
|
|
1275
|
+
|
|
1276
|
+
def to_dict(x):
|
|
1277
|
+
return x.dict()
|
|
1278
|
+
|
|
1279
|
+
assert request_kwargs["method"] == "get"
|
|
1280
|
+
assert request_kwargs["url"].endswith(
|
|
1281
|
+
"/user_management/users/user_01H7ZGXFP5C6BBQY6Z7277ZCT0/feature-flags"
|
|
1282
|
+
)
|
|
1283
|
+
assert (
|
|
1284
|
+
list(map(to_dict, feature_flags_response.data))
|
|
1285
|
+
== mock_feature_flags["data"]
|
|
1286
|
+
)
|
|
@@ -36,7 +36,10 @@ from workos.types.events.event_model import EventModel
|
|
|
36
36
|
from workos.types.events.organization_domain_verification_failed_payload import (
|
|
37
37
|
OrganizationDomainVerificationFailedPayload,
|
|
38
38
|
)
|
|
39
|
-
from workos.types.events.
|
|
39
|
+
from workos.types.events.session_payload import (
|
|
40
|
+
SessionCreatedPayload,
|
|
41
|
+
SessionRevokedPayload,
|
|
42
|
+
)
|
|
40
43
|
from workos.types.organizations.organization_common import OrganizationCommon
|
|
41
44
|
from workos.types.organization_domains import OrganizationDomain
|
|
42
45
|
from workos.types.roles.role import EventRole
|
|
@@ -249,6 +252,10 @@ class SessionCreatedEvent(EventModel[SessionCreatedPayload]):
|
|
|
249
252
|
event: Literal["session.created"]
|
|
250
253
|
|
|
251
254
|
|
|
255
|
+
class SessionRevokedEvent(EventModel[SessionRevokedPayload]):
|
|
256
|
+
event: Literal["session.revoked"]
|
|
257
|
+
|
|
258
|
+
|
|
252
259
|
class UserCreatedEvent(EventModel[User]):
|
|
253
260
|
event: Literal["user.created"]
|
|
254
261
|
|
|
@@ -308,6 +315,7 @@ Event = Annotated[
|
|
|
308
315
|
RoleDeletedEvent,
|
|
309
316
|
RoleUpdatedEvent,
|
|
310
317
|
SessionCreatedEvent,
|
|
318
|
+
SessionRevokedEvent,
|
|
311
319
|
UserCreatedEvent,
|
|
312
320
|
UserDeletedEvent,
|
|
313
321
|
UserUpdatedEvent,
|
|
@@ -35,7 +35,11 @@ from workos.types.events.directory_user_with_previous_attributes import (
|
|
|
35
35
|
from workos.types.events.organization_domain_verification_failed_payload import (
|
|
36
36
|
OrganizationDomainVerificationFailedPayload,
|
|
37
37
|
)
|
|
38
|
-
|
|
38
|
+
|
|
39
|
+
from workos.types.events.session_payload import (
|
|
40
|
+
SessionCreatedPayload,
|
|
41
|
+
SessionRevokedPayload,
|
|
42
|
+
)
|
|
39
43
|
from workos.types.organizations.organization_common import OrganizationCommon
|
|
40
44
|
from workos.types.organization_domains import OrganizationDomain
|
|
41
45
|
from workos.types.roles.role import EventRole
|
|
@@ -81,6 +85,7 @@ EventPayload = TypeVar(
|
|
|
81
85
|
OrganizationMembership,
|
|
82
86
|
PasswordResetCommon,
|
|
83
87
|
SessionCreatedPayload,
|
|
88
|
+
SessionRevokedPayload,
|
|
84
89
|
User,
|
|
85
90
|
)
|
|
86
91
|
|
|
@@ -13,3 +13,15 @@ class SessionCreatedPayload(WorkOSModel):
|
|
|
13
13
|
user_id: str
|
|
14
14
|
created_at: str
|
|
15
15
|
updated_at: str
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class SessionRevokedPayload(WorkOSModel):
|
|
19
|
+
object: Literal["session"]
|
|
20
|
+
id: str
|
|
21
|
+
impersonator: Optional[Impersonator] = None
|
|
22
|
+
ip_address: Optional[str] = None
|
|
23
|
+
organization_id: Optional[str] = None
|
|
24
|
+
user_agent: Optional[str] = None
|
|
25
|
+
user_id: str
|
|
26
|
+
created_at: str
|
|
27
|
+
updated_at: str
|
|
@@ -36,7 +36,10 @@ from workos.types.events.directory_user_with_previous_attributes import (
|
|
|
36
36
|
from workos.types.events.organization_domain_verification_failed_payload import (
|
|
37
37
|
OrganizationDomainVerificationFailedPayload,
|
|
38
38
|
)
|
|
39
|
-
from workos.types.events.
|
|
39
|
+
from workos.types.events.session_payload import (
|
|
40
|
+
SessionCreatedPayload,
|
|
41
|
+
SessionRevokedPayload,
|
|
42
|
+
)
|
|
40
43
|
from workos.types.organization_domains import OrganizationDomain
|
|
41
44
|
from workos.types.organizations.organization_common import OrganizationCommon
|
|
42
45
|
from workos.types.roles.role import EventRole
|
|
@@ -255,6 +258,10 @@ class SessionCreatedWebhook(WebhookModel[SessionCreatedPayload]):
|
|
|
255
258
|
event: Literal["session.created"]
|
|
256
259
|
|
|
257
260
|
|
|
261
|
+
class SessionRevokedWebhook(WebhookModel[SessionRevokedPayload]):
|
|
262
|
+
event: Literal["session.revoked"]
|
|
263
|
+
|
|
264
|
+
|
|
258
265
|
class UserCreatedWebhook(WebhookModel[User]):
|
|
259
266
|
event: Literal["user.created"]
|
|
260
267
|
|
|
@@ -314,6 +321,7 @@ Webhook = Annotated[
|
|
|
314
321
|
RoleDeletedWebhook,
|
|
315
322
|
RoleUpdatedWebhook,
|
|
316
323
|
SessionCreatedWebhook,
|
|
324
|
+
SessionRevokedWebhook,
|
|
317
325
|
UserCreatedWebhook,
|
|
318
326
|
UserDeletedWebhook,
|
|
319
327
|
UserUpdatedWebhook,
|
|
@@ -2,6 +2,8 @@ from typing import Awaitable, Optional, Protocol, Sequence, Type, Union, cast
|
|
|
2
2
|
from urllib.parse import urlencode
|
|
3
3
|
from workos._client_configuration import ClientConfiguration
|
|
4
4
|
from workos.session import AsyncSession, Session
|
|
5
|
+
from workos.types.feature_flags import FeatureFlag
|
|
6
|
+
from workos.types.feature_flags.list_filters import FeatureFlagListFilters
|
|
5
7
|
from workos.types.list_resource import (
|
|
6
8
|
ListArgs,
|
|
7
9
|
ListMetadata,
|
|
@@ -97,6 +99,7 @@ INVITATION_REVOKE_PATH = "user_management/invitations/{0}/revoke"
|
|
|
97
99
|
INVITATION_RESEND_PATH = "user_management/invitations/{0}/resend"
|
|
98
100
|
PASSWORD_RESET_PATH = "user_management/password_reset"
|
|
99
101
|
PASSWORD_RESET_DETAIL_PATH = "user_management/password_reset/{0}"
|
|
102
|
+
USER_FEATURE_FLAGS_PATH = "user_management/users/{0}/feature-flags"
|
|
100
103
|
|
|
101
104
|
|
|
102
105
|
UsersListResource = WorkOSListResource[User, UsersListFilters, ListMetadata]
|
|
@@ -113,6 +116,10 @@ InvitationsListResource = WorkOSListResource[
|
|
|
113
116
|
Invitation, InvitationsListFilters, ListMetadata
|
|
114
117
|
]
|
|
115
118
|
|
|
119
|
+
FeatureFlagsListResource = WorkOSListResource[
|
|
120
|
+
FeatureFlag, FeatureFlagListFilters, ListMetadata
|
|
121
|
+
]
|
|
122
|
+
|
|
116
123
|
from workos.types.user_management.list_filters import SessionsListFilters
|
|
117
124
|
|
|
118
125
|
SessionsListResource = WorkOSListResource[
|
|
@@ -908,6 +915,29 @@ class UserManagementModule(Protocol):
|
|
|
908
915
|
"""
|
|
909
916
|
...
|
|
910
917
|
|
|
918
|
+
def list_feature_flags(
|
|
919
|
+
self,
|
|
920
|
+
user_id: str,
|
|
921
|
+
*,
|
|
922
|
+
limit: int = DEFAULT_LIST_RESPONSE_LIMIT,
|
|
923
|
+
before: Optional[str] = None,
|
|
924
|
+
after: Optional[str] = None,
|
|
925
|
+
order: PaginationOrder = "desc",
|
|
926
|
+
) -> SyncOrAsync[FeatureFlagsListResource]:
|
|
927
|
+
"""Retrieve a list of feature flags for a user
|
|
928
|
+
|
|
929
|
+
Args:
|
|
930
|
+
user_id (str): User's unique identifier
|
|
931
|
+
limit (int): Maximum number of records to return. (Optional)
|
|
932
|
+
before (str): Pagination cursor to receive records before a provided Feature Flag ID. (Optional)
|
|
933
|
+
after (str): Pagination cursor to receive records after a provided Feature Flag ID. (Optional)
|
|
934
|
+
order (Literal["asc","desc"]): Sort records in either ascending or descending (default) order by created_at timestamp. (Optional)
|
|
935
|
+
|
|
936
|
+
Returns:
|
|
937
|
+
FeatureFlagsListResource: Feature flags list response from WorkOS.
|
|
938
|
+
"""
|
|
939
|
+
...
|
|
940
|
+
|
|
911
941
|
|
|
912
942
|
class UserManagement(UserManagementModule):
|
|
913
943
|
_http_client: SyncHTTPClient
|
|
@@ -1603,6 +1633,34 @@ class UserManagement(UserManagementModule):
|
|
|
1603
1633
|
|
|
1604
1634
|
return Invitation.model_validate(response)
|
|
1605
1635
|
|
|
1636
|
+
def list_feature_flags(
|
|
1637
|
+
self,
|
|
1638
|
+
user_id: str,
|
|
1639
|
+
*,
|
|
1640
|
+
limit: int = DEFAULT_LIST_RESPONSE_LIMIT,
|
|
1641
|
+
before: Optional[str] = None,
|
|
1642
|
+
after: Optional[str] = None,
|
|
1643
|
+
order: PaginationOrder = "desc",
|
|
1644
|
+
) -> FeatureFlagsListResource:
|
|
1645
|
+
list_params: FeatureFlagListFilters = {
|
|
1646
|
+
"limit": limit,
|
|
1647
|
+
"before": before,
|
|
1648
|
+
"after": after,
|
|
1649
|
+
"order": order,
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1652
|
+
response = self._http_client.request(
|
|
1653
|
+
USER_FEATURE_FLAGS_PATH.format(user_id),
|
|
1654
|
+
method=REQUEST_METHOD_GET,
|
|
1655
|
+
params=list_params,
|
|
1656
|
+
)
|
|
1657
|
+
|
|
1658
|
+
return FeatureFlagsListResource(
|
|
1659
|
+
list_method=self.list_feature_flags,
|
|
1660
|
+
list_args=list_params,
|
|
1661
|
+
**ListPage[FeatureFlag](**response).model_dump(),
|
|
1662
|
+
)
|
|
1663
|
+
|
|
1606
1664
|
|
|
1607
1665
|
class AsyncUserManagement(UserManagementModule):
|
|
1608
1666
|
_http_client: AsyncHTTPClient
|
|
@@ -2312,3 +2370,31 @@ class AsyncUserManagement(UserManagementModule):
|
|
|
2312
2370
|
)
|
|
2313
2371
|
|
|
2314
2372
|
return Invitation.model_validate(response)
|
|
2373
|
+
|
|
2374
|
+
async def list_feature_flags(
|
|
2375
|
+
self,
|
|
2376
|
+
user_id: str,
|
|
2377
|
+
*,
|
|
2378
|
+
limit: int = DEFAULT_LIST_RESPONSE_LIMIT,
|
|
2379
|
+
before: Optional[str] = None,
|
|
2380
|
+
after: Optional[str] = None,
|
|
2381
|
+
order: PaginationOrder = "desc",
|
|
2382
|
+
) -> FeatureFlagsListResource:
|
|
2383
|
+
list_params: FeatureFlagListFilters = {
|
|
2384
|
+
"limit": limit,
|
|
2385
|
+
"before": before,
|
|
2386
|
+
"after": after,
|
|
2387
|
+
"order": order,
|
|
2388
|
+
}
|
|
2389
|
+
|
|
2390
|
+
response = await self._http_client.request(
|
|
2391
|
+
USER_FEATURE_FLAGS_PATH.format(user_id),
|
|
2392
|
+
method=REQUEST_METHOD_GET,
|
|
2393
|
+
params=list_params,
|
|
2394
|
+
)
|
|
2395
|
+
|
|
2396
|
+
return FeatureFlagsListResource(
|
|
2397
|
+
list_method=self.list_feature_flags,
|
|
2398
|
+
list_args=list_params,
|
|
2399
|
+
**ListPage[FeatureFlag](**response).model_dump(),
|
|
2400
|
+
)
|
|
@@ -86,7 +86,7 @@ workos/types/events/event_type.py
|
|
|
86
86
|
workos/types/events/list_filters.py
|
|
87
87
|
workos/types/events/organization_domain_verification_failed_payload.py
|
|
88
88
|
workos/types/events/previous_attributes.py
|
|
89
|
-
workos/types/events/
|
|
89
|
+
workos/types/events/session_payload.py
|
|
90
90
|
workos/types/feature_flags/__init__.py
|
|
91
91
|
workos/types/feature_flags/feature_flag.py
|
|
92
92
|
workos/types/feature_flags/list_filters.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{workos-5.35.0 → workos-5.37.0}/workos/types/events/connection_payload_with_legacy_fields.py
RENAMED
|
File without changes
|
|
File without changes
|
{workos-5.35.0 → workos-5.37.0}/workos/types/events/directory_group_with_previous_attributes.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{workos-5.35.0 → workos-5.37.0}/workos/types/events/directory_user_with_previous_attributes.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{workos-5.35.0 → workos-5.37.0}/workos/types/mfa/authentication_challenge_verification_response.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{workos-5.35.0 → workos-5.37.0}/workos/types/user_management/user_management_provider_type.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|