workos 5.28.0__tar.gz → 5.30.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.28.0 → workos-5.30.0}/PKG-INFO +1 -1
- {workos-5.28.0 → workos-5.30.0}/tests/test_organizations.py +34 -0
- {workos-5.28.0 → workos-5.30.0}/tests/test_user_management.py +31 -0
- {workos-5.28.0 → workos-5.30.0}/workos/__about__.py +1 -1
- {workos-5.28.0 → workos-5.30.0}/workos/organizations.py +85 -0
- workos-5.30.0/workos/types/feature_flags/__init__.py +3 -0
- workos-5.30.0/workos/types/feature_flags/feature_flag.py +12 -0
- workos-5.30.0/workos/types/feature_flags/list_filters.py +5 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/list_resource.py +2 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/sso/connection.py +1 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/sso/sso_provider_type.py +1 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/user_management/authenticate_with_common.py +1 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/user_management/authentication_response.py +1 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/user_management/oauth_tokens.py +1 -0
- workos-5.30.0/workos/types/user_management/user_management_provider_type.py +11 -0
- {workos-5.28.0 → workos-5.30.0}/workos/user_management.py +7 -1
- {workos-5.28.0 → workos-5.30.0}/workos.egg-info/PKG-INFO +1 -1
- {workos-5.28.0 → workos-5.30.0}/workos.egg-info/SOURCES.txt +3 -0
- workos-5.28.0/workos/types/user_management/user_management_provider_type.py +0 -6
- {workos-5.28.0 → workos-5.30.0}/LICENSE +0 -0
- {workos-5.28.0 → workos-5.30.0}/README.md +0 -0
- {workos-5.28.0 → workos-5.30.0}/setup.cfg +0 -0
- {workos-5.28.0 → workos-5.30.0}/setup.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/tests/test_async_http_client.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/tests/test_audit_logs.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/tests/test_client.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/tests/test_directory_sync.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/tests/test_events.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/tests/test_fga.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/tests/test_mfa.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/tests/test_organization_domains.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/tests/test_passwordless.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/tests/test_portal.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/tests/test_session.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/tests/test_sso.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/tests/test_sync_http_client.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/tests/test_vault.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/tests/test_webhooks.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/tests/test_widgets.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/__init__.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/_base_client.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/_client_configuration.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/async_client.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/audit_logs.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/client.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/directory_sync.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/events.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/exceptions.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/fga.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/mfa.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/organization_domains.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/passwordless.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/portal.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/py.typed +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/session.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/sso.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/__init__.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/audit_logs/__init__.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/audit_logs/audit_log_event.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/audit_logs/audit_log_event_actor.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/audit_logs/audit_log_event_context.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/audit_logs/audit_log_event_target.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/audit_logs/audit_log_export.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/audit_logs/audit_log_metadata.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/directory_sync/__init__.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/directory_sync/directory.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/directory_sync/directory_group.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/directory_sync/directory_state.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/directory_sync/directory_type.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/directory_sync/directory_user.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/directory_sync/list_filters.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/events/__init__.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/events/authentication_payload.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/events/connection_payload_with_legacy_fields.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/events/directory_group_membership_payload.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/events/directory_group_with_previous_attributes.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/events/directory_payload.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/events/directory_payload_with_legacy_fields.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/events/directory_user_with_previous_attributes.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/events/event.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/events/event_model.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/events/event_type.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/events/list_filters.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/events/organization_domain_verification_failed_payload.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/events/previous_attributes.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/events/session_created_payload.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/fga/__init__.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/fga/authorization_resource_types.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/fga/authorization_resources.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/fga/check.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/fga/list_filters.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/fga/warnings.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/fga/warrant.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/metadata.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/mfa/__init__.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/mfa/authentication_challenge.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/mfa/authentication_challenge_verification_response.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/mfa/authentication_factor.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/mfa/authentication_factor_totp_and_challenge_response.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/mfa/enroll_authentication_factor_type.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/organization_domains/__init__.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/organization_domains/organization_domain.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/organizations/__init__.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/organizations/domain_data_input.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/organizations/list_filters.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/organizations/organization.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/organizations/organization_common.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/passwordless/__init__.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/passwordless/passwordless_session.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/passwordless/passwordless_session_type.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/portal/__init__.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/portal/portal_link.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/portal/portal_link_intent.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/portal/portal_link_intent_options.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/roles/__init__.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/roles/role.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/sso/__init__.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/sso/connection_domain.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/sso/profile.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/user_management/__init__.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/user_management/email_verification.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/user_management/impersonator.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/user_management/invitation.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/user_management/list_filters.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/user_management/magic_auth.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/user_management/organization_membership.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/user_management/password_hash_type.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/user_management/password_reset.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/user_management/screen_hint.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/user_management/session.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/user_management/user.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/vault/__init__.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/vault/key.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/vault/object.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/webhooks/__init__.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/webhooks/webhook.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/webhooks/webhook_model.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/webhooks/webhook_payload.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/widgets/__init__.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/widgets/widget_scope.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/widgets/widget_token_response.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/types/workos_model.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/typing/__init__.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/typing/literals.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/typing/sync_or_async.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/typing/untyped_literal.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/typing/webhooks.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/utils/__init__.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/utils/_base_http_client.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/utils/crypto_provider.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/utils/http_client.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/utils/pagination_order.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/utils/request_helper.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/vault.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/webhooks.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos/widgets.py +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos.egg-info/dependency_links.txt +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos.egg-info/not-zip-safe +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos.egg-info/requires.txt +0 -0
- {workos-5.28.0 → workos-5.30.0}/workos.egg-info/top_level.txt +0 -0
|
@@ -2,6 +2,7 @@ import datetime
|
|
|
2
2
|
from typing import Union
|
|
3
3
|
import pytest
|
|
4
4
|
from tests.types.test_auto_pagination_function import TestAutoPaginationFunction
|
|
5
|
+
from tests.utils.fixtures.mock_feature_flag import MockFeatureFlag
|
|
5
6
|
from tests.utils.fixtures.mock_organization import MockOrganization
|
|
6
7
|
from tests.utils.fixtures.mock_role import MockRole
|
|
7
8
|
from tests.utils.list_resource import list_response_of
|
|
@@ -77,6 +78,14 @@ class TestOrganizations:
|
|
|
77
78
|
"object": "list",
|
|
78
79
|
}
|
|
79
80
|
|
|
81
|
+
@pytest.fixture
|
|
82
|
+
def mock_feature_flags(self):
|
|
83
|
+
return {
|
|
84
|
+
"data": [MockFeatureFlag(id=f"flag_{str(i)}").dict() for i in range(2)],
|
|
85
|
+
"object": "list",
|
|
86
|
+
"list_metadata": {"before": None, "after": None},
|
|
87
|
+
}
|
|
88
|
+
|
|
80
89
|
def test_list_organizations(
|
|
81
90
|
self, mock_organizations, capture_and_mock_http_client_request
|
|
82
91
|
):
|
|
@@ -264,3 +273,28 @@ class TestOrganizations:
|
|
|
264
273
|
list(map(to_dict, organization_roles_response.data))
|
|
265
274
|
== mock_organization_roles["data"]
|
|
266
275
|
)
|
|
276
|
+
|
|
277
|
+
def test_list_feature_flags(
|
|
278
|
+
self, mock_feature_flags, capture_and_mock_http_client_request
|
|
279
|
+
):
|
|
280
|
+
request_kwargs = capture_and_mock_http_client_request(
|
|
281
|
+
self.http_client, mock_feature_flags, 200
|
|
282
|
+
)
|
|
283
|
+
|
|
284
|
+
feature_flags_response = syncify(
|
|
285
|
+
self.organizations.list_feature_flags(
|
|
286
|
+
organization_id="org_01EHT88Z8J8795GZNQ4ZP1J81T"
|
|
287
|
+
)
|
|
288
|
+
)
|
|
289
|
+
|
|
290
|
+
def to_dict(x):
|
|
291
|
+
return x.dict()
|
|
292
|
+
|
|
293
|
+
assert request_kwargs["method"] == "get"
|
|
294
|
+
assert request_kwargs["url"].endswith(
|
|
295
|
+
"/organizations/org_01EHT88Z8J8795GZNQ4ZP1J81T/feature-flags"
|
|
296
|
+
)
|
|
297
|
+
assert (
|
|
298
|
+
list(map(to_dict, feature_flags_response.data))
|
|
299
|
+
== mock_feature_flags["data"]
|
|
300
|
+
)
|
|
@@ -718,6 +718,37 @@ class TestUserManagement(UserManagementFixtures):
|
|
|
718
718
|
"grant_type": "authorization_code",
|
|
719
719
|
}
|
|
720
720
|
|
|
721
|
+
def test_authenticate_with_code_with_invitation_token(
|
|
722
|
+
self,
|
|
723
|
+
capture_and_mock_http_client_request,
|
|
724
|
+
mock_auth_response,
|
|
725
|
+
base_authentication_params,
|
|
726
|
+
):
|
|
727
|
+
params = {
|
|
728
|
+
"code": "test_code",
|
|
729
|
+
"code_verifier": "test_code_verifier",
|
|
730
|
+
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36",
|
|
731
|
+
"ip_address": "192.0.0.1",
|
|
732
|
+
"invitation_token": "invitation_token_12345",
|
|
733
|
+
}
|
|
734
|
+
request_kwargs = capture_and_mock_http_client_request(
|
|
735
|
+
self.http_client, mock_auth_response, 200
|
|
736
|
+
)
|
|
737
|
+
|
|
738
|
+
response = syncify(self.user_management.authenticate_with_code(**params))
|
|
739
|
+
|
|
740
|
+
assert request_kwargs["url"].endswith("user_management/authenticate")
|
|
741
|
+
assert request_kwargs["method"] == "post"
|
|
742
|
+
assert response.user.id == "user_01H7ZGXFP5C6BBQY6Z7277ZCT0"
|
|
743
|
+
assert response.organization_id == "org_12345"
|
|
744
|
+
assert response.access_token == "access_token_12345"
|
|
745
|
+
assert response.refresh_token == "refresh_token_12345"
|
|
746
|
+
assert request_kwargs["json"] == {
|
|
747
|
+
**params,
|
|
748
|
+
**base_authentication_params,
|
|
749
|
+
"grant_type": "authorization_code",
|
|
750
|
+
}
|
|
751
|
+
|
|
721
752
|
def test_authenticate_with_magic_auth(
|
|
722
753
|
self,
|
|
723
754
|
capture_and_mock_http_client_request,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
from typing import Optional, Protocol, Sequence
|
|
2
2
|
|
|
3
|
+
from workos.types.feature_flags import FeatureFlag
|
|
4
|
+
from workos.types.feature_flags.list_filters import FeatureFlagListFilters
|
|
3
5
|
from workos.types.metadata import Metadata
|
|
4
6
|
from workos.types.organizations.domain_data_input import DomainDataInput
|
|
5
7
|
from workos.types.organizations.list_filters import OrganizationListFilters
|
|
@@ -24,6 +26,10 @@ OrganizationsListResource = WorkOSListResource[
|
|
|
24
26
|
Organization, OrganizationListFilters, ListMetadata
|
|
25
27
|
]
|
|
26
28
|
|
|
29
|
+
FeatureFlagsListResource = WorkOSListResource[
|
|
30
|
+
FeatureFlag, FeatureFlagListFilters, ListMetadata
|
|
31
|
+
]
|
|
32
|
+
|
|
27
33
|
|
|
28
34
|
class OrganizationsModule(Protocol):
|
|
29
35
|
"""Offers methods through the WorkOS Organizations service."""
|
|
@@ -128,6 +134,29 @@ class OrganizationsModule(Protocol):
|
|
|
128
134
|
"""
|
|
129
135
|
...
|
|
130
136
|
|
|
137
|
+
def list_feature_flags(
|
|
138
|
+
self,
|
|
139
|
+
organization_id: str,
|
|
140
|
+
*,
|
|
141
|
+
limit: int = DEFAULT_LIST_RESPONSE_LIMIT,
|
|
142
|
+
before: Optional[str] = None,
|
|
143
|
+
after: Optional[str] = None,
|
|
144
|
+
order: PaginationOrder = "desc",
|
|
145
|
+
) -> SyncOrAsync[FeatureFlagsListResource]:
|
|
146
|
+
"""Retrieve a list of feature flags for an organization
|
|
147
|
+
|
|
148
|
+
Args:
|
|
149
|
+
organization_id (str): Organization's unique identifier
|
|
150
|
+
limit (int): Maximum number of records to return. (Optional)
|
|
151
|
+
before (str): Pagination cursor to receive records before a provided Feature Flag ID. (Optional)
|
|
152
|
+
after (str): Pagination cursor to receive records after a provided Feature Flag ID. (Optional)
|
|
153
|
+
order (Literal["asc","desc"]): Sort records in either ascending or descending (default) order by created_at timestamp. (Optional)
|
|
154
|
+
|
|
155
|
+
Returns:
|
|
156
|
+
FeatureFlagsListResource: Feature flags list response from WorkOS.
|
|
157
|
+
"""
|
|
158
|
+
...
|
|
159
|
+
|
|
131
160
|
|
|
132
161
|
class Organizations(OrganizationsModule):
|
|
133
162
|
_http_client: SyncHTTPClient
|
|
@@ -247,6 +276,34 @@ class Organizations(OrganizationsModule):
|
|
|
247
276
|
|
|
248
277
|
return RoleList.model_validate(response)
|
|
249
278
|
|
|
279
|
+
def list_feature_flags(
|
|
280
|
+
self,
|
|
281
|
+
organization_id: str,
|
|
282
|
+
*,
|
|
283
|
+
limit: int = DEFAULT_LIST_RESPONSE_LIMIT,
|
|
284
|
+
before: Optional[str] = None,
|
|
285
|
+
after: Optional[str] = None,
|
|
286
|
+
order: PaginationOrder = "desc",
|
|
287
|
+
) -> FeatureFlagsListResource:
|
|
288
|
+
list_params: FeatureFlagListFilters = {
|
|
289
|
+
"limit": limit,
|
|
290
|
+
"before": before,
|
|
291
|
+
"after": after,
|
|
292
|
+
"order": order,
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
response = self._http_client.request(
|
|
296
|
+
f"organizations/{organization_id}/feature-flags",
|
|
297
|
+
method=REQUEST_METHOD_GET,
|
|
298
|
+
params=list_params,
|
|
299
|
+
)
|
|
300
|
+
|
|
301
|
+
return WorkOSListResource[FeatureFlag, FeatureFlagListFilters, ListMetadata](
|
|
302
|
+
list_method=self.list_feature_flags,
|
|
303
|
+
list_args=list_params,
|
|
304
|
+
**ListPage[FeatureFlag](**response).model_dump(),
|
|
305
|
+
)
|
|
306
|
+
|
|
250
307
|
|
|
251
308
|
class AsyncOrganizations(OrganizationsModule):
|
|
252
309
|
_http_client: AsyncHTTPClient
|
|
@@ -365,3 +422,31 @@ class AsyncOrganizations(OrganizationsModule):
|
|
|
365
422
|
)
|
|
366
423
|
|
|
367
424
|
return RoleList.model_validate(response)
|
|
425
|
+
|
|
426
|
+
async def list_feature_flags(
|
|
427
|
+
self,
|
|
428
|
+
organization_id: str,
|
|
429
|
+
*,
|
|
430
|
+
limit: int = DEFAULT_LIST_RESPONSE_LIMIT,
|
|
431
|
+
before: Optional[str] = None,
|
|
432
|
+
after: Optional[str] = None,
|
|
433
|
+
order: PaginationOrder = "desc",
|
|
434
|
+
) -> FeatureFlagsListResource:
|
|
435
|
+
list_params: FeatureFlagListFilters = {
|
|
436
|
+
"limit": limit,
|
|
437
|
+
"before": before,
|
|
438
|
+
"after": after,
|
|
439
|
+
"order": order,
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
response = await self._http_client.request(
|
|
443
|
+
f"organizations/{organization_id}/feature-flags",
|
|
444
|
+
method=REQUEST_METHOD_GET,
|
|
445
|
+
params=list_params,
|
|
446
|
+
)
|
|
447
|
+
|
|
448
|
+
return WorkOSListResource[FeatureFlag, FeatureFlagListFilters, ListMetadata](
|
|
449
|
+
list_method=self.list_feature_flags,
|
|
450
|
+
list_args=list_params,
|
|
451
|
+
**ListPage[FeatureFlag](**response).model_dump(),
|
|
452
|
+
)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from typing import Literal, Optional
|
|
2
|
+
from workos.types.workos_model import WorkOSModel
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class FeatureFlag(WorkOSModel):
|
|
6
|
+
id: str
|
|
7
|
+
object: Literal["feature_flag"]
|
|
8
|
+
slug: str
|
|
9
|
+
name: str
|
|
10
|
+
description: Optional[str]
|
|
11
|
+
created_at: str
|
|
12
|
+
updated_at: str
|
|
@@ -23,6 +23,7 @@ from workos.types.directory_sync import (
|
|
|
23
23
|
DirectoryUserWithGroups,
|
|
24
24
|
)
|
|
25
25
|
from workos.types.events import Event
|
|
26
|
+
from workos.types.feature_flags import FeatureFlag
|
|
26
27
|
from workos.types.fga import (
|
|
27
28
|
Warrant,
|
|
28
29
|
AuthorizationResource,
|
|
@@ -46,6 +47,7 @@ ListableResource = TypeVar(
|
|
|
46
47
|
DirectoryGroup,
|
|
47
48
|
DirectoryUserWithGroups,
|
|
48
49
|
Event,
|
|
50
|
+
FeatureFlag,
|
|
49
51
|
Invitation,
|
|
50
52
|
Organization,
|
|
51
53
|
OrganizationMembership,
|
|
@@ -19,6 +19,7 @@ class AuthenticateWithCodeParameters(AuthenticateWithBaseParameters):
|
|
|
19
19
|
code_verifier: Union[str, None]
|
|
20
20
|
grant_type: Literal["authorization_code"]
|
|
21
21
|
session: Union[SessionConfig, None]
|
|
22
|
+
invitation_token: Union[str, None]
|
|
22
23
|
|
|
23
24
|
|
|
24
25
|
class AuthenticateWithMagicAuthParameters(AuthenticateWithBaseParameters):
|
|
@@ -396,7 +396,7 @@ class UserManagementModule(Protocol):
|
|
|
396
396
|
organization_id (str): The organization_id connection selector is used to initiate SSO for an Organization.
|
|
397
397
|
The value of this parameter should be a WorkOS Organization ID. (Optional)
|
|
398
398
|
provider (UserManagementProviderType): The provider connection selector is used to initiate SSO using an OAuth-compatible provider.
|
|
399
|
-
Currently, the supported values for provider are 'authkit', 'AppleOAuth', 'GitHubOAuth, 'GoogleOAuth', and '
|
|
399
|
+
Currently, the supported values for provider are 'authkit', 'AppleOAuth', 'GitHubOAuth, 'GoogleOAuth', 'MicrosoftOAuth', and 'SalesforceOAuth'. (Optional)
|
|
400
400
|
provider_scopes (Sequence[str]): Can be used to specify additional scopes that will be requested when initiating SSO using an OAuth provider. (Optional)
|
|
401
401
|
domain_hint (str): Can be used to pre-fill the domain field when initiating authentication with Microsoft OAuth,
|
|
402
402
|
or with a GoogleSAML connection type. (Optional)
|
|
@@ -488,6 +488,7 @@ class UserManagementModule(Protocol):
|
|
|
488
488
|
code_verifier: Optional[str] = None,
|
|
489
489
|
ip_address: Optional[str] = None,
|
|
490
490
|
user_agent: Optional[str] = None,
|
|
491
|
+
invitation_token: Optional[str] = None,
|
|
491
492
|
) -> SyncOrAsync[AuthenticationResponse]:
|
|
492
493
|
"""Authenticates an OAuth user or a user that is logging in through SSO.
|
|
493
494
|
|
|
@@ -498,6 +499,7 @@ class UserManagementModule(Protocol):
|
|
|
498
499
|
url as part of the PKCE flow. This parameter is required when the client secret is not present. (Optional)
|
|
499
500
|
ip_address (str): The IP address of the request from the user who is attempting to authenticate. (Optional)
|
|
500
501
|
user_agent (str): The user agent of the request from the user who is attempting to authenticate. (Optional)
|
|
502
|
+
invitation_token (str): The token of an Invitation, if required. (Optional)
|
|
501
503
|
|
|
502
504
|
Returns:
|
|
503
505
|
AuthenticationResponse: Authentication response from WorkOS.
|
|
@@ -1166,6 +1168,7 @@ class UserManagement(UserManagementModule):
|
|
|
1166
1168
|
code_verifier: Optional[str] = None,
|
|
1167
1169
|
ip_address: Optional[str] = None,
|
|
1168
1170
|
user_agent: Optional[str] = None,
|
|
1171
|
+
invitation_token: Optional[str] = None,
|
|
1169
1172
|
) -> AuthKitAuthenticationResponse:
|
|
1170
1173
|
if (
|
|
1171
1174
|
session is not None
|
|
@@ -1181,6 +1184,7 @@ class UserManagement(UserManagementModule):
|
|
|
1181
1184
|
"user_agent": user_agent,
|
|
1182
1185
|
"code_verifier": code_verifier,
|
|
1183
1186
|
"session": session,
|
|
1187
|
+
"invitation_token": invitation_token,
|
|
1184
1188
|
}
|
|
1185
1189
|
|
|
1186
1190
|
return self._authenticate_with(
|
|
@@ -1807,6 +1811,7 @@ class AsyncUserManagement(UserManagementModule):
|
|
|
1807
1811
|
code_verifier: Optional[str] = None,
|
|
1808
1812
|
ip_address: Optional[str] = None,
|
|
1809
1813
|
user_agent: Optional[str] = None,
|
|
1814
|
+
invitation_token: Optional[str] = None,
|
|
1810
1815
|
) -> AuthKitAuthenticationResponse:
|
|
1811
1816
|
if (
|
|
1812
1817
|
session is not None
|
|
@@ -1822,6 +1827,7 @@ class AsyncUserManagement(UserManagementModule):
|
|
|
1822
1827
|
"user_agent": user_agent,
|
|
1823
1828
|
"code_verifier": code_verifier,
|
|
1824
1829
|
"session": session,
|
|
1830
|
+
"invitation_token": invitation_token,
|
|
1825
1831
|
}
|
|
1826
1832
|
|
|
1827
1833
|
return await self._authenticate_with(
|
|
@@ -81,6 +81,9 @@ workos/types/events/list_filters.py
|
|
|
81
81
|
workos/types/events/organization_domain_verification_failed_payload.py
|
|
82
82
|
workos/types/events/previous_attributes.py
|
|
83
83
|
workos/types/events/session_created_payload.py
|
|
84
|
+
workos/types/feature_flags/__init__.py
|
|
85
|
+
workos/types/feature_flags/feature_flag.py
|
|
86
|
+
workos/types/feature_flags/list_filters.py
|
|
84
87
|
workos/types/fga/__init__.py
|
|
85
88
|
workos/types/fga/authorization_resource_types.py
|
|
86
89
|
workos/types/fga/authorization_resources.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
|
{workos-5.28.0 → workos-5.30.0}/workos/types/events/connection_payload_with_legacy_fields.py
RENAMED
|
File without changes
|
|
File without changes
|
{workos-5.28.0 → workos-5.30.0}/workos/types/events/directory_group_with_previous_attributes.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{workos-5.28.0 → workos-5.30.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.28.0 → workos-5.30.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
|
|
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
|