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.
Files changed (158) hide show
  1. checksums.yaml +4 -4
  2. data/.last-synced-sha +1 -1
  3. data/.oagen-manifest.json +30 -10
  4. data/.release-please-manifest.json +1 -1
  5. data/CHANGELOG.md +84 -0
  6. data/Gemfile.lock +2 -2
  7. data/lib/workos/audit_logs.rb +2 -2
  8. data/lib/workos/client_api.rb +3 -3
  9. data/lib/workos/directory_sync/directory_user_with_groups.rb +1 -1
  10. data/lib/workos/directory_sync.rb +160 -0
  11. data/lib/workos/inflections.rb +1 -1
  12. data/lib/workos/pipes/connected_account_input.rb +3 -0
  13. data/lib/workos/pipes/create_connected_account.rb +6 -0
  14. data/lib/workos/pipes/create_organization_connected_account.rb +6 -0
  15. data/lib/workos/pipes/organization_connected_account.rb +3 -0
  16. data/lib/workos/pipes.rb +18 -0
  17. data/lib/workos/pipes_provider.rb +12 -0
  18. data/lib/workos/session.rb +12 -0
  19. data/lib/workos/shared/agent_registration_claim_completed_data.rb +3 -0
  20. data/lib/workos/shared/error_body_with_code.rb +16 -1
  21. data/lib/workos/shared/policy_denied_error_body.rb +5 -2
  22. 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
  23. data/lib/workos/sso.rb +6 -2
  24. data/lib/workos/types/connections_state.rb +14 -0
  25. data/lib/workos/types/data_integration_vended_credential_auth_method.rb +9 -0
  26. data/lib/workos/types/error_body_code.rb +1 -2
  27. data/lib/workos/types/pipes_provider_ownership.rb +9 -0
  28. data/lib/workos/user_management/authentication_email_verification_failed_data_error.rb +5 -2
  29. data/lib/workos/user_management/authentication_radar_risk_detected_data.rb +5 -2
  30. data/lib/workos/version.rb +1 -1
  31. data/rbi/workos/account_selection_required_error_body.rbi +1 -22
  32. data/rbi/workos/agent_blueprint_invocable_by.rbi +1 -22
  33. data/rbi/workos/agent_blueprint_updated_data_invocable_by.rbi +1 -22
  34. data/rbi/workos/agent_blueprint_updated_data_session_setting.rbi +1 -28
  35. data/rbi/workos/agent_blueprints_create_request_session_setting.rbi +1 -28
  36. data/rbi/workos/agent_blueprints_update_request_invocable_by.rbi +1 -22
  37. data/rbi/workos/agent_registration_claim_completed_data.rbi +6 -0
  38. data/rbi/workos/agent_registration_expired_data.rbi +1 -16
  39. data/rbi/workos/agent_registration_refreshed_data.rbi +1 -16
  40. data/rbi/workos/agent_registration_revoked_data.rbi +1 -16
  41. data/rbi/workos/api_key_owner.rbi +1 -22
  42. data/rbi/workos/api_key_revoked_data.rbi +1 -70
  43. data/rbi/workos/api_key_revoked_data_owner.rbi +1 -22
  44. data/rbi/workos/api_key_updated_data_owner.rbi +1 -22
  45. data/rbi/workos/audit_log_event_target.rbi +1 -34
  46. data/rbi/workos/audit_log_schema_actor_input.rbi +1 -16
  47. data/rbi/workos/audit_log_schema_target_input.rbi +1 -22
  48. data/rbi/workos/auth_method_mismatch_error_body.rbi +1 -22
  49. data/rbi/workos/authentication_email_verification_failed_data_error.rbi +6 -0
  50. data/rbi/workos/authentication_factor_sms.rbi +1 -16
  51. data/rbi/workos/authentication_magic_auth_failed_data_error.rbi +1 -22
  52. data/rbi/workos/authentication_mfa_failed_data_error.rbi +1 -22
  53. data/rbi/workos/authentication_oauth_failed_data_error.rbi +1 -22
  54. data/rbi/workos/authentication_passkey_failed_data_error.rbi +1 -22
  55. data/rbi/workos/authentication_password_failed_data_error.rbi +1 -22
  56. data/rbi/workos/authentication_radar_risk_detected_data.rbi +6 -0
  57. data/rbi/workos/authentication_sso_failed_data_error.rbi +1 -22
  58. data/rbi/workos/authentication_sso_started_data_sso.rbi +1 -28
  59. data/rbi/workos/authentication_sso_succeeded_data_sso.rbi +1 -28
  60. data/rbi/workos/authentication_sso_timed_out_data_error.rbi +1 -22
  61. data/rbi/workos/authentication_sso_timed_out_data_sso.rbi +1 -28
  62. data/rbi/workos/authorization.rbi +4 -2
  63. data/rbi/workos/claim_view_response_organization.rbi +1 -22
  64. data/rbi/workos/confirm_email_change.rbi +1 -16
  65. data/rbi/workos/connect_application.rbi +42 -0
  66. data/rbi/workos/connect_application_redirect_uri.rbi +30 -0
  67. data/rbi/workos/connected_account_input.rbi +6 -0
  68. data/rbi/workos/connection_deactivated_data_domain.rbi +1 -28
  69. data/rbi/workos/connection_domain.rbi +1 -28
  70. data/rbi/workos/connection_saml_certificate_renewed_data_connection.rbi +1 -22
  71. data/rbi/workos/create_connected_account.rbi +12 -0
  72. data/rbi/workos/create_group_role_assignment.rbi +1 -34
  73. data/rbi/workos/create_organization_connected_account.rbi +12 -0
  74. data/rbi/workos/create_role.rbi +1 -34
  75. data/rbi/workos/data_integration_access_token_response_with_access_token_access_token.rbi +1 -40
  76. data/rbi/workos/data_integrations_list_response_data_connected_account_warning.rbi +1 -22
  77. data/rbi/workos/delete_group_role_assignments_by_criteria.rbi +1 -34
  78. data/rbi/workos/directory_sync.rbi +46 -0
  79. data/rbi/workos/directory_user_with_groups_email.rbi +1 -28
  80. data/rbi/workos/dsync_group_user_removed_data.rbi +1 -28
  81. data/rbi/workos/dsync_token_revoked_data.rbi +1 -46
  82. data/rbi/workos/dsync_user_updated_data_email.rbi +1 -28
  83. data/rbi/workos/error_body.rbi +1 -16
  84. data/rbi/workos/feature_flags_flag_created_data_owner.rbi +1 -28
  85. data/rbi/workos/feature_flags_flag_deleted_data.rbi +1 -82
  86. data/rbi/workos/feature_flags_flag_deleted_data_owner.rbi +1 -28
  87. data/rbi/workos/feature_flags_flag_updated_context_previous_attribute_data_owner.rbi +1 -28
  88. data/rbi/workos/feature_flags_flag_updated_data.rbi +1 -82
  89. data/rbi/workos/feature_flags_flag_updated_data_owner.rbi +1 -28
  90. data/rbi/workos/flag.rbi +1 -76
  91. data/rbi/workos/flag_created_data.rbi +1 -82
  92. data/rbi/workos/flag_created_data_owner.rbi +1 -28
  93. data/rbi/workos/flag_deleted_data.rbi +1 -82
  94. data/rbi/workos/flag_deleted_data_owner.rbi +1 -28
  95. data/rbi/workos/flag_owner.rbi +1 -28
  96. data/rbi/workos/flag_rule_updated_context_configured_target_organization.rbi +1 -22
  97. data/rbi/workos/flag_rule_updated_context_previous_attribute_context_configured_target.rbi +1 -22
  98. data/rbi/workos/flag_rule_updated_context_previous_attribute_context_configured_target_organization.rbi +1 -22
  99. data/rbi/workos/flag_rule_updated_context_previous_attribute_context_configured_target_user.rbi +1 -22
  100. data/rbi/workos/flag_rule_updated_data.rbi +1 -82
  101. data/rbi/workos/flag_rule_updated_data_owner.rbi +1 -28
  102. data/rbi/workos/flag_updated_context_previous_attribute.rbi +1 -16
  103. data/rbi/workos/flag_updated_context_previous_attribute_data.rbi +1 -46
  104. data/rbi/workos/flag_updated_context_previous_attribute_data_owner.rbi +1 -28
  105. data/rbi/workos/flag_updated_data.rbi +1 -82
  106. data/rbi/workos/flag_updated_data_owner.rbi +1 -28
  107. data/rbi/workos/group_member_removed_data.rbi +1 -22
  108. data/rbi/workos/organization_api_key_owner.rbi +1 -22
  109. data/rbi/workos/organization_api_key_with_value_owner.rbi +1 -22
  110. data/rbi/workos/organization_connected_account.rbi +6 -0
  111. data/rbi/workos/organization_role_deleted_data.rbi +1 -64
  112. data/rbi/workos/organization_role_updated_data.rbi +1 -64
  113. data/rbi/workos/organization_selection_required_error_body_with_organization.rbi +1 -22
  114. data/rbi/workos/password_reset_succeeded_data.rbi +1 -46
  115. data/rbi/workos/patch_connection_standard_attributes.rbi +1 -46
  116. data/rbi/workos/permission.rbi +1 -64
  117. data/rbi/workos/permission_created_data.rbi +1 -64
  118. data/rbi/workos/permission_deleted_data.rbi +1 -64
  119. data/rbi/workos/permission_updated_data.rbi +1 -64
  120. data/rbi/workos/pipes.rbi +10 -4
  121. data/rbi/workos/pipes_account_connection_connection_failed_data.rbi +1 -76
  122. data/rbi/workos/pipes_connected_account_connection_failed_data.rbi +1 -76
  123. data/rbi/workos/pipes_provider.rbi +4 -2
  124. data/rbi/workos/policy_denied_error_body.rbi +6 -0
  125. data/rbi/workos/radar_standalone_update_radar_list_request.rbi +1 -16
  126. data/rbi/workos/remove_role.rbi +1 -34
  127. data/rbi/workos/replace_group_role_assignment_entry.rbi +1 -34
  128. data/rbi/workos/role_deleted_data.rbi +1 -46
  129. data/rbi/workos/role_updated_data.rbi +1 -46
  130. data/rbi/workos/send_verification_email_response.rbi +1 -16
  131. data/rbi/workos/session_created_data_impersonator.rbi +1 -22
  132. data/rbi/workos/session_revoked_data_impersonator.rbi +1 -22
  133. data/rbi/workos/slim_role.rbi +1 -16
  134. data/rbi/workos/sso.rbi +2 -1
  135. 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
  136. data/rbi/workos/sso_token_response_oauth_token.rbi +1 -40
  137. data/rbi/workos/update_group.rbi +1 -22
  138. data/rbi/workos/update_organization_role.rbi +1 -22
  139. data/rbi/workos/update_role.rbi +1 -22
  140. data/rbi/workos/user.rbi +1 -94
  141. data/rbi/workos/user_api_key_owner.rbi +1 -28
  142. data/rbi/workos/user_api_key_revoked_data_owner.rbi +1 -28
  143. data/rbi/workos/user_api_key_updated_data_owner.rbi +1 -28
  144. data/rbi/workos/user_api_key_with_value_owner.rbi +1 -28
  145. data/rbi/workos/user_role_assignment_resource.rbi +1 -28
  146. data/rbi/workos/user_role_assignment_source_group.rbi +1 -22
  147. data/rbi/workos/user_sessions_impersonator.rbi +1 -22
  148. data/rbi/workos/verify_email_address.rbi +1 -16
  149. data/rbi/workos/verify_email_response.rbi +1 -16
  150. data/rbi/workos/waitlist_list_response_list_metadata.rbi +1 -22
  151. data/rbi/workos/widget_session_token_response.rbi +1 -16
  152. data/test/workos/test_directory_sync.rb +32 -0
  153. data/test/workos/test_directory_sync_model_round_trip.rb +11 -11
  154. data/test/workos/test_pipes_model_round_trip.rb +7 -1
  155. data/test/workos/test_session.rb +46 -1
  156. data/test/workos/test_shared_model_round_trip.rb +71 -69
  157. data/test/workos/test_user_management_model_round_trip.rb +18 -9
  158. metadata +7 -3
data/rbi/workos/user.rbi CHANGED
@@ -5,98 +5,5 @@
5
5
  # typed: strong
6
6
 
7
7
  module WorkOS
8
- class User
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
- class UserApiKeyOwner
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
- class UserApiKeyRevokedDataOwner
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
- class UserApiKeyUpdatedDataOwner
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
- class UserApiKeyWithValueOwner
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
- class UserRoleAssignmentResource
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
- class UserRoleAssignmentSourceGroup
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
- class UserSessionsImpersonator
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
- class VerifyEmailAddress
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
- class VerifyEmailResponse
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
- class WaitlistListResponseListMetadata
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
- class WidgetSessionTokenResponse
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 test_directory_user_with_groups_round_trip
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::DirectoryUserWithGroups.new(fixture.to_json)
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 test_directory_user_round_trip
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::DirectoryUser.new(fixture.to_json)
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 test_directory_user_email_round_trip
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::DirectoryUserEmail.new(fixture.to_json)
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 test_directory_user_with_groups_email_round_trip
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::DirectoryUserWithGroupsEmail.new(fixture.to_json)
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" => "oauth",
294
+ "auth_method" => "stub",
289
295
  "value" => "stub",
290
296
  "expires_at" => nil,
291
297
  "scopes" => [],
@@ -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)