workos 10.3.0 → 10.5.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 (210) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +2 -2
  3. data/.github/workflows/docs.yml +4 -4
  4. data/.github/workflows/lint.yml +2 -2
  5. data/.github/workflows/release-please.yml +3 -3
  6. data/.github/workflows/release.yml +2 -2
  7. data/.last-synced-sha +1 -1
  8. data/.oagen-manifest.json +326 -158
  9. data/.release-please-manifest.json +1 -1
  10. data/.ruby-version +1 -1
  11. data/CHANGELOG.md +388 -0
  12. data/Gemfile.lock +14 -14
  13. data/README.md +23 -0
  14. data/lib/workos/admin_portal/generate_link.rb +3 -0
  15. data/lib/workos/admin_portal/revoke_link.rb +22 -0
  16. data/lib/workos/admin_portal.rb +29 -2
  17. data/lib/workos/agents/agent_blueprint.rb +3 -0
  18. data/lib/workos/agents/agent_blueprint_invocable_as.rb +18 -0
  19. data/lib/workos/agents/agent_blueprints_create_request.rb +3 -0
  20. data/lib/workos/agents/agent_blueprints_create_request_invocable_as.rb +18 -0
  21. data/lib/workos/agents/agent_blueprints_update_request.rb +3 -0
  22. data/lib/workos/agents/agent_blueprints_update_request_invocable_as.rb +18 -0
  23. data/lib/workos/agents/agent_registration.rb +3 -0
  24. data/lib/workos/agents.rb +30 -1
  25. data/lib/workos/api_keys/validate_api_key.rb +12 -1
  26. data/lib/workos/authorization/user_role_assignment_source.rb +5 -2
  27. data/lib/workos/authorization/user_role_assignment_source_group.rb +7 -0
  28. data/lib/workos/base_client.rb +6 -2
  29. data/lib/workos/configuration.rb +3 -2
  30. data/lib/workos/directory_sync/directory_sync_rate_limit_error.rb +25 -0
  31. data/lib/workos/directory_sync/directory_sync_response.rb +18 -0
  32. data/lib/workos/directory_sync.rb +19 -0
  33. data/lib/workos/feature_flags/flag_updated_context_previous_attribute_data.rb +3 -0
  34. data/lib/workos/feature_flags/flag_updated_context_previous_attribute_data_owner.rb +7 -0
  35. data/lib/workos/inflections.rb +2 -0
  36. data/lib/workos/multi_factor_auth.rb +1 -1
  37. data/lib/workos/pipes/add_data_integrations_get_data_integration_authorize_url_request.rb +37 -0
  38. data/lib/workos/pipes/connected_account.rb +15 -0
  39. data/lib/workos/pipes/connected_account_input.rb +6 -0
  40. data/lib/workos/pipes/connected_account_write_response.rb +73 -0
  41. data/lib/workos/pipes/connected_account_write_response_warning.rb +22 -0
  42. data/lib/workos/pipes/create_connected_account.rb +40 -0
  43. data/lib/workos/pipes/create_data_integration.rb +3 -0
  44. data/lib/workos/pipes/create_organization_connected_account.rb +43 -0
  45. data/lib/workos/pipes/data_integration.rb +3 -0
  46. data/lib/workos/pipes/data_integration_credentials_response.rb +1 -1
  47. data/lib/workos/pipes/data_integration_installation.rb +9 -0
  48. data/lib/workos/pipes/{data_integration_credentials_response_credential.rb → data_integration_vended_credential.rb} +9 -3
  49. data/lib/workos/pipes/data_integrations_create_api_key_connection_request.rb +37 -0
  50. data/lib/workos/pipes/data_integrations_create_client_credentials_connection_request.rb +43 -0
  51. data/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb +6 -0
  52. data/lib/workos/pipes/data_integrations_get_user_token_request.rb +11 -2
  53. data/lib/workos/pipes/data_integrations_list_response_data.rb +18 -3
  54. data/lib/workos/pipes/data_integrations_list_response_data_connected_account.rb +15 -0
  55. data/lib/workos/pipes/data_integrations_upsert_api_key_request.rb +28 -1
  56. data/lib/workos/pipes/data_integrations_upsert_api_key_request_2.rb +37 -0
  57. data/lib/workos/pipes/data_integrations_upsert_client_credentials_request.rb +9 -0
  58. data/lib/workos/pipes/data_integrations_upsert_client_credentials_request_2.rb +43 -0
  59. data/lib/workos/pipes/data_integrations_vend_credentials_request.rb +11 -2
  60. data/lib/workos/pipes/organization_connected_account.rb +40 -0
  61. data/lib/workos/pipes/reauthorize_data_integrations_get_data_integration_authorize_url_request.rb +40 -0
  62. data/lib/workos/pipes/reauthorize_data_integrations_upsert_api_key_request.rb +40 -0
  63. data/lib/workos/pipes/reauthorize_data_integrations_upsert_client_credentials_request.rb +46 -0
  64. data/lib/workos/pipes.rb +498 -30
  65. data/lib/workos/session_manager.rb +11 -6
  66. data/lib/workos/shared/account_selection_required_error.rb +22 -0
  67. data/lib/workos/shared/agent_blueprint_created_data.rb +3 -0
  68. data/lib/workos/shared/agent_blueprint_created_data_invocable_as.rb +18 -0
  69. data/lib/workos/shared/agent_blueprint_updated_data.rb +40 -1
  70. data/lib/workos/shared/agent_blueprint_updated_data_invocable_as.rb +18 -0
  71. data/lib/workos/shared/pipe_connected_account.rb +21 -0
  72. data/lib/workos/shared/pipes_account_connection_add_failed.rb +34 -0
  73. data/lib/workos/shared/pipes_account_connection_add_failed_data.rb +49 -0
  74. data/lib/workos/shared/pipes_account_connection_connected.rb +34 -0
  75. data/lib/workos/shared/pipes_account_connection_connection_failed.rb +34 -0
  76. data/lib/workos/shared/pipes_account_connection_connection_failed_data.rb +7 -0
  77. data/lib/workos/shared/pipes_account_connection_disconnected.rb +34 -0
  78. data/lib/workos/shared/pipes_account_connection_reauthorization_needed.rb +34 -0
  79. data/lib/workos/shared/pipes_connected_account_connection_failed_data.rb +1 -40
  80. data/lib/workos/sso/token_query.rb +3 -0
  81. data/lib/workos/sso.rb +3 -0
  82. data/lib/workos/types/add_data_integrations_get_data_integration_authorize_url_request_connection_owner.rb +13 -0
  83. data/lib/workos/types/agent_blueprint_created_data_invocable_as_instance_types.rb +13 -0
  84. data/lib/workos/types/agent_blueprint_invocable_as_instance_types.rb +9 -0
  85. data/lib/workos/types/agent_blueprint_updated_data_invocable_as_instance_types.rb +9 -0
  86. data/lib/workos/types/agent_blueprints_create_request_invocable_as_instance_types.rb +9 -0
  87. data/lib/workos/types/agent_blueprints_update_request_invocable_as_instance_types.rb +9 -0
  88. data/lib/workos/types/agent_instance_created_data_type.rb +1 -5
  89. data/lib/workos/types/agent_instance_deleted_data_type.rb +1 -1
  90. data/lib/workos/types/agent_instance_type.rb +1 -1
  91. data/lib/workos/types/connected_account_connection_role.rb +13 -0
  92. data/lib/workos/types/connected_account_write_response_auth_method.rb +9 -0
  93. data/lib/workos/types/connected_account_write_response_connection_role.rb +9 -0
  94. data/lib/workos/types/connected_account_write_response_state.rb +9 -0
  95. data/lib/workos/types/create_connected_account_state.rb +9 -0
  96. data/lib/workos/types/create_data_integration_ownership.rb +9 -0
  97. data/lib/workos/types/create_organization_connected_account_state.rb +9 -0
  98. data/lib/workos/types/create_webhook_endpoint_events.rb +6 -1
  99. data/lib/workos/types/data_integration_installation_connection_role.rb +9 -0
  100. data/lib/workos/types/data_integration_ownership.rb +9 -0
  101. data/lib/workos/types/data_integrations_create_api_key_connection_request_connection_owner.rb +9 -0
  102. data/lib/workos/types/data_integrations_create_client_credentials_connection_request_connection_owner.rb +9 -0
  103. data/lib/workos/types/data_integrations_get_data_integration_authorize_url_request_connection_owner.rb +9 -0
  104. data/lib/workos/types/data_integrations_get_user_token_request_connection_owner.rb +9 -0
  105. data/lib/workos/types/data_integrations_list_response_data_connected_account_connection_role.rb +9 -0
  106. data/lib/workos/types/data_integrations_list_response_data_connection_owner.rb +9 -0
  107. data/lib/workos/types/data_integrations_upsert_api_key_request_2_connection_owner.rb +9 -0
  108. data/lib/workos/types/data_integrations_upsert_api_key_request_connection_owner.rb +9 -0
  109. data/lib/workos/types/data_integrations_upsert_client_credentials_request_2_connection_owner.rb +9 -0
  110. data/lib/workos/types/data_integrations_upsert_client_credentials_request_connection_owner.rb +9 -0
  111. data/lib/workos/types/data_integrations_vend_credentials_request_connection_owner.rb +9 -0
  112. data/lib/workos/types/organization_connected_account_state.rb +9 -0
  113. data/lib/workos/types/pipe_connected_account_auth_method.rb +9 -0
  114. data/lib/workos/types/pipe_connected_account_connection_role.rb +9 -0
  115. data/lib/workos/types/pipes_ownership.rb +9 -0
  116. data/lib/workos/types/reauthorize_data_integrations_get_data_integration_authorize_url_request_connection_owner.rb +9 -0
  117. data/lib/workos/types/reauthorize_data_integrations_upsert_api_key_request_connection_owner.rb +9 -0
  118. data/lib/workos/types/reauthorize_data_integrations_upsert_client_credentials_request_connection_owner.rb +9 -0
  119. data/lib/workos/types/resource_export_completed_data_resource_type.rb +4 -1
  120. data/lib/workos/types/vault_dek_rekeyed_data_actor_source.rb +9 -0
  121. data/lib/workos/user_management/authkit_oauth_resource.rb +34 -0
  122. data/lib/workos/user_management/create_authkit_oauth_resource.rb +22 -0
  123. data/lib/workos/user_management.rb +88 -1
  124. data/lib/workos/vault/vault_dek_rekeyed.rb +34 -0
  125. data/lib/workos/vault/vault_dek_rekeyed_data.rb +31 -0
  126. data/lib/workos/version.rb +1 -1
  127. data/rbi/workos/account_selection_required_error.rbi +30 -0
  128. data/rbi/workos/add_data_integrations_get_data_integration_authorize_url_request.rbi +60 -0
  129. data/rbi/workos/admin_portal.rbi +11 -1
  130. data/rbi/workos/agent_blueprint.rbi +6 -0
  131. data/rbi/workos/agent_blueprint_created_data.rbi +6 -0
  132. data/rbi/workos/agent_blueprint_created_data_invocable_as.rbi +24 -0
  133. data/rbi/workos/agent_blueprint_invocable_as.rbi +24 -0
  134. data/rbi/workos/agent_blueprint_updated_data.rbi +6 -0
  135. data/rbi/workos/agent_blueprint_updated_data_invocable_as.rbi +24 -0
  136. data/rbi/workos/agent_blueprints_create_request.rbi +6 -0
  137. data/rbi/workos/agent_blueprints_create_request_invocable_as.rbi +24 -0
  138. data/rbi/workos/agent_blueprints_update_request.rbi +6 -0
  139. data/rbi/workos/agent_blueprints_update_request_invocable_as.rbi +24 -0
  140. data/rbi/workos/agent_registration.rbi +6 -0
  141. data/rbi/workos/agents.rbi +14 -3
  142. data/rbi/workos/authkit_oauth_resource.rbi +54 -0
  143. data/rbi/workos/connected_account.rbi +30 -0
  144. data/rbi/workos/connected_account_input.rbi +12 -0
  145. data/rbi/workos/connected_account_write_response.rbi +132 -0
  146. data/rbi/workos/connected_account_write_response_warning.rbi +30 -0
  147. data/rbi/workos/create_authkit_oauth_resource.rbi +30 -0
  148. data/rbi/workos/create_connected_account.rbi +66 -0
  149. data/rbi/workos/create_data_integration.rbi +6 -0
  150. data/rbi/workos/create_organization_connected_account.rbi +72 -0
  151. data/rbi/workos/data_integration.rbi +6 -0
  152. data/rbi/workos/data_integration_credentials_response.rbi +2 -2
  153. data/rbi/workos/data_integration_installation.rbi +19 -1
  154. data/rbi/workos/data_integration_vended_credential.rbi +66 -0
  155. data/rbi/workos/data_integrations_create_api_key_connection_request.rbi +60 -0
  156. data/rbi/workos/data_integrations_create_client_credentials_connection_request.rbi +72 -0
  157. data/rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi +12 -0
  158. data/rbi/workos/data_integrations_get_user_token_request.rbi +18 -0
  159. data/rbi/workos/data_integrations_list_response_data.rbi +12 -0
  160. data/rbi/workos/data_integrations_list_response_data_connected_account.rbi +30 -0
  161. data/rbi/workos/data_integrations_upsert_api_key_request.rbi +18 -0
  162. data/rbi/workos/data_integrations_upsert_api_key_request_2.rbi +60 -0
  163. data/rbi/workos/data_integrations_upsert_client_credentials_request.rbi +18 -0
  164. data/rbi/workos/data_integrations_upsert_client_credentials_request_2.rbi +72 -0
  165. data/rbi/workos/data_integrations_vend_credentials_request.rbi +18 -0
  166. data/rbi/workos/directory_sync.rbi +8 -0
  167. data/rbi/workos/directory_sync_rate_limit_error.rbi +36 -0
  168. data/rbi/workos/directory_sync_response.rbi +24 -0
  169. data/rbi/workos/flag_updated_context_previous_attribute_data.rbi +6 -0
  170. data/rbi/workos/flag_updated_context_previous_attribute_data_owner.rbi +36 -0
  171. data/rbi/workos/generate_link.rbi +6 -0
  172. data/rbi/workos/organization_connected_account.rbi +66 -0
  173. data/rbi/workos/pipe_connected_account.rbi +42 -0
  174. data/rbi/workos/pipes.rbi +176 -16
  175. data/rbi/workos/pipes_account_connection_add_failed.rbi +54 -0
  176. data/rbi/workos/pipes_account_connection_add_failed_data.rbi +84 -0
  177. data/rbi/workos/pipes_account_connection_connected.rbi +54 -0
  178. data/rbi/workos/pipes_account_connection_connection_failed.rbi +54 -0
  179. data/rbi/workos/pipes_account_connection_connection_failed_data.rbi +84 -0
  180. data/rbi/workos/pipes_account_connection_disconnected.rbi +54 -0
  181. data/rbi/workos/pipes_account_connection_reauthorization_needed.rbi +54 -0
  182. data/rbi/workos/pipes_connected_account_connection_failed_data.rbi +6 -0
  183. data/rbi/workos/reauthorize_data_integrations_get_data_integration_authorize_url_request.rbi +66 -0
  184. data/rbi/workos/reauthorize_data_integrations_upsert_api_key_request.rbi +66 -0
  185. data/rbi/workos/reauthorize_data_integrations_upsert_client_credentials_request.rbi +78 -0
  186. data/rbi/workos/revoke_link.rbi +30 -0
  187. data/rbi/workos/sso.rbi +2 -1
  188. data/rbi/workos/token_query.rbi +6 -0
  189. data/rbi/workos/user_management.rbi +28 -0
  190. data/rbi/workos/user_role_assignment_source.rbi +6 -0
  191. data/rbi/workos/user_role_assignment_source_group.rbi +30 -0
  192. data/rbi/workos/vault_dek_rekeyed.rbi +54 -0
  193. data/rbi/workos/{data_integration_credentials_response_credential.rbi → vault_dek_rekeyed_data.rbi} +13 -19
  194. data/test/workos/test_admin_portal.rb +9 -1
  195. data/test/workos/test_admin_portal_model_round_trip.rb +14 -0
  196. data/test/workos/test_agents.rb +8 -0
  197. data/test/workos/test_agents_model_round_trip.rb +35 -0
  198. data/test/workos/test_authorization_model_round_trip.rb +15 -1
  199. data/test/workos/test_directory_sync.rb +8 -0
  200. data/test/workos/test_directory_sync_model_round_trip.rb +24 -0
  201. data/test/workos/test_feature_flags_model_round_trip.rb +16 -0
  202. data/test/workos/test_pipes.rb +80 -0
  203. data/test/workos/test_pipes_model_round_trip.rb +317 -18
  204. data/test/workos/test_session.rb +63 -0
  205. data/test/workos/test_shared_model_round_trip.rb +185 -0
  206. data/test/workos/test_sso_model_round_trip.rb +1 -0
  207. data/test/workos/test_user_management.rb +24 -0
  208. data/test/workos/test_user_management_model_round_trip.rb +32 -0
  209. data/test/workos/test_vault_model_round_trip.rb +33 -0
  210. metadata +107 -3
@@ -174,7 +174,10 @@ module WorkOS
174
174
  # Verify an access-token JWT against the WorkOS JWKS for this client.
175
175
  # Used by Session#authenticate; exposed publicly for advanced cases.
176
176
  #
177
- # NOTE on iss/aud/required_claims: this method intentionally does not
177
+ # The `iss` claim is only checked when the client was built with
178
+ # `jwt_issuer:` (a String or an Array of accepted issuers).
179
+ #
180
+ # NOTE on iss/aud/required_claims: by default this method does not
178
181
  # enforce iss, aud, or required_claims. workos-node's `jose` call and
179
182
  # workos-php's `isset($exp) && $exp < time()` accept exp-less tokens, and
180
183
  # cross-SDK parity is required for the planned coordinated hardening of
@@ -182,15 +185,17 @@ module WorkOS
182
185
  # required_claims: ['exp'] tightening that was considered here.
183
186
  def decode_jwt(access_token, verify_expiration: true)
184
187
  jwks = fetch_jwks
185
- JWT.decode(
186
- access_token,
187
- nil,
188
- true,
188
+ options = {
189
189
  algorithms: JWK_ALGORITHMS,
190
190
  jwks: jwks,
191
191
  verify_aud: false,
192
192
  verify_expiration: verify_expiration
193
- ).first
193
+ }
194
+ unless client.jwt_issuer.nil?
195
+ options[:iss] = client.jwt_issuer
196
+ options[:verify_iss] = true
197
+ end
198
+ JWT.decode(access_token, nil, true, options).first
194
199
  end
195
200
 
196
201
  private
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class AccountSelectionRequiredError < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ code: :code,
9
+ message: :message
10
+ }.freeze
11
+
12
+ attr_accessor \
13
+ :code,
14
+ :message
15
+
16
+ def initialize(json)
17
+ hash = self.class.normalize(json)
18
+ @code = hash[:code]
19
+ @message = hash[:message]
20
+ end
21
+ end
22
+ end
@@ -11,6 +11,7 @@ module WorkOS
11
11
  description: :description,
12
12
  permissions: :permissions,
13
13
  invocable_by: :invocable_by,
14
+ invocable_as: :invocable_as,
14
15
  session_settings: :session_settings,
15
16
  created_at: :created_at,
16
17
  updated_at: :updated_at
@@ -23,6 +24,7 @@ module WorkOS
23
24
  :description,
24
25
  :permissions,
25
26
  :invocable_by,
27
+ :invocable_as,
26
28
  :session_settings,
27
29
  :created_at,
28
30
  :updated_at
@@ -35,6 +37,7 @@ module WorkOS
35
37
  @description = hash[:description]
36
38
  @permissions = hash[:permissions] || []
37
39
  @invocable_by = hash[:invocable_by] ? WorkOS::AgentBlueprintCreatedDataInvocableBy.new(hash[:invocable_by]) : nil
40
+ @invocable_as = hash[:invocable_as] ? WorkOS::AgentBlueprintCreatedDataInvocableAs.new(hash[:invocable_as]) : nil
38
41
  @session_settings = hash[:session_settings] ? WorkOS::AgentBlueprintCreatedDataSessionSetting.new(hash[:session_settings]) : nil
39
42
  @created_at = hash[:created_at]
40
43
  @updated_at = hash[:updated_at]
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class AgentBlueprintCreatedDataInvocableAs < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ instance_types: :instance_types
9
+ }.freeze
10
+
11
+ attr_accessor :instance_types
12
+
13
+ def initialize(json)
14
+ hash = self.class.normalize(json)
15
+ @instance_types = hash[:instance_types] || []
16
+ end
17
+ end
18
+ end
@@ -3,5 +3,44 @@
3
3
  # This file is auto-generated by oagen. Do not edit.
4
4
 
5
5
  module WorkOS
6
- AgentBlueprintUpdatedData = AgentBlueprintCreatedData
6
+ class AgentBlueprintUpdatedData < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ object: :object,
9
+ id: :id,
10
+ name: :name,
11
+ description: :description,
12
+ permissions: :permissions,
13
+ invocable_by: :invocable_by,
14
+ invocable_as: :invocable_as,
15
+ session_settings: :session_settings,
16
+ created_at: :created_at,
17
+ updated_at: :updated_at
18
+ }.freeze
19
+
20
+ attr_accessor \
21
+ :object,
22
+ :id,
23
+ :name,
24
+ :description,
25
+ :permissions,
26
+ :invocable_by,
27
+ :invocable_as,
28
+ :session_settings,
29
+ :created_at,
30
+ :updated_at
31
+
32
+ def initialize(json)
33
+ hash = self.class.normalize(json)
34
+ @object = hash[:object]
35
+ @id = hash[:id]
36
+ @name = hash[:name]
37
+ @description = hash[:description]
38
+ @permissions = hash[:permissions] || []
39
+ @invocable_by = hash[:invocable_by] ? WorkOS::AgentBlueprintUpdatedDataInvocableBy.new(hash[:invocable_by]) : nil
40
+ @invocable_as = hash[:invocable_as] ? WorkOS::AgentBlueprintUpdatedDataInvocableAs.new(hash[:invocable_as]) : nil
41
+ @session_settings = hash[:session_settings] ? WorkOS::AgentBlueprintUpdatedDataSessionSetting.new(hash[:session_settings]) : nil
42
+ @created_at = hash[:created_at]
43
+ @updated_at = hash[:updated_at]
44
+ end
45
+ end
7
46
  end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class AgentBlueprintUpdatedDataInvocableAs < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ instance_types: :instance_types
9
+ }.freeze
10
+
11
+ attr_accessor :instance_types
12
+
13
+ def initialize(json)
14
+ hash = self.class.normalize(json)
15
+ @instance_types = hash[:instance_types] || []
16
+ end
17
+ end
18
+ end
@@ -7,12 +7,19 @@ module WorkOS
7
7
  HASH_ATTRS = {
8
8
  object: :object,
9
9
  id: :id,
10
+ connection_role: :connection_role,
11
+ account_identifier: :account_identifier,
12
+ account_display_name: :account_display_name,
10
13
  data_integration_id: :data_integration_id,
11
14
  provider_slug: :provider_slug,
12
15
  user_id: :user_id,
13
16
  organization_id: :organization_id,
14
17
  scopes: :scopes,
18
+ auth_method: :auth_method,
19
+ api_key_last_4: :api_key_last_4,
15
20
  state: :state,
21
+ established_by_user_id: :established_by_user_id,
22
+ state_reason: :state_reason,
16
23
  created_at: :created_at,
17
24
  updated_at: :updated_at
18
25
  }.freeze
@@ -20,12 +27,19 @@ module WorkOS
20
27
  attr_accessor \
21
28
  :object,
22
29
  :id,
30
+ :connection_role,
31
+ :account_identifier,
32
+ :account_display_name,
23
33
  :data_integration_id,
24
34
  :provider_slug,
25
35
  :user_id,
26
36
  :organization_id,
27
37
  :scopes,
38
+ :auth_method,
39
+ :api_key_last_4,
28
40
  :state,
41
+ :established_by_user_id,
42
+ :state_reason,
29
43
  :created_at,
30
44
  :updated_at
31
45
 
@@ -33,12 +47,19 @@ module WorkOS
33
47
  hash = self.class.normalize(json)
34
48
  @object = hash[:object]
35
49
  @id = hash[:id]
50
+ @connection_role = hash[:connection_role]
51
+ @account_identifier = hash[:account_identifier]
52
+ @account_display_name = hash[:account_display_name]
36
53
  @data_integration_id = hash[:data_integration_id]
37
54
  @provider_slug = hash[:provider_slug]
38
55
  @user_id = hash[:user_id]
39
56
  @organization_id = hash[:organization_id]
40
57
  @scopes = hash[:scopes] || []
58
+ @auth_method = hash[:auth_method]
59
+ @api_key_last_4 = hash[:api_key_last_4]
41
60
  @state = hash[:state]
61
+ @established_by_user_id = hash[:established_by_user_id]
62
+ @state_reason = hash[:state_reason]
42
63
  @created_at = hash[:created_at]
43
64
  @updated_at = hash[:updated_at]
44
65
  end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class PipesAccountConnectionAddFailed < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ object: :object,
9
+ id: :id,
10
+ event: :event,
11
+ data: :data,
12
+ created_at: :created_at,
13
+ context: :context
14
+ }.freeze
15
+
16
+ attr_accessor \
17
+ :object,
18
+ :id,
19
+ :event,
20
+ :data,
21
+ :created_at,
22
+ :context
23
+
24
+ def initialize(json)
25
+ hash = self.class.normalize(json)
26
+ @object = hash[:object]
27
+ @id = hash[:id]
28
+ @event = hash[:event]
29
+ @data = hash[:data] ? WorkOS::PipesAccountConnectionAddFailedData.new(hash[:data]) : nil
30
+ @created_at = hash[:created_at]
31
+ @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class PipesAccountConnectionAddFailedData < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ object: :object,
9
+ data_integration_id: :data_integration_id,
10
+ provider_slug: :provider_slug,
11
+ user_id: :user_id,
12
+ organization_id: :organization_id,
13
+ account_identifier: :account_identifier,
14
+ error_code: :error_code,
15
+ error_reason: :error_reason,
16
+ provider_error: :provider_error,
17
+ provider_error_description: :provider_error_description,
18
+ created_at: :created_at
19
+ }.freeze
20
+
21
+ attr_accessor \
22
+ :object,
23
+ :data_integration_id,
24
+ :provider_slug,
25
+ :user_id,
26
+ :organization_id,
27
+ :account_identifier,
28
+ :error_code,
29
+ :error_reason,
30
+ :provider_error,
31
+ :provider_error_description,
32
+ :created_at
33
+
34
+ def initialize(json)
35
+ hash = self.class.normalize(json)
36
+ @object = hash[:object]
37
+ @data_integration_id = hash[:data_integration_id]
38
+ @provider_slug = hash[:provider_slug]
39
+ @user_id = hash[:user_id]
40
+ @organization_id = hash[:organization_id]
41
+ @account_identifier = hash[:account_identifier]
42
+ @error_code = hash[:error_code]
43
+ @error_reason = hash[:error_reason]
44
+ @provider_error = hash[:provider_error]
45
+ @provider_error_description = hash[:provider_error_description]
46
+ @created_at = hash[:created_at]
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class PipesAccountConnectionConnected < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ object: :object,
9
+ id: :id,
10
+ event: :event,
11
+ data: :data,
12
+ created_at: :created_at,
13
+ context: :context
14
+ }.freeze
15
+
16
+ attr_accessor \
17
+ :object,
18
+ :id,
19
+ :event,
20
+ :data,
21
+ :created_at,
22
+ :context
23
+
24
+ def initialize(json)
25
+ hash = self.class.normalize(json)
26
+ @object = hash[:object]
27
+ @id = hash[:id]
28
+ @event = hash[:event]
29
+ @data = hash[:data] ? WorkOS::PipeConnectedAccount.new(hash[:data]) : nil
30
+ @created_at = hash[:created_at]
31
+ @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class PipesAccountConnectionConnectionFailed < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ object: :object,
9
+ id: :id,
10
+ event: :event,
11
+ data: :data,
12
+ created_at: :created_at,
13
+ context: :context
14
+ }.freeze
15
+
16
+ attr_accessor \
17
+ :object,
18
+ :id,
19
+ :event,
20
+ :data,
21
+ :created_at,
22
+ :context
23
+
24
+ def initialize(json)
25
+ hash = self.class.normalize(json)
26
+ @object = hash[:object]
27
+ @id = hash[:id]
28
+ @event = hash[:event]
29
+ @data = hash[:data] ? WorkOS::PipesAccountConnectionConnectionFailedData.new(hash[:data]) : nil
30
+ @created_at = hash[:created_at]
31
+ @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ PipesAccountConnectionConnectionFailedData = PipesAccountConnectionAddFailedData
7
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class PipesAccountConnectionDisconnected < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ object: :object,
9
+ id: :id,
10
+ event: :event,
11
+ data: :data,
12
+ created_at: :created_at,
13
+ context: :context
14
+ }.freeze
15
+
16
+ attr_accessor \
17
+ :object,
18
+ :id,
19
+ :event,
20
+ :data,
21
+ :created_at,
22
+ :context
23
+
24
+ def initialize(json)
25
+ hash = self.class.normalize(json)
26
+ @object = hash[:object]
27
+ @id = hash[:id]
28
+ @event = hash[:event]
29
+ @data = hash[:data] ? WorkOS::PipeConnectedAccount.new(hash[:data]) : nil
30
+ @created_at = hash[:created_at]
31
+ @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class PipesAccountConnectionReauthorizationNeeded < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ object: :object,
9
+ id: :id,
10
+ event: :event,
11
+ data: :data,
12
+ created_at: :created_at,
13
+ context: :context
14
+ }.freeze
15
+
16
+ attr_accessor \
17
+ :object,
18
+ :id,
19
+ :event,
20
+ :data,
21
+ :created_at,
22
+ :context
23
+
24
+ def initialize(json)
25
+ hash = self.class.normalize(json)
26
+ @object = hash[:object]
27
+ @id = hash[:id]
28
+ @event = hash[:event]
29
+ @data = hash[:data] ? WorkOS::PipeConnectedAccount.new(hash[:data]) : nil
30
+ @created_at = hash[:created_at]
31
+ @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil
32
+ end
33
+ end
34
+ end
@@ -3,44 +3,5 @@
3
3
  # This file is auto-generated by oagen. Do not edit.
4
4
 
5
5
  module WorkOS
6
- class PipesConnectedAccountConnectionFailedData < WorkOS::Types::BaseModel
7
- HASH_ATTRS = {
8
- object: :object,
9
- data_integration_id: :data_integration_id,
10
- provider_slug: :provider_slug,
11
- user_id: :user_id,
12
- organization_id: :organization_id,
13
- error_code: :error_code,
14
- error_reason: :error_reason,
15
- provider_error: :provider_error,
16
- provider_error_description: :provider_error_description,
17
- created_at: :created_at
18
- }.freeze
19
-
20
- attr_accessor \
21
- :object,
22
- :data_integration_id,
23
- :provider_slug,
24
- :user_id,
25
- :organization_id,
26
- :error_code,
27
- :error_reason,
28
- :provider_error,
29
- :provider_error_description,
30
- :created_at
31
-
32
- def initialize(json)
33
- hash = self.class.normalize(json)
34
- @object = hash[:object]
35
- @data_integration_id = hash[:data_integration_id]
36
- @provider_slug = hash[:provider_slug]
37
- @user_id = hash[:user_id]
38
- @organization_id = hash[:organization_id]
39
- @error_code = hash[:error_code]
40
- @error_reason = hash[:error_reason]
41
- @provider_error = hash[:provider_error]
42
- @provider_error_description = hash[:provider_error_description]
43
- @created_at = hash[:created_at]
44
- end
45
- end
6
+ PipesConnectedAccountConnectionFailedData = PipesAccountConnectionAddFailedData
46
7
  end
@@ -9,6 +9,7 @@ module WorkOS
9
9
  client_secret: :client_secret,
10
10
  code: :code,
11
11
  grant_type: :grant_type,
12
+ code_verifier: :code_verifier,
12
13
  subject_token: :subject_token,
13
14
  subject_token_type: :subject_token_type,
14
15
  organization_id: :organization_id
@@ -19,6 +20,7 @@ module WorkOS
19
20
  :client_secret,
20
21
  :code,
21
22
  :grant_type,
23
+ :code_verifier,
22
24
  :subject_token,
23
25
  :subject_token_type,
24
26
  :organization_id
@@ -29,6 +31,7 @@ module WorkOS
29
31
  @client_secret = hash[:client_secret]
30
32
  @code = hash[:code]
31
33
  @grant_type = hash[:grant_type]
34
+ @code_verifier = hash[:code_verifier]
32
35
  @subject_token = hash[:subject_token]
33
36
  @subject_token_type = hash[:subject_token_type]
34
37
  @organization_id = hash[:organization_id]
data/lib/workos/sso.rb CHANGED
@@ -507,6 +507,7 @@ module WorkOS
507
507
 
508
508
  # Get a Profile and Token
509
509
  # @param code [String, nil] The authorization code received from the authorization callback. Required when `grant_type` is `authorization_code`.
510
+ # @param code_verifier [String, nil] The PKCE code verifier matching the `code_challenge` sent with the authorization request. Required when the authorization request included a `code_challenge`. Must be sent in the request body.
510
511
  # @param subject_token [String, nil] The OIDC ID token to exchange. Required when `grant_type` is `urn:ietf:params:oauth:grant-type:token-exchange`. Must be sent in the request body.
511
512
  # @param subject_token_type [String, nil] The type of the subject token. Required when `grant_type` is `urn:ietf:params:oauth:grant-type:token-exchange`. Must be sent in the request body.
512
513
  # @param organization_id [String, nil] The ID of the organization whose connection the subject token is validated against. Required when `grant_type` is `urn:ietf:params:oauth:grant-type:token-exchange`. Must be sent in the request body.
@@ -514,6 +515,7 @@ module WorkOS
514
515
  # @return [WorkOS::SSOTokenResponse]
515
516
  def get_profile_and_token(
516
517
  code: nil,
518
+ code_verifier: nil,
517
519
  subject_token: nil,
518
520
  subject_token_type: nil,
519
521
  organization_id: nil,
@@ -524,6 +526,7 @@ module WorkOS
524
526
  "client_id" => request_options[:client_id] || @client.client_id,
525
527
  "client_secret" => request_options[:api_key] || @client.api_key,
526
528
  "code" => code,
529
+ "code_verifier" => code_verifier,
527
530
  "subject_token" => subject_token,
528
531
  "subject_token_type" => subject_token_type,
529
532
  "organization_id" => organization_id
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ module Types
7
+ class AddDataIntegrationsGetDataIntegrationAuthorizeUrlRequestConnectionOwner
8
+ USER = "user"
9
+ ORGANIZATION = "organization"
10
+ ALL = [USER, ORGANIZATION].freeze
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ module Types
7
+ class AgentBlueprintCreatedDataInvocableAsInstanceTypes
8
+ DELEGATED = "delegated"
9
+ AUTONOMOUS = "autonomous"
10
+ ALL = [DELEGATED, AUTONOMOUS].freeze
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ module Types
7
+ AgentBlueprintInvocableAsInstanceTypes = AgentBlueprintCreatedDataInvocableAsInstanceTypes
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ module Types
7
+ AgentBlueprintUpdatedDataInvocableAsInstanceTypes = AgentBlueprintCreatedDataInvocableAsInstanceTypes
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ module Types
7
+ AgentBlueprintsCreateRequestInvocableAsInstanceTypes = AgentBlueprintCreatedDataInvocableAsInstanceTypes
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ module Types
7
+ AgentBlueprintsUpdateRequestInvocableAsInstanceTypes = AgentBlueprintCreatedDataInvocableAsInstanceTypes
8
+ end
9
+ end
@@ -4,10 +4,6 @@
4
4
 
5
5
  module WorkOS
6
6
  module Types
7
- class AgentInstanceCreatedDataType
8
- DELEGATED = "delegated"
9
- AUTONOMOUS = "autonomous"
10
- ALL = [DELEGATED, AUTONOMOUS].freeze
11
- end
7
+ AgentInstanceCreatedDataType = AgentBlueprintCreatedDataInvocableAsInstanceTypes
12
8
  end
13
9
  end
@@ -4,6 +4,6 @@
4
4
 
5
5
  module WorkOS
6
6
  module Types
7
- AgentInstanceDeletedDataType = AgentInstanceCreatedDataType
7
+ AgentInstanceDeletedDataType = AgentBlueprintCreatedDataInvocableAsInstanceTypes
8
8
  end
9
9
  end
@@ -4,6 +4,6 @@
4
4
 
5
5
  module WorkOS
6
6
  module Types
7
- AgentInstanceType = AgentInstanceCreatedDataType
7
+ AgentInstanceType = AgentBlueprintCreatedDataInvocableAsInstanceTypes
8
8
  end
9
9
  end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ module Types
7
+ class ConnectedAccountConnectionRole
8
+ COMPATIBILITY = "compatibility"
9
+ STANDARD = "standard"
10
+ ALL = [COMPATIBILITY, STANDARD].freeze
11
+ end
12
+ end
13
+ end