workos 10.6.0 → 10.7.0
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.
- checksums.yaml +4 -4
- data/.last-synced-sha +1 -1
- data/.oagen-manifest.json +30 -10
- data/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +84 -0
- data/Gemfile.lock +2 -2
- data/lib/workos/audit_logs.rb +2 -2
- data/lib/workos/client_api.rb +3 -3
- data/lib/workos/directory_sync/directory_user_with_groups.rb +1 -1
- data/lib/workos/directory_sync.rb +160 -0
- data/lib/workos/inflections.rb +1 -1
- data/lib/workos/pipes/connected_account_input.rb +3 -0
- data/lib/workos/pipes/create_connected_account.rb +6 -0
- data/lib/workos/pipes/create_organization_connected_account.rb +6 -0
- data/lib/workos/pipes/organization_connected_account.rb +3 -0
- data/lib/workos/pipes.rb +18 -0
- data/lib/workos/pipes_provider.rb +12 -0
- data/lib/workos/session.rb +12 -0
- data/lib/workos/shared/agent_registration_claim_completed_data.rb +3 -0
- data/lib/workos/shared/error_body_with_code.rb +16 -1
- data/lib/workos/shared/policy_denied_error_body.rb +5 -2
- data/lib/workos/shared/{sso_required_oauth_error_body_with_connection_ids_list_email_pending_authentication_token.rb → sso_required_oauth_error_body_with_connection_ids_list_email.rb} +1 -1
- data/lib/workos/sso.rb +6 -2
- data/lib/workos/types/connections_state.rb +14 -0
- data/lib/workos/types/data_integration_vended_credential_auth_method.rb +9 -0
- data/lib/workos/types/error_body_code.rb +1 -2
- data/lib/workos/types/pipes_provider_ownership.rb +9 -0
- data/lib/workos/user_management/authentication_email_verification_failed_data_error.rb +5 -2
- data/lib/workos/user_management/authentication_radar_risk_detected_data.rb +5 -2
- data/lib/workos/version.rb +1 -1
- data/rbi/workos/account_selection_required_error_body.rbi +1 -22
- data/rbi/workos/agent_blueprint_invocable_by.rbi +1 -22
- data/rbi/workos/agent_blueprint_updated_data_invocable_by.rbi +1 -22
- data/rbi/workos/agent_blueprint_updated_data_session_setting.rbi +1 -28
- data/rbi/workos/agent_blueprints_create_request_session_setting.rbi +1 -28
- data/rbi/workos/agent_blueprints_update_request_invocable_by.rbi +1 -22
- data/rbi/workos/agent_registration_claim_completed_data.rbi +6 -0
- data/rbi/workos/agent_registration_expired_data.rbi +1 -16
- data/rbi/workos/agent_registration_refreshed_data.rbi +1 -16
- data/rbi/workos/agent_registration_revoked_data.rbi +1 -16
- data/rbi/workos/api_key_owner.rbi +1 -22
- data/rbi/workos/api_key_revoked_data.rbi +1 -70
- data/rbi/workos/api_key_revoked_data_owner.rbi +1 -22
- data/rbi/workos/api_key_updated_data_owner.rbi +1 -22
- data/rbi/workos/audit_log_event_target.rbi +1 -34
- data/rbi/workos/audit_log_schema_actor_input.rbi +1 -16
- data/rbi/workos/audit_log_schema_target_input.rbi +1 -22
- data/rbi/workos/auth_method_mismatch_error_body.rbi +1 -22
- data/rbi/workos/authentication_email_verification_failed_data_error.rbi +6 -0
- data/rbi/workos/authentication_factor_sms.rbi +1 -16
- data/rbi/workos/authentication_magic_auth_failed_data_error.rbi +1 -22
- data/rbi/workos/authentication_mfa_failed_data_error.rbi +1 -22
- data/rbi/workos/authentication_oauth_failed_data_error.rbi +1 -22
- data/rbi/workos/authentication_passkey_failed_data_error.rbi +1 -22
- data/rbi/workos/authentication_password_failed_data_error.rbi +1 -22
- data/rbi/workos/authentication_radar_risk_detected_data.rbi +6 -0
- data/rbi/workos/authentication_sso_failed_data_error.rbi +1 -22
- data/rbi/workos/authentication_sso_started_data_sso.rbi +1 -28
- data/rbi/workos/authentication_sso_succeeded_data_sso.rbi +1 -28
- data/rbi/workos/authentication_sso_timed_out_data_error.rbi +1 -22
- data/rbi/workos/authentication_sso_timed_out_data_sso.rbi +1 -28
- data/rbi/workos/authorization.rbi +4 -2
- data/rbi/workos/claim_view_response_organization.rbi +1 -22
- data/rbi/workos/confirm_email_change.rbi +1 -16
- data/rbi/workos/connect_application.rbi +42 -0
- data/rbi/workos/connect_application_redirect_uri.rbi +30 -0
- data/rbi/workos/connected_account_input.rbi +6 -0
- data/rbi/workos/connection_deactivated_data_domain.rbi +1 -28
- data/rbi/workos/connection_domain.rbi +1 -28
- data/rbi/workos/connection_saml_certificate_renewed_data_connection.rbi +1 -22
- data/rbi/workos/create_connected_account.rbi +12 -0
- data/rbi/workos/create_group_role_assignment.rbi +1 -34
- data/rbi/workos/create_organization_connected_account.rbi +12 -0
- data/rbi/workos/create_role.rbi +1 -34
- data/rbi/workos/data_integration_access_token_response_with_access_token_access_token.rbi +1 -40
- data/rbi/workos/data_integrations_list_response_data_connected_account_warning.rbi +1 -22
- data/rbi/workos/delete_group_role_assignments_by_criteria.rbi +1 -34
- data/rbi/workos/directory_sync.rbi +46 -0
- data/rbi/workos/directory_user_with_groups_email.rbi +1 -28
- data/rbi/workos/dsync_group_user_removed_data.rbi +1 -28
- data/rbi/workos/dsync_token_revoked_data.rbi +1 -46
- data/rbi/workos/dsync_user_updated_data_email.rbi +1 -28
- data/rbi/workos/error_body.rbi +1 -16
- data/rbi/workos/feature_flags_flag_created_data_owner.rbi +1 -28
- data/rbi/workos/feature_flags_flag_deleted_data.rbi +1 -82
- data/rbi/workos/feature_flags_flag_deleted_data_owner.rbi +1 -28
- data/rbi/workos/feature_flags_flag_updated_context_previous_attribute_data_owner.rbi +1 -28
- data/rbi/workos/feature_flags_flag_updated_data.rbi +1 -82
- data/rbi/workos/feature_flags_flag_updated_data_owner.rbi +1 -28
- data/rbi/workos/flag.rbi +1 -76
- data/rbi/workos/flag_created_data.rbi +1 -82
- data/rbi/workos/flag_created_data_owner.rbi +1 -28
- data/rbi/workos/flag_deleted_data.rbi +1 -82
- data/rbi/workos/flag_deleted_data_owner.rbi +1 -28
- data/rbi/workos/flag_owner.rbi +1 -28
- data/rbi/workos/flag_rule_updated_context_configured_target_organization.rbi +1 -22
- data/rbi/workos/flag_rule_updated_context_previous_attribute_context_configured_target.rbi +1 -22
- data/rbi/workos/flag_rule_updated_context_previous_attribute_context_configured_target_organization.rbi +1 -22
- data/rbi/workos/flag_rule_updated_context_previous_attribute_context_configured_target_user.rbi +1 -22
- data/rbi/workos/flag_rule_updated_data.rbi +1 -82
- data/rbi/workos/flag_rule_updated_data_owner.rbi +1 -28
- data/rbi/workos/flag_updated_context_previous_attribute.rbi +1 -16
- data/rbi/workos/flag_updated_context_previous_attribute_data.rbi +1 -46
- data/rbi/workos/flag_updated_context_previous_attribute_data_owner.rbi +1 -28
- data/rbi/workos/flag_updated_data.rbi +1 -82
- data/rbi/workos/flag_updated_data_owner.rbi +1 -28
- data/rbi/workos/group_member_removed_data.rbi +1 -22
- data/rbi/workos/organization_api_key_owner.rbi +1 -22
- data/rbi/workos/organization_api_key_with_value_owner.rbi +1 -22
- data/rbi/workos/organization_connected_account.rbi +6 -0
- data/rbi/workos/organization_role_deleted_data.rbi +1 -64
- data/rbi/workos/organization_role_updated_data.rbi +1 -64
- data/rbi/workos/organization_selection_required_error_body_with_organization.rbi +1 -22
- data/rbi/workos/password_reset_succeeded_data.rbi +1 -46
- data/rbi/workos/patch_connection_standard_attributes.rbi +1 -46
- data/rbi/workos/permission.rbi +1 -64
- data/rbi/workos/permission_created_data.rbi +1 -64
- data/rbi/workos/permission_deleted_data.rbi +1 -64
- data/rbi/workos/permission_updated_data.rbi +1 -64
- data/rbi/workos/pipes.rbi +10 -4
- data/rbi/workos/pipes_account_connection_connection_failed_data.rbi +1 -76
- data/rbi/workos/pipes_connected_account_connection_failed_data.rbi +1 -76
- data/rbi/workos/pipes_provider.rbi +4 -2
- data/rbi/workos/policy_denied_error_body.rbi +6 -0
- data/rbi/workos/radar_standalone_update_radar_list_request.rbi +1 -16
- data/rbi/workos/remove_role.rbi +1 -34
- data/rbi/workos/replace_group_role_assignment_entry.rbi +1 -34
- data/rbi/workos/role_deleted_data.rbi +1 -46
- data/rbi/workos/role_updated_data.rbi +1 -46
- data/rbi/workos/send_verification_email_response.rbi +1 -16
- data/rbi/workos/session_created_data_impersonator.rbi +1 -22
- data/rbi/workos/session_revoked_data_impersonator.rbi +1 -22
- data/rbi/workos/slim_role.rbi +1 -16
- data/rbi/workos/sso.rbi +2 -1
- data/rbi/workos/{sso_required_oauth_error_body_with_connection_ids_list_email_pending_authentication_token.rbi → sso_required_oauth_error_body_with_connection_ids_list_email.rbi} +1 -1
- data/rbi/workos/sso_token_response_oauth_token.rbi +1 -40
- data/rbi/workos/update_group.rbi +1 -22
- data/rbi/workos/update_organization_role.rbi +1 -22
- data/rbi/workos/update_role.rbi +1 -22
- data/rbi/workos/user.rbi +1 -94
- data/rbi/workos/user_api_key_owner.rbi +1 -28
- data/rbi/workos/user_api_key_revoked_data_owner.rbi +1 -28
- data/rbi/workos/user_api_key_updated_data_owner.rbi +1 -28
- data/rbi/workos/user_api_key_with_value_owner.rbi +1 -28
- data/rbi/workos/user_role_assignment_resource.rbi +1 -28
- data/rbi/workos/user_role_assignment_source_group.rbi +1 -22
- data/rbi/workos/user_sessions_impersonator.rbi +1 -22
- data/rbi/workos/verify_email_address.rbi +1 -16
- data/rbi/workos/verify_email_response.rbi +1 -16
- data/rbi/workos/waitlist_list_response_list_metadata.rbi +1 -22
- data/rbi/workos/widget_session_token_response.rbi +1 -16
- data/test/workos/test_directory_sync.rb +32 -0
- data/test/workos/test_directory_sync_model_round_trip.rb +11 -11
- data/test/workos/test_pipes_model_round_trip.rb +7 -1
- data/test/workos/test_session.rb +46 -1
- data/test/workos/test_shared_model_round_trip.rb +71 -69
- data/test/workos/test_user_management_model_round_trip.rb +18 -9
- metadata +7 -3
data/rbi/workos/user.rbi
CHANGED
|
@@ -5,98 +5,5 @@
|
|
|
5
5
|
# typed: strong
|
|
6
6
|
|
|
7
7
|
module WorkOS
|
|
8
|
-
|
|
9
|
-
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
|
10
|
-
def initialize(json); end
|
|
11
|
-
|
|
12
|
-
sig { returns(String) }
|
|
13
|
-
def object; end
|
|
14
|
-
|
|
15
|
-
sig { params(value: String).returns(String) }
|
|
16
|
-
def object=(value); end
|
|
17
|
-
|
|
18
|
-
sig { returns(String) }
|
|
19
|
-
def id; end
|
|
20
|
-
|
|
21
|
-
sig { params(value: String).returns(String) }
|
|
22
|
-
def id=(value); end
|
|
23
|
-
|
|
24
|
-
sig { returns(T.nilable(String)) }
|
|
25
|
-
def first_name; end
|
|
26
|
-
|
|
27
|
-
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
28
|
-
def first_name=(value); end
|
|
29
|
-
|
|
30
|
-
sig { returns(T.nilable(String)) }
|
|
31
|
-
def last_name; end
|
|
32
|
-
|
|
33
|
-
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
34
|
-
def last_name=(value); end
|
|
35
|
-
|
|
36
|
-
sig { returns(T.nilable(String)) }
|
|
37
|
-
def name; end
|
|
38
|
-
|
|
39
|
-
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
40
|
-
def name=(value); end
|
|
41
|
-
|
|
42
|
-
sig { returns(T.nilable(String)) }
|
|
43
|
-
def profile_picture_url; end
|
|
44
|
-
|
|
45
|
-
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
46
|
-
def profile_picture_url=(value); end
|
|
47
|
-
|
|
48
|
-
sig { returns(String) }
|
|
49
|
-
def email; end
|
|
50
|
-
|
|
51
|
-
sig { params(value: String).returns(String) }
|
|
52
|
-
def email=(value); end
|
|
53
|
-
|
|
54
|
-
sig { returns(T::Boolean) }
|
|
55
|
-
def email_verified; end
|
|
56
|
-
|
|
57
|
-
sig { params(value: T::Boolean).returns(T::Boolean) }
|
|
58
|
-
def email_verified=(value); end
|
|
59
|
-
|
|
60
|
-
sig { returns(T.nilable(String)) }
|
|
61
|
-
def external_id; end
|
|
62
|
-
|
|
63
|
-
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
64
|
-
def external_id=(value); end
|
|
65
|
-
|
|
66
|
-
sig { returns(T.nilable(T::Hash[String, String])) }
|
|
67
|
-
def metadata; end
|
|
68
|
-
|
|
69
|
-
sig { params(value: T.nilable(T::Hash[String, String])).returns(T.nilable(T::Hash[String, String])) }
|
|
70
|
-
def metadata=(value); end
|
|
71
|
-
|
|
72
|
-
sig { returns(T.nilable(String)) }
|
|
73
|
-
def last_sign_in_at; end
|
|
74
|
-
|
|
75
|
-
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
76
|
-
def last_sign_in_at=(value); end
|
|
77
|
-
|
|
78
|
-
sig { returns(T.nilable(String)) }
|
|
79
|
-
def locale; end
|
|
80
|
-
|
|
81
|
-
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
82
|
-
def locale=(value); end
|
|
83
|
-
|
|
84
|
-
sig { returns(String) }
|
|
85
|
-
def created_at; end
|
|
86
|
-
|
|
87
|
-
sig { params(value: String).returns(String) }
|
|
88
|
-
def created_at=(value); end
|
|
89
|
-
|
|
90
|
-
sig { returns(String) }
|
|
91
|
-
def updated_at; end
|
|
92
|
-
|
|
93
|
-
sig { params(value: String).returns(String) }
|
|
94
|
-
def updated_at=(value); end
|
|
95
|
-
|
|
96
|
-
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
97
|
-
def to_h; end
|
|
98
|
-
|
|
99
|
-
sig { params(args: T.untyped).returns(String) }
|
|
100
|
-
def to_json(*args); end
|
|
101
|
-
end
|
|
8
|
+
User = EmailChangeConfirmationUser
|
|
102
9
|
end
|
|
@@ -5,32 +5,5 @@
|
|
|
5
5
|
# typed: strong
|
|
6
6
|
|
|
7
7
|
module WorkOS
|
|
8
|
-
|
|
9
|
-
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
|
10
|
-
def initialize(json); end
|
|
11
|
-
|
|
12
|
-
sig { returns(String) }
|
|
13
|
-
def type; end
|
|
14
|
-
|
|
15
|
-
sig { params(value: String).returns(String) }
|
|
16
|
-
def type=(value); end
|
|
17
|
-
|
|
18
|
-
sig { returns(String) }
|
|
19
|
-
def id; end
|
|
20
|
-
|
|
21
|
-
sig { params(value: String).returns(String) }
|
|
22
|
-
def id=(value); end
|
|
23
|
-
|
|
24
|
-
sig { returns(String) }
|
|
25
|
-
def organization_id; end
|
|
26
|
-
|
|
27
|
-
sig { params(value: String).returns(String) }
|
|
28
|
-
def organization_id=(value); end
|
|
29
|
-
|
|
30
|
-
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
31
|
-
def to_h; end
|
|
32
|
-
|
|
33
|
-
sig { params(args: T.untyped).returns(String) }
|
|
34
|
-
def to_json(*args); end
|
|
35
|
-
end
|
|
8
|
+
UserApiKeyOwner = UserApiKeyCreatedDataOwner
|
|
36
9
|
end
|
|
@@ -5,32 +5,5 @@
|
|
|
5
5
|
# typed: strong
|
|
6
6
|
|
|
7
7
|
module WorkOS
|
|
8
|
-
|
|
9
|
-
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
|
10
|
-
def initialize(json); end
|
|
11
|
-
|
|
12
|
-
sig { returns(String) }
|
|
13
|
-
def type; end
|
|
14
|
-
|
|
15
|
-
sig { params(value: String).returns(String) }
|
|
16
|
-
def type=(value); end
|
|
17
|
-
|
|
18
|
-
sig { returns(String) }
|
|
19
|
-
def id; end
|
|
20
|
-
|
|
21
|
-
sig { params(value: String).returns(String) }
|
|
22
|
-
def id=(value); end
|
|
23
|
-
|
|
24
|
-
sig { returns(String) }
|
|
25
|
-
def organization_id; end
|
|
26
|
-
|
|
27
|
-
sig { params(value: String).returns(String) }
|
|
28
|
-
def organization_id=(value); end
|
|
29
|
-
|
|
30
|
-
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
31
|
-
def to_h; end
|
|
32
|
-
|
|
33
|
-
sig { params(args: T.untyped).returns(String) }
|
|
34
|
-
def to_json(*args); end
|
|
35
|
-
end
|
|
8
|
+
UserApiKeyRevokedDataOwner = UserApiKeyCreatedDataOwner
|
|
36
9
|
end
|
|
@@ -5,32 +5,5 @@
|
|
|
5
5
|
# typed: strong
|
|
6
6
|
|
|
7
7
|
module WorkOS
|
|
8
|
-
|
|
9
|
-
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
|
10
|
-
def initialize(json); end
|
|
11
|
-
|
|
12
|
-
sig { returns(String) }
|
|
13
|
-
def type; end
|
|
14
|
-
|
|
15
|
-
sig { params(value: String).returns(String) }
|
|
16
|
-
def type=(value); end
|
|
17
|
-
|
|
18
|
-
sig { returns(String) }
|
|
19
|
-
def id; end
|
|
20
|
-
|
|
21
|
-
sig { params(value: String).returns(String) }
|
|
22
|
-
def id=(value); end
|
|
23
|
-
|
|
24
|
-
sig { returns(String) }
|
|
25
|
-
def organization_id; end
|
|
26
|
-
|
|
27
|
-
sig { params(value: String).returns(String) }
|
|
28
|
-
def organization_id=(value); end
|
|
29
|
-
|
|
30
|
-
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
31
|
-
def to_h; end
|
|
32
|
-
|
|
33
|
-
sig { params(args: T.untyped).returns(String) }
|
|
34
|
-
def to_json(*args); end
|
|
35
|
-
end
|
|
8
|
+
UserApiKeyUpdatedDataOwner = UserApiKeyCreatedDataOwner
|
|
36
9
|
end
|
|
@@ -5,32 +5,5 @@
|
|
|
5
5
|
# typed: strong
|
|
6
6
|
|
|
7
7
|
module WorkOS
|
|
8
|
-
|
|
9
|
-
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
|
10
|
-
def initialize(json); end
|
|
11
|
-
|
|
12
|
-
sig { returns(String) }
|
|
13
|
-
def type; end
|
|
14
|
-
|
|
15
|
-
sig { params(value: String).returns(String) }
|
|
16
|
-
def type=(value); end
|
|
17
|
-
|
|
18
|
-
sig { returns(String) }
|
|
19
|
-
def id; end
|
|
20
|
-
|
|
21
|
-
sig { params(value: String).returns(String) }
|
|
22
|
-
def id=(value); end
|
|
23
|
-
|
|
24
|
-
sig { returns(String) }
|
|
25
|
-
def organization_id; end
|
|
26
|
-
|
|
27
|
-
sig { params(value: String).returns(String) }
|
|
28
|
-
def organization_id=(value); end
|
|
29
|
-
|
|
30
|
-
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
31
|
-
def to_h; end
|
|
32
|
-
|
|
33
|
-
sig { params(args: T.untyped).returns(String) }
|
|
34
|
-
def to_json(*args); end
|
|
35
|
-
end
|
|
8
|
+
UserApiKeyWithValueOwner = UserApiKeyCreatedDataOwner
|
|
36
9
|
end
|
|
@@ -5,32 +5,5 @@
|
|
|
5
5
|
# typed: strong
|
|
6
6
|
|
|
7
7
|
module WorkOS
|
|
8
|
-
|
|
9
|
-
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
|
10
|
-
def initialize(json); end
|
|
11
|
-
|
|
12
|
-
sig { returns(String) }
|
|
13
|
-
def id; end
|
|
14
|
-
|
|
15
|
-
sig { params(value: String).returns(String) }
|
|
16
|
-
def id=(value); end
|
|
17
|
-
|
|
18
|
-
sig { returns(String) }
|
|
19
|
-
def external_id; end
|
|
20
|
-
|
|
21
|
-
sig { params(value: String).returns(String) }
|
|
22
|
-
def external_id=(value); end
|
|
23
|
-
|
|
24
|
-
sig { returns(String) }
|
|
25
|
-
def resource_type_slug; end
|
|
26
|
-
|
|
27
|
-
sig { params(value: String).returns(String) }
|
|
28
|
-
def resource_type_slug=(value); end
|
|
29
|
-
|
|
30
|
-
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
31
|
-
def to_h; end
|
|
32
|
-
|
|
33
|
-
sig { params(args: T.untyped).returns(String) }
|
|
34
|
-
def to_json(*args); end
|
|
35
|
-
end
|
|
8
|
+
UserRoleAssignmentResource = GroupRoleAssignmentResource
|
|
36
9
|
end
|
|
@@ -5,26 +5,5 @@
|
|
|
5
5
|
# typed: strong
|
|
6
6
|
|
|
7
7
|
module WorkOS
|
|
8
|
-
|
|
9
|
-
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
|
10
|
-
def initialize(json); end
|
|
11
|
-
|
|
12
|
-
sig { returns(String) }
|
|
13
|
-
def id; end
|
|
14
|
-
|
|
15
|
-
sig { params(value: String).returns(String) }
|
|
16
|
-
def id=(value); end
|
|
17
|
-
|
|
18
|
-
sig { returns(String) }
|
|
19
|
-
def name; end
|
|
20
|
-
|
|
21
|
-
sig { params(value: String).returns(String) }
|
|
22
|
-
def name=(value); end
|
|
23
|
-
|
|
24
|
-
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
25
|
-
def to_h; end
|
|
26
|
-
|
|
27
|
-
sig { params(args: T.untyped).returns(String) }
|
|
28
|
-
def to_json(*args); end
|
|
29
|
-
end
|
|
8
|
+
UserRoleAssignmentSourceGroup = Actor
|
|
30
9
|
end
|
|
@@ -5,26 +5,5 @@
|
|
|
5
5
|
# typed: strong
|
|
6
6
|
|
|
7
7
|
module WorkOS
|
|
8
|
-
|
|
9
|
-
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
|
10
|
-
def initialize(json); end
|
|
11
|
-
|
|
12
|
-
sig { returns(String) }
|
|
13
|
-
def email; end
|
|
14
|
-
|
|
15
|
-
sig { params(value: String).returns(String) }
|
|
16
|
-
def email=(value); end
|
|
17
|
-
|
|
18
|
-
sig { returns(T.nilable(String)) }
|
|
19
|
-
def reason; end
|
|
20
|
-
|
|
21
|
-
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
22
|
-
def reason=(value); end
|
|
23
|
-
|
|
24
|
-
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
25
|
-
def to_h; end
|
|
26
|
-
|
|
27
|
-
sig { params(args: T.untyped).returns(String) }
|
|
28
|
-
def to_json(*args); end
|
|
29
|
-
end
|
|
8
|
+
UserSessionsImpersonator = AuthenticateResponseImpersonator
|
|
30
9
|
end
|
|
@@ -5,20 +5,5 @@
|
|
|
5
5
|
# typed: strong
|
|
6
6
|
|
|
7
7
|
module WorkOS
|
|
8
|
-
|
|
9
|
-
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
|
10
|
-
def initialize(json); end
|
|
11
|
-
|
|
12
|
-
sig { returns(String) }
|
|
13
|
-
def code; end
|
|
14
|
-
|
|
15
|
-
sig { params(value: String).returns(String) }
|
|
16
|
-
def code=(value); end
|
|
17
|
-
|
|
18
|
-
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
19
|
-
def to_h; end
|
|
20
|
-
|
|
21
|
-
sig { params(args: T.untyped).returns(String) }
|
|
22
|
-
def to_json(*args); end
|
|
23
|
-
end
|
|
8
|
+
VerifyEmailAddress = AuthenticationChallengesVerifyRequest
|
|
24
9
|
end
|
|
@@ -5,20 +5,5 @@
|
|
|
5
5
|
# typed: strong
|
|
6
6
|
|
|
7
7
|
module WorkOS
|
|
8
|
-
|
|
9
|
-
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
|
10
|
-
def initialize(json); end
|
|
11
|
-
|
|
12
|
-
sig { returns(WorkOS::User) }
|
|
13
|
-
def user; end
|
|
14
|
-
|
|
15
|
-
sig { params(value: WorkOS::User).returns(WorkOS::User) }
|
|
16
|
-
def user=(value); end
|
|
17
|
-
|
|
18
|
-
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
19
|
-
def to_h; end
|
|
20
|
-
|
|
21
|
-
sig { params(args: T.untyped).returns(String) }
|
|
22
|
-
def to_json(*args); end
|
|
23
|
-
end
|
|
8
|
+
VerifyEmailResponse = ResetPasswordResponse
|
|
24
9
|
end
|
|
@@ -5,26 +5,5 @@
|
|
|
5
5
|
# typed: strong
|
|
6
6
|
|
|
7
7
|
module WorkOS
|
|
8
|
-
|
|
9
|
-
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
|
10
|
-
def initialize(json); end
|
|
11
|
-
|
|
12
|
-
sig { returns(T.nilable(String)) }
|
|
13
|
-
def before; end
|
|
14
|
-
|
|
15
|
-
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
16
|
-
def before=(value); end
|
|
17
|
-
|
|
18
|
-
sig { returns(T.nilable(String)) }
|
|
19
|
-
def after; end
|
|
20
|
-
|
|
21
|
-
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
22
|
-
def after=(value); end
|
|
23
|
-
|
|
24
|
-
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
25
|
-
def to_h; end
|
|
26
|
-
|
|
27
|
-
sig { params(args: T.untyped).returns(String) }
|
|
28
|
-
def to_json(*args); end
|
|
29
|
-
end
|
|
8
|
+
WaitlistListResponseListMetadata = ItContactListListMetadata
|
|
30
9
|
end
|
|
@@ -5,20 +5,5 @@
|
|
|
5
5
|
# typed: strong
|
|
6
6
|
|
|
7
7
|
module WorkOS
|
|
8
|
-
|
|
9
|
-
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
|
10
|
-
def initialize(json); end
|
|
11
|
-
|
|
12
|
-
sig { returns(String) }
|
|
13
|
-
def token; end
|
|
14
|
-
|
|
15
|
-
sig { params(value: String).returns(String) }
|
|
16
|
-
def token=(value); end
|
|
17
|
-
|
|
18
|
-
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
19
|
-
def to_h; end
|
|
20
|
-
|
|
21
|
-
sig { params(args: T.untyped).returns(String) }
|
|
22
|
-
def to_json(*args); end
|
|
23
|
-
end
|
|
8
|
+
WidgetSessionTokenResponse = ClientApiTokenResponse
|
|
24
9
|
end
|
|
@@ -39,6 +39,34 @@ class DirectorySyncTest < Minitest::Test
|
|
|
39
39
|
refute_nil result
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
+
def test_list_directory_groups_returns_expected_result
|
|
43
|
+
stub_request(:get, %r{\Ahttps://api\.workos\.com/directories/stub/groups(\?|\z)})
|
|
44
|
+
.to_return(body: '{"data": [], "list_metadata": {}}', status: 200)
|
|
45
|
+
result = @client.directory_sync.list_directory_groups(directory_id: "stub")
|
|
46
|
+
assert_kind_of WorkOS::Types::ListStruct, result
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def test_get_directory_group_returns_expected_result
|
|
50
|
+
stub_request(:get, %r{\Ahttps://api\.workos\.com/directories/stub/groups/stub(\?|\z)})
|
|
51
|
+
.to_return(body: "{}", status: 200)
|
|
52
|
+
result = @client.directory_sync.get_directory_group(directory_id: "stub", group_id: "stub")
|
|
53
|
+
refute_nil result
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def test_list_directory_users_returns_expected_result
|
|
57
|
+
stub_request(:get, %r{\Ahttps://api\.workos\.com/directories/stub/users(\?|\z)})
|
|
58
|
+
.to_return(body: '{"data": [], "list_metadata": {}}', status: 200)
|
|
59
|
+
result = @client.directory_sync.list_directory_users(directory_id: "stub")
|
|
60
|
+
assert_kind_of WorkOS::Types::ListStruct, result
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def test_get_directory_user_returns_expected_result
|
|
64
|
+
stub_request(:get, %r{\Ahttps://api\.workos\.com/directories/stub/users/stub(\?|\z)})
|
|
65
|
+
.to_return(body: "{}", status: 200)
|
|
66
|
+
result = @client.directory_sync.get_directory_user(directory_id: "stub", user_id: "stub")
|
|
67
|
+
refute_nil result
|
|
68
|
+
end
|
|
69
|
+
|
|
42
70
|
def test_list_groups_returns_expected_result
|
|
43
71
|
stub_request(:get, %r{\Ahttps://api\.workos\.com/directory_groups(\?|\z)})
|
|
44
72
|
.to_return(body: '{"data": [], "list_metadata": {}}', status: 200)
|
|
@@ -73,6 +101,10 @@ class DirectorySyncTest < Minitest::Test
|
|
|
73
101
|
{name: :get_directory, verb: :get, url: %r{\Ahttps://api\.workos\.com/directories/stub(\?|\z)}, args: {id: "stub"}},
|
|
74
102
|
{name: :delete_directory, verb: :delete, url: %r{\Ahttps://api\.workos\.com/directories/stub(\?|\z)}, args: {id: "stub"}},
|
|
75
103
|
{name: :create_directory_sync, verb: :post, url: %r{\Ahttps://api\.workos\.com/directories/stub/sync(\?|\z)}, args: {id: "stub"}},
|
|
104
|
+
{name: :list_directory_groups, verb: :get, url: %r{\Ahttps://api\.workos\.com/directories/stub/groups(\?|\z)}, args: {directory_id: "stub"}},
|
|
105
|
+
{name: :get_directory_group, verb: :get, url: %r{\Ahttps://api\.workos\.com/directories/stub/groups/stub(\?|\z)}, args: {directory_id: "stub", group_id: "stub"}},
|
|
106
|
+
{name: :list_directory_users, verb: :get, url: %r{\Ahttps://api\.workos\.com/directories/stub/users(\?|\z)}, args: {directory_id: "stub"}},
|
|
107
|
+
{name: :get_directory_user, verb: :get, url: %r{\Ahttps://api\.workos\.com/directories/stub/users/stub(\?|\z)}, args: {directory_id: "stub", user_id: "stub"}},
|
|
76
108
|
{name: :list_groups, verb: :get, url: %r{\Ahttps://api\.workos\.com/directory_groups(\?|\z)}},
|
|
77
109
|
{name: :get_group, verb: :get, url: %r{\Ahttps://api\.workos\.com/directory_groups/stub(\?|\z)}, args: {id: "stub"}},
|
|
78
110
|
{name: :list_users, verb: :get, url: %r{\Ahttps://api\.workos\.com/directory_users(\?|\z)}},
|
|
@@ -80,7 +80,7 @@ class DirectorySyncModelRoundTripTest < Minitest::Test
|
|
|
80
80
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
81
81
|
end
|
|
82
82
|
|
|
83
|
-
def
|
|
83
|
+
def test_directory_user_round_trip
|
|
84
84
|
fixture = {
|
|
85
85
|
"object" => "directory_user",
|
|
86
86
|
"id" => "stub",
|
|
@@ -100,10 +100,9 @@ class DirectorySyncModelRoundTripTest < Minitest::Test
|
|
|
100
100
|
"role" => {},
|
|
101
101
|
"roles" => [],
|
|
102
102
|
"created_at" => "stub",
|
|
103
|
-
"updated_at" => "stub"
|
|
104
|
-
"groups" => []
|
|
103
|
+
"updated_at" => "stub"
|
|
105
104
|
}
|
|
106
|
-
model = WorkOS::
|
|
105
|
+
model = WorkOS::DirectoryUser.new(fixture.to_json)
|
|
107
106
|
json = model.to_h
|
|
108
107
|
assert_kind_of Hash, json
|
|
109
108
|
assert_equal fixture["id"], json[:id]
|
|
@@ -116,7 +115,7 @@ class DirectorySyncModelRoundTripTest < Minitest::Test
|
|
|
116
115
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
117
116
|
end
|
|
118
117
|
|
|
119
|
-
def
|
|
118
|
+
def test_directory_user_with_groups_round_trip
|
|
120
119
|
fixture = {
|
|
121
120
|
"object" => "directory_user",
|
|
122
121
|
"id" => "stub",
|
|
@@ -136,9 +135,10 @@ class DirectorySyncModelRoundTripTest < Minitest::Test
|
|
|
136
135
|
"role" => {},
|
|
137
136
|
"roles" => [],
|
|
138
137
|
"created_at" => "stub",
|
|
139
|
-
"updated_at" => "stub"
|
|
138
|
+
"updated_at" => "stub",
|
|
139
|
+
"groups" => []
|
|
140
140
|
}
|
|
141
|
-
model = WorkOS::
|
|
141
|
+
model = WorkOS::DirectoryUserWithGroups.new(fixture.to_json)
|
|
142
142
|
json = model.to_h
|
|
143
143
|
assert_kind_of Hash, json
|
|
144
144
|
assert_equal fixture["id"], json[:id]
|
|
@@ -552,25 +552,25 @@ class DirectorySyncModelRoundTripTest < Minitest::Test
|
|
|
552
552
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
553
553
|
end
|
|
554
554
|
|
|
555
|
-
def
|
|
555
|
+
def test_directory_user_with_groups_email_round_trip
|
|
556
556
|
fixture = {
|
|
557
557
|
"primary" => true,
|
|
558
558
|
"type" => "stub",
|
|
559
559
|
"value" => nil
|
|
560
560
|
}
|
|
561
|
-
model = WorkOS::
|
|
561
|
+
model = WorkOS::DirectoryUserWithGroupsEmail.new(fixture.to_json)
|
|
562
562
|
json = model.to_h
|
|
563
563
|
assert_kind_of Hash, json
|
|
564
564
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
565
565
|
end
|
|
566
566
|
|
|
567
|
-
def
|
|
567
|
+
def test_directory_user_email_round_trip
|
|
568
568
|
fixture = {
|
|
569
569
|
"primary" => true,
|
|
570
570
|
"type" => "stub",
|
|
571
571
|
"value" => nil
|
|
572
572
|
}
|
|
573
|
-
model = WorkOS::
|
|
573
|
+
model = WorkOS::DirectoryUserEmail.new(fixture.to_json)
|
|
574
574
|
json = model.to_h
|
|
575
575
|
assert_kind_of Hash, json
|
|
576
576
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
@@ -111,12 +111,14 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
111
111
|
fixture = {
|
|
112
112
|
"account_display_name" => nil,
|
|
113
113
|
"account_identifier" => nil,
|
|
114
|
+
"config" => {},
|
|
114
115
|
"access_token" => "stub",
|
|
115
116
|
"refresh_token" => "stub",
|
|
116
117
|
"expires_at" => "stub",
|
|
117
118
|
"scopes" => [],
|
|
118
119
|
"state" => "stub",
|
|
119
120
|
"user_id" => "stub",
|
|
121
|
+
"metadata" => {},
|
|
120
122
|
"connection_intent" => "add"
|
|
121
123
|
}
|
|
122
124
|
model = WorkOS::CreateOrganizationConnectedAccount.new(fixture.to_json)
|
|
@@ -130,6 +132,7 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
130
132
|
fixture = {
|
|
131
133
|
"account_display_name" => nil,
|
|
132
134
|
"account_identifier" => nil,
|
|
135
|
+
"config" => {},
|
|
133
136
|
"access_token" => "stub",
|
|
134
137
|
"refresh_token" => "stub",
|
|
135
138
|
"expires_at" => "stub",
|
|
@@ -148,11 +151,13 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
148
151
|
fixture = {
|
|
149
152
|
"account_display_name" => nil,
|
|
150
153
|
"account_identifier" => nil,
|
|
154
|
+
"config" => {},
|
|
151
155
|
"access_token" => "stub",
|
|
152
156
|
"refresh_token" => "stub",
|
|
153
157
|
"expires_at" => "stub",
|
|
154
158
|
"scopes" => [],
|
|
155
159
|
"state" => "stub",
|
|
160
|
+
"metadata" => {},
|
|
156
161
|
"connection_intent" => "add"
|
|
157
162
|
}
|
|
158
163
|
model = WorkOS::CreateConnectedAccount.new(fixture.to_json)
|
|
@@ -165,6 +170,7 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
165
170
|
fixture = {
|
|
166
171
|
"account_display_name" => nil,
|
|
167
172
|
"account_identifier" => nil,
|
|
173
|
+
"config" => {},
|
|
168
174
|
"access_token" => "stub",
|
|
169
175
|
"refresh_token" => "stub",
|
|
170
176
|
"expires_at" => "stub",
|
|
@@ -285,7 +291,7 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
285
291
|
def test_data_integration_vended_credential_round_trip
|
|
286
292
|
fixture = {
|
|
287
293
|
"object" => "credential",
|
|
288
|
-
"auth_method" => "
|
|
294
|
+
"auth_method" => "stub",
|
|
289
295
|
"value" => "stub",
|
|
290
296
|
"expires_at" => nil,
|
|
291
297
|
"scopes" => [],
|
data/test/workos/test_session.rb
CHANGED
|
@@ -76,7 +76,7 @@ class SessionTest < Minitest::Test
|
|
|
76
76
|
end
|
|
77
77
|
|
|
78
78
|
def make_jwt(claims, rsa, kid: "test-key")
|
|
79
|
-
JWT.encode(claims, rsa, "RS256", {kid: kid})
|
|
79
|
+
JWT.encode({"auth_time" => Time.now.to_i}.merge(claims), rsa, "RS256", {kid: kid})
|
|
80
80
|
end
|
|
81
81
|
|
|
82
82
|
def jwks_payload(public_key, kid: "test-key")
|
|
@@ -101,6 +101,51 @@ class SessionTest < Minitest::Test
|
|
|
101
101
|
assert_equal "u_1", result.user["id"]
|
|
102
102
|
end
|
|
103
103
|
|
|
104
|
+
[
|
|
105
|
+
{"sub_profile" => "ai_agent"},
|
|
106
|
+
{"sub_type" => "authkit"},
|
|
107
|
+
{"auth_time" => nil},
|
|
108
|
+
{"auth_time" => "1700000000"},
|
|
109
|
+
{"sid" => nil},
|
|
110
|
+
{"sid" => 123}
|
|
111
|
+
].each_with_index do |claims, index|
|
|
112
|
+
define_method(:"test_authenticate_rejects_non_user_access_token_#{index}") do
|
|
113
|
+
rsa, pub = signing_key_pair
|
|
114
|
+
access_token = make_jwt({"sid" => "session_42", "exp" => Time.now.to_i + 60}.merge(claims), rsa)
|
|
115
|
+
sealed = @sm.seal_data({"access_token" => access_token}, PASSWORD)
|
|
116
|
+
stub_request(:get, "https://api.workos.com/sso/jwks/client_001")
|
|
117
|
+
.to_return(status: 200, body: jwks_payload(pub).to_json)
|
|
118
|
+
|
|
119
|
+
result = @sm.authenticate(seal_data: sealed, cookie_password: PASSWORD)
|
|
120
|
+
assert_kind_of WorkOS::SessionManager::AuthError, result
|
|
121
|
+
assert_equal WorkOS::SessionManager::INVALID_JWT, result.reason
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
def test_authenticate_rejects_expired_non_user_access_token_when_include_expired_is_true
|
|
126
|
+
rsa, pub = signing_key_pair
|
|
127
|
+
access_token = make_jwt({"sid" => "session_42", "sub_profile" => "ai_agent", "exp" => Time.now.to_i - 60}, rsa)
|
|
128
|
+
sealed = @sm.seal_data({"access_token" => access_token}, PASSWORD)
|
|
129
|
+
stub_request(:get, "https://api.workos.com/sso/jwks/client_001")
|
|
130
|
+
.to_return(status: 200, body: jwks_payload(pub).to_json)
|
|
131
|
+
|
|
132
|
+
result = @sm.authenticate(seal_data: sealed, cookie_password: PASSWORD, include_expired: true)
|
|
133
|
+
assert_kind_of WorkOS::SessionManager::AuthError, result
|
|
134
|
+
assert_equal WorkOS::SessionManager::INVALID_JWT, result.reason
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
def test_authenticate_accepts_user_sub_profile
|
|
138
|
+
rsa, pub = signing_key_pair
|
|
139
|
+
access_token = make_jwt({"sid" => "session_42", "sub_profile" => "user", "exp" => Time.now.to_i + 60}, rsa)
|
|
140
|
+
sealed = @sm.seal_data({"access_token" => access_token}, PASSWORD)
|
|
141
|
+
stub_request(:get, "https://api.workos.com/sso/jwks/client_001")
|
|
142
|
+
.to_return(status: 200, body: jwks_payload(pub).to_json)
|
|
143
|
+
|
|
144
|
+
result = @sm.authenticate(seal_data: sealed, cookie_password: PASSWORD)
|
|
145
|
+
assert_kind_of WorkOS::SessionManager::AuthSuccess, result
|
|
146
|
+
assert result.authenticated
|
|
147
|
+
end
|
|
148
|
+
|
|
104
149
|
def test_authenticate_reads_legacy_v6_sealed_session
|
|
105
150
|
rsa, pub = signing_key_pair
|
|
106
151
|
access_token = make_jwt({"sid" => "session_v6", "org_id" => "org_legacy", "exp" => Time.now.to_i + 60}, rsa)
|