workos 10.2.1 → 10.4.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 (292) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +2 -2
  3. data/.github/workflows/docs.yml +3 -3
  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 +393 -4
  9. data/.release-please-manifest.json +1 -1
  10. data/.ruby-version +1 -1
  11. data/CHANGELOG.md +328 -0
  12. data/Gemfile.lock +14 -14
  13. data/README.md +23 -0
  14. data/lib/workos/admin_portal.rb +2 -2
  15. data/lib/workos/agents/agent_blueprint.rb +43 -0
  16. data/lib/workos/agents/agent_blueprint_invocable_by.rb +7 -0
  17. data/lib/workos/agents/agent_blueprint_session_setting.rb +25 -0
  18. data/lib/workos/agents/agent_blueprints_create_request.rb +31 -0
  19. data/lib/workos/agents/agent_blueprints_create_request_invocable_by.rb +22 -0
  20. data/lib/workos/agents/agent_blueprints_create_request_session_setting.rb +7 -0
  21. data/lib/workos/agents/agent_blueprints_token_mint_token_request.rb +34 -0
  22. data/lib/workos/agents/agent_blueprints_token_validate_token_request.rb +18 -0
  23. data/lib/workos/agents/agent_blueprints_update_request.rb +31 -0
  24. data/lib/workos/agents/agent_blueprints_update_request_invocable_by.rb +7 -0
  25. data/lib/workos/agents/agent_blueprints_update_request_session_setting.rb +25 -0
  26. data/lib/workos/agents/agent_instance.rb +40 -0
  27. data/lib/workos/agents/agent_instance_session.rb +40 -0
  28. data/lib/workos/agents/agent_token.rb +40 -0
  29. data/lib/workos/agents/agent_token_validation.rb +40 -0
  30. data/lib/workos/agents.rb +399 -0
  31. data/lib/workos/audit_logs.rb +23 -5
  32. data/lib/workos/authorization.rb +3 -3
  33. data/lib/workos/base_client.rb +6 -2
  34. data/lib/workos/client.rb +4 -0
  35. data/lib/workos/configuration.rb +3 -2
  36. data/lib/workos/inflections.rb +17 -0
  37. data/lib/workos/multi_factor_auth.rb +1 -1
  38. data/lib/workos/organizations/create_it_contact.rb +18 -0
  39. data/lib/workos/organizations/invite_it_contact.rb +18 -0
  40. data/lib/workos/organizations/it_contact.rb +31 -0
  41. data/lib/workos/organizations/it_contact_list.rb +25 -0
  42. data/lib/workos/organizations/organization_input.rb +10 -1
  43. data/lib/workos/organizations/update_audit_logs_retention.rb +13 -1
  44. data/lib/workos/organizations.rb +110 -1
  45. data/lib/workos/pipes/connected_account.rb +9 -0
  46. data/lib/workos/pipes/create_data_integration.rb +3 -0
  47. data/lib/workos/pipes/data_integration.rb +3 -0
  48. data/lib/workos/pipes/data_integration_installation.rb +9 -0
  49. data/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb +3 -0
  50. data/lib/workos/pipes/data_integrations_get_user_token_request.rb +11 -2
  51. data/lib/workos/pipes/data_integrations_list_response_data.rb +18 -3
  52. data/lib/workos/pipes/data_integrations_list_response_data_connected_account.rb +9 -0
  53. data/lib/workos/pipes/data_integrations_upsert_api_key_request.rb +25 -1
  54. data/lib/workos/pipes/data_integrations_upsert_client_credentials_request.rb +6 -0
  55. data/lib/workos/pipes/data_integrations_vend_credentials_request.rb +11 -2
  56. data/lib/workos/pipes.rb +324 -17
  57. data/lib/workos/platform_teams/create_team.rb +22 -0
  58. data/lib/workos/platform_teams/team.rb +37 -0
  59. data/lib/workos/platform_teams.rb +58 -0
  60. data/lib/workos/session_manager.rb +11 -6
  61. data/lib/workos/shared/account_selection_required_error.rb +22 -0
  62. data/lib/workos/shared/agent_blueprint_created.rb +34 -0
  63. data/lib/workos/shared/agent_blueprint_created_data.rb +43 -0
  64. data/lib/workos/shared/agent_blueprint_created_data_invocable_by.rb +22 -0
  65. data/lib/workos/shared/agent_blueprint_created_data_session_setting.rb +25 -0
  66. data/lib/workos/shared/agent_blueprint_deleted.rb +34 -0
  67. data/lib/workos/shared/agent_blueprint_deleted_data.rb +31 -0
  68. data/lib/workos/shared/agent_blueprint_updated.rb +34 -0
  69. data/lib/workos/shared/agent_blueprint_updated_data.rb +7 -0
  70. data/lib/workos/shared/agent_blueprint_updated_data_invocable_by.rb +7 -0
  71. data/lib/workos/shared/agent_blueprint_updated_data_session_setting.rb +7 -0
  72. data/lib/workos/shared/agent_instance_created.rb +34 -0
  73. data/lib/workos/shared/agent_instance_created_data.rb +40 -0
  74. data/lib/workos/shared/agent_instance_deleted.rb +34 -0
  75. data/lib/workos/shared/agent_instance_deleted_data.rb +40 -0
  76. data/lib/workos/shared/agent_instance_session_created.rb +34 -0
  77. data/lib/workos/shared/agent_instance_session_created_data.rb +43 -0
  78. data/lib/workos/shared/agent_instance_session_revoked.rb +34 -0
  79. data/lib/workos/shared/agent_instance_session_revoked_data.rb +40 -0
  80. data/lib/workos/shared/pipe_connected_account.rb +15 -0
  81. data/lib/workos/shared/pipes_account_connection_add_failed.rb +34 -0
  82. data/lib/workos/shared/pipes_account_connection_add_failed_data.rb +49 -0
  83. data/lib/workos/shared/pipes_account_connection_connected.rb +34 -0
  84. data/lib/workos/shared/pipes_account_connection_connection_failed.rb +34 -0
  85. data/lib/workos/shared/pipes_account_connection_connection_failed_data.rb +7 -0
  86. data/lib/workos/shared/pipes_account_connection_disconnected.rb +34 -0
  87. data/lib/workos/shared/pipes_account_connection_reauthorization_needed.rb +34 -0
  88. data/lib/workos/shared/pipes_connected_account_connection_failed_data.rb +1 -40
  89. data/lib/workos/shared/resource_export_completed.rb +34 -0
  90. data/lib/workos/shared/resource_export_completed_data.rb +22 -0
  91. data/lib/workos/shared/resource_export_created.rb +34 -0
  92. data/lib/workos/shared/resource_export_created_data.rb +22 -0
  93. data/lib/workos/shared/resource_export_downloaded.rb +34 -0
  94. data/lib/workos/shared/resource_export_downloaded_data.rb +22 -0
  95. data/lib/workos/shared/resource_export_failed.rb +34 -0
  96. data/lib/workos/shared/resource_export_failed_data.rb +22 -0
  97. data/lib/workos/shared/waitlist_user.rb +8 -5
  98. data/lib/workos/sso/create_connection.rb +37 -0
  99. data/lib/workos/sso/create_connection_attribute_maps.rb +22 -0
  100. data/lib/workos/sso/create_connection_key_pair.rb +22 -0
  101. data/lib/workos/sso/create_connection_oidc_options.rb +43 -0
  102. data/lib/workos/sso/create_connection_saml_options.rb +40 -0
  103. data/lib/workos/sso/create_connection_standard_attributes.rb +34 -0
  104. data/lib/workos/sso/create_saml_idp_signing_certificate.rb +18 -0
  105. data/lib/workos/sso/patch_connection.rb +34 -0
  106. data/lib/workos/sso/patch_connection_attribute_maps.rb +22 -0
  107. data/lib/workos/sso/patch_connection_oidc_options.rb +40 -0
  108. data/lib/workos/sso/patch_connection_saml_options.rb +31 -0
  109. data/lib/workos/sso/patch_connection_standard_attributes.rb +7 -0
  110. data/lib/workos/sso/saml_idp_signing_certificate.rb +34 -0
  111. data/lib/workos/sso/saml_idp_signing_certificate_list.rb +22 -0
  112. data/lib/workos/sso/saml_sp_encryption_certificate.rb +34 -0
  113. data/lib/workos/sso/saml_sp_encryption_certificate_list.rb +22 -0
  114. data/lib/workos/sso/saml_sp_signing_certificate.rb +34 -0
  115. data/lib/workos/sso/token_query.rb +11 -2
  116. data/lib/workos/sso.rb +305 -4
  117. data/lib/workos/types/agent_blueprints_token_mint_token_request_type.rb +15 -0
  118. data/lib/workos/types/agent_instance_created_data_type.rb +13 -0
  119. data/lib/workos/types/agent_instance_deleted_data_type.rb +9 -0
  120. data/lib/workos/types/agent_instance_session_status.rb +14 -0
  121. data/lib/workos/types/agent_instance_type.rb +9 -0
  122. data/lib/workos/types/authenticate_response_authentication_method.rb +1 -4
  123. data/lib/workos/types/connected_account_connection_role.rb +13 -0
  124. data/lib/workos/types/connection_activated_data_connection_type.rb +1 -4
  125. data/lib/workos/types/connection_type.rb +1 -4
  126. data/lib/workos/types/connections_connection_type.rb +1 -4
  127. data/lib/workos/types/create_connection_oidc_options_id_token_signature_algorithm.rb +24 -0
  128. data/lib/workos/types/create_connection_oidc_options_token_authentication_method.rb +14 -0
  129. data/lib/workos/types/create_data_integration_ownership.rb +13 -0
  130. data/lib/workos/types/create_webhook_endpoint_events.rb +13 -1
  131. data/lib/workos/types/data_integration_installation_connection_role.rb +9 -0
  132. data/lib/workos/types/data_integration_ownership.rb +9 -0
  133. data/lib/workos/types/data_integrations_get_data_integration_authorize_url_request_connection_owner.rb +9 -0
  134. data/lib/workos/types/data_integrations_get_user_token_request_connection_owner.rb +9 -0
  135. data/lib/workos/types/data_integrations_list_response_data_connected_account_connection_role.rb +9 -0
  136. data/lib/workos/types/data_integrations_list_response_data_connection_owner.rb +9 -0
  137. data/lib/workos/types/data_integrations_upsert_api_key_request_connection_owner.rb +9 -0
  138. data/lib/workos/types/data_integrations_upsert_client_credentials_request_connection_owner.rb +9 -0
  139. data/lib/workos/types/data_integrations_vend_credentials_request_connection_owner.rb +9 -0
  140. data/lib/workos/types/invite_it_contact_intents.rb +16 -0
  141. data/lib/workos/types/patch_connection_oidc_options_id_token_signature_algorithm.rb +9 -0
  142. data/lib/workos/types/patch_connection_oidc_options_token_authentication_method.rb +9 -0
  143. data/lib/workos/types/pipe_connected_account_auth_method.rb +9 -0
  144. data/lib/workos/types/pipe_connected_account_connection_role.rb +9 -0
  145. data/lib/workos/types/pipes_ownership.rb +9 -0
  146. data/lib/workos/types/resource_export_completed_data_resource_type.rb +18 -0
  147. data/lib/workos/types/resource_export_created_data_resource_type.rb +9 -0
  148. data/lib/workos/types/resource_export_downloaded_data_resource_type.rb +9 -0
  149. data/lib/workos/types/resource_export_failed_data_resource_type.rb +9 -0
  150. data/lib/workos/types/session_created_data_status.rb +1 -6
  151. data/lib/workos/types/session_revoked_data_status.rb +1 -1
  152. data/lib/workos/types/sso_grant_type.rb +13 -0
  153. data/lib/workos/types/team_production_state.rb +15 -0
  154. data/lib/workos/types/token_query_grant_type.rb +9 -0
  155. data/lib/workos/types/update_audit_logs_retention_retention_period.rb +32 -0
  156. data/lib/workos/types/user_identities_get_item_provider.rb +1 -4
  157. data/lib/workos/types/user_management_waitlists_state.rb +14 -0
  158. data/lib/workos/types/user_sessions_status.rb +1 -1
  159. data/lib/workos/types/waitlist_entry_state.rb +9 -0
  160. data/lib/workos/types/waitlist_user_state.rb +1 -6
  161. data/lib/workos/user_management/authentication_oauth_failed_data.rb +5 -2
  162. data/lib/workos/user_management/authentication_oauth_succeeded_data.rb +5 -2
  163. data/lib/workos/user_management/authkit_oauth_resource.rb +34 -0
  164. data/lib/workos/user_management/create_authkit_oauth_resource.rb +22 -0
  165. data/lib/workos/user_management/create_password_reset_token.rb +1 -12
  166. data/lib/workos/user_management/create_waitlist_entry.rb +25 -0
  167. data/lib/workos/user_management/email_completion_session_authenticate_request.rb +43 -0
  168. data/lib/workos/user_management/waitlist.rb +28 -0
  169. data/lib/workos/user_management/waitlist_entry.rb +43 -0
  170. data/lib/workos/user_management.rb +263 -0
  171. data/lib/workos/version.rb +1 -1
  172. data/lib/workos.rb +1 -0
  173. data/rbi/workos/account_selection_required_error.rbi +30 -0
  174. data/rbi/workos/agent_blueprint.rbi +72 -0
  175. data/rbi/workos/agent_blueprint_created.rbi +54 -0
  176. data/rbi/workos/agent_blueprint_created_data.rbi +72 -0
  177. data/rbi/workos/agent_blueprint_created_data_invocable_by.rbi +30 -0
  178. data/rbi/workos/agent_blueprint_created_data_session_setting.rbi +36 -0
  179. data/rbi/workos/agent_blueprint_deleted.rbi +54 -0
  180. data/rbi/workos/agent_blueprint_deleted_data.rbi +48 -0
  181. data/rbi/workos/agent_blueprint_invocable_by.rbi +30 -0
  182. data/rbi/workos/agent_blueprint_session_setting.rbi +36 -0
  183. data/rbi/workos/agent_blueprint_updated.rbi +54 -0
  184. data/rbi/workos/agent_blueprint_updated_data.rbi +72 -0
  185. data/rbi/workos/agent_blueprint_updated_data_invocable_by.rbi +30 -0
  186. data/rbi/workos/agent_blueprint_updated_data_session_setting.rbi +36 -0
  187. data/rbi/workos/agent_blueprints_create_request.rbi +48 -0
  188. data/rbi/workos/agent_blueprints_create_request_invocable_by.rbi +30 -0
  189. data/rbi/workos/agent_blueprints_create_request_session_setting.rbi +36 -0
  190. data/rbi/workos/agent_blueprints_token_mint_token_request.rbi +54 -0
  191. data/rbi/workos/agent_blueprints_token_validate_token_request.rbi +24 -0
  192. data/rbi/workos/agent_blueprints_update_request.rbi +48 -0
  193. data/rbi/workos/agent_blueprints_update_request_invocable_by.rbi +30 -0
  194. data/rbi/workos/agent_blueprints_update_request_session_setting.rbi +36 -0
  195. data/rbi/workos/agent_instance.rbi +66 -0
  196. data/rbi/workos/agent_instance_created.rbi +54 -0
  197. data/rbi/workos/agent_instance_created_data.rbi +66 -0
  198. data/rbi/workos/agent_instance_deleted.rbi +54 -0
  199. data/rbi/workos/agent_instance_deleted_data.rbi +66 -0
  200. data/rbi/workos/agent_instance_session.rbi +66 -0
  201. data/rbi/workos/agent_instance_session_created.rbi +54 -0
  202. data/rbi/workos/agent_instance_session_created_data.rbi +72 -0
  203. data/rbi/workos/agent_instance_session_revoked.rbi +54 -0
  204. data/rbi/workos/agent_instance_session_revoked_data.rbi +66 -0
  205. data/rbi/workos/agent_token.rbi +66 -0
  206. data/rbi/workos/agent_token_validation.rbi +66 -0
  207. data/rbi/workos/agents.rbi +134 -0
  208. data/rbi/workos/audit_logs.rbi +26 -2
  209. data/rbi/workos/authentication_oauth_failed_data.rbi +6 -0
  210. data/rbi/workos/authentication_oauth_succeeded_data.rbi +6 -0
  211. data/rbi/workos/authkit_oauth_resource.rbi +54 -0
  212. data/rbi/workos/client.rbi +3 -0
  213. data/rbi/workos/connected_account.rbi +18 -0
  214. data/rbi/workos/create_authkit_oauth_resource.rbi +30 -0
  215. data/rbi/workos/create_connection.rbi +60 -0
  216. data/rbi/workos/create_connection_attribute_maps.rbi +30 -0
  217. data/rbi/workos/create_connection_key_pair.rbi +30 -0
  218. data/rbi/workos/create_connection_oidc_options.rbi +72 -0
  219. data/rbi/workos/create_connection_saml_options.rbi +66 -0
  220. data/rbi/workos/create_connection_standard_attributes.rbi +54 -0
  221. data/rbi/workos/create_data_integration.rbi +6 -0
  222. data/rbi/workos/create_it_contact.rbi +24 -0
  223. data/rbi/workos/create_saml_idp_signing_certificate.rbi +24 -0
  224. data/rbi/workos/create_team.rbi +30 -0
  225. data/rbi/workos/create_waitlist_entry.rbi +36 -0
  226. data/rbi/workos/data_integration.rbi +6 -0
  227. data/rbi/workos/data_integration_installation.rbi +19 -1
  228. data/rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi +6 -0
  229. data/rbi/workos/data_integrations_get_user_token_request.rbi +18 -0
  230. data/rbi/workos/data_integrations_list_response_data.rbi +12 -0
  231. data/rbi/workos/data_integrations_list_response_data_connected_account.rbi +18 -0
  232. data/rbi/workos/data_integrations_upsert_api_key_request.rbi +12 -0
  233. data/rbi/workos/data_integrations_upsert_client_credentials_request.rbi +12 -0
  234. data/rbi/workos/data_integrations_vend_credentials_request.rbi +18 -0
  235. data/rbi/workos/email_completion_session_authenticate_request.rbi +72 -0
  236. data/rbi/workos/invite_it_contact.rbi +24 -0
  237. data/rbi/workos/it_contact.rbi +48 -0
  238. data/rbi/workos/organizations.rbi +45 -0
  239. data/rbi/workos/patch_connection.rbi +54 -0
  240. data/rbi/workos/patch_connection_attribute_maps.rbi +30 -0
  241. data/rbi/workos/patch_connection_oidc_options.rbi +66 -0
  242. data/rbi/workos/patch_connection_saml_options.rbi +48 -0
  243. data/rbi/workos/patch_connection_standard_attributes.rbi +54 -0
  244. data/rbi/workos/pipe_connected_account.rbi +30 -0
  245. data/rbi/workos/pipes.rbi +122 -11
  246. data/rbi/workos/pipes_account_connection_add_failed.rbi +54 -0
  247. data/rbi/workos/pipes_account_connection_add_failed_data.rbi +84 -0
  248. data/rbi/workos/pipes_account_connection_connected.rbi +54 -0
  249. data/rbi/workos/pipes_account_connection_connection_failed.rbi +54 -0
  250. data/rbi/workos/pipes_account_connection_connection_failed_data.rbi +84 -0
  251. data/rbi/workos/pipes_account_connection_disconnected.rbi +54 -0
  252. data/rbi/workos/pipes_account_connection_reauthorization_needed.rbi +54 -0
  253. data/rbi/workos/pipes_connected_account_connection_failed_data.rbi +6 -0
  254. data/rbi/workos/platform_teams.rbi +30 -0
  255. data/rbi/workos/resource_export_completed.rbi +54 -0
  256. data/rbi/workos/resource_export_completed_data.rbi +30 -0
  257. data/rbi/workos/resource_export_created.rbi +54 -0
  258. data/rbi/workos/resource_export_created_data.rbi +30 -0
  259. data/rbi/workos/resource_export_downloaded.rbi +54 -0
  260. data/rbi/workos/resource_export_downloaded_data.rbi +30 -0
  261. data/rbi/workos/resource_export_failed.rbi +54 -0
  262. data/rbi/workos/resource_export_failed_data.rbi +30 -0
  263. data/rbi/workos/saml_idp_signing_certificate.rbi +54 -0
  264. data/rbi/workos/saml_idp_signing_certificate_list.rbi +30 -0
  265. data/rbi/workos/saml_sp_encryption_certificate.rbi +54 -0
  266. data/rbi/workos/saml_sp_encryption_certificate_list.rbi +30 -0
  267. data/rbi/workos/saml_sp_signing_certificate.rbi +54 -0
  268. data/rbi/workos/sso.rbi +155 -2
  269. data/rbi/workos/team.rbi +60 -0
  270. data/rbi/workos/token_query.rbi +20 -2
  271. data/rbi/workos/update_audit_logs_retention.rbi +8 -2
  272. data/rbi/workos/user_management.rbi +92 -0
  273. data/rbi/workos/waitlist.rbi +42 -0
  274. data/rbi/workos/waitlist_entry.rbi +72 -0
  275. data/rbi/workos/waitlist_user.rbi +12 -6
  276. data/test/workos/test_agents.rb +105 -1
  277. data/test/workos/test_agents_model_round_trip.rb +245 -0
  278. data/test/workos/test_audit_logs.rb +11 -2
  279. data/test/workos/test_authorization.rb +6 -6
  280. data/test/workos/test_organizations.rb +41 -1
  281. data/test/workos/test_organizations_model_round_trip.rb +40 -1
  282. data/test/workos/test_pipes.rb +64 -0
  283. data/test/workos/test_pipes_model_round_trip.rb +35 -5
  284. data/test/workos/test_platform_teams.rb +41 -0
  285. data/test/workos/test_platform_teams_model_round_trip.rb +41 -0
  286. data/test/workos/test_session.rb +63 -0
  287. data/test/workos/test_shared_model_round_trip.rb +610 -2
  288. data/test/workos/test_sso.rb +108 -2
  289. data/test/workos/test_sso_model_round_trip.rb +262 -2
  290. data/test/workos/test_user_management.rb +80 -0
  291. data/test/workos/test_user_management_model_round_trip.rb +110 -2
  292. metadata +194 -1
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ require "json"
6
+
7
+ module WorkOS
8
+ class PlatformTeams
9
+ def initialize(client)
10
+ @client = client
11
+ end
12
+
13
+ # Create a team
14
+ # @param admin_email [String] The email address of the person who will administer the team. An invitation is sent to this address.
15
+ # @param name [String] Name of the team.
16
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
17
+ # @return [WorkOS::Team]
18
+ def create_team(
19
+ admin_email:,
20
+ name:,
21
+ request_options: {}
22
+ )
23
+ body = {
24
+ "admin_email" => admin_email,
25
+ "name" => name
26
+ }
27
+ response = @client.request(
28
+ method: :post,
29
+ path: "/platform/teams",
30
+ auth: true,
31
+ body: body,
32
+ request_options: request_options
33
+ )
34
+ result = WorkOS::Team.new(response.body)
35
+ result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
36
+ result
37
+ end
38
+
39
+ # Get a team
40
+ # @param team_id [String] The ID of the team.
41
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
42
+ # @return [WorkOS::Team]
43
+ def get_team(
44
+ team_id:,
45
+ request_options: {}
46
+ )
47
+ response = @client.request(
48
+ method: :get,
49
+ path: "/platform/teams/#{WorkOS::Util.encode_path(team_id)}",
50
+ auth: true,
51
+ request_options: request_options
52
+ )
53
+ result = WorkOS::Team.new(response.body)
54
+ result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
55
+ result
56
+ end
57
+ end
58
+ end
@@ -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
@@ -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 AgentBlueprintCreated < 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::AgentBlueprintCreatedData.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,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class AgentBlueprintCreatedData < 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
+ session_settings: :session_settings,
15
+ created_at: :created_at,
16
+ updated_at: :updated_at
17
+ }.freeze
18
+
19
+ attr_accessor \
20
+ :object,
21
+ :id,
22
+ :name,
23
+ :description,
24
+ :permissions,
25
+ :invocable_by,
26
+ :session_settings,
27
+ :created_at,
28
+ :updated_at
29
+
30
+ def initialize(json)
31
+ hash = self.class.normalize(json)
32
+ @object = hash[:object]
33
+ @id = hash[:id]
34
+ @name = hash[:name]
35
+ @description = hash[:description]
36
+ @permissions = hash[:permissions] || []
37
+ @invocable_by = hash[:invocable_by] ? WorkOS::AgentBlueprintCreatedDataInvocableBy.new(hash[:invocable_by]) : nil
38
+ @session_settings = hash[:session_settings] ? WorkOS::AgentBlueprintCreatedDataSessionSetting.new(hash[:session_settings]) : nil
39
+ @created_at = hash[:created_at]
40
+ @updated_at = hash[:updated_at]
41
+ end
42
+ end
43
+ end
@@ -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 AgentBlueprintCreatedDataInvocableBy < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ role_slugs: :role_slugs,
9
+ organization_ids: :organization_ids
10
+ }.freeze
11
+
12
+ attr_accessor \
13
+ :role_slugs,
14
+ :organization_ids
15
+
16
+ def initialize(json)
17
+ hash = self.class.normalize(json)
18
+ @role_slugs = hash[:role_slugs] || []
19
+ @organization_ids = hash[:organization_ids] || []
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class AgentBlueprintCreatedDataSessionSetting < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ max_age_seconds: :max_age_seconds,
9
+ access_token_ttl_seconds: :access_token_ttl_seconds,
10
+ refresh_token_ttl_seconds: :refresh_token_ttl_seconds
11
+ }.freeze
12
+
13
+ attr_accessor \
14
+ :max_age_seconds,
15
+ :access_token_ttl_seconds,
16
+ :refresh_token_ttl_seconds
17
+
18
+ def initialize(json)
19
+ hash = self.class.normalize(json)
20
+ @max_age_seconds = hash[:max_age_seconds]
21
+ @access_token_ttl_seconds = hash[:access_token_ttl_seconds]
22
+ @refresh_token_ttl_seconds = hash[:refresh_token_ttl_seconds]
23
+ end
24
+ end
25
+ 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 AgentBlueprintDeleted < 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::AgentBlueprintDeletedData.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,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class AgentBlueprintDeletedData < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ object: :object,
9
+ id: :id,
10
+ name: :name,
11
+ created_at: :created_at,
12
+ updated_at: :updated_at
13
+ }.freeze
14
+
15
+ attr_accessor \
16
+ :object,
17
+ :id,
18
+ :name,
19
+ :created_at,
20
+ :updated_at
21
+
22
+ def initialize(json)
23
+ hash = self.class.normalize(json)
24
+ @object = hash[:object]
25
+ @id = hash[:id]
26
+ @name = hash[:name]
27
+ @created_at = hash[:created_at]
28
+ @updated_at = hash[:updated_at]
29
+ end
30
+ end
31
+ 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 AgentBlueprintUpdated < 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::AgentBlueprintUpdatedData.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
+ AgentBlueprintUpdatedData = AgentBlueprintCreatedData
7
+ 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
+ AgentBlueprintUpdatedDataInvocableBy = AgentBlueprintCreatedDataInvocableBy
7
+ 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
+ AgentBlueprintUpdatedDataSessionSetting = AgentBlueprintCreatedDataSessionSetting
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 AgentInstanceCreated < 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::AgentInstanceCreatedData.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,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class AgentInstanceCreatedData < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ object: :object,
9
+ id: :id,
10
+ agent_blueprint_id: :agent_blueprint_id,
11
+ organization_id: :organization_id,
12
+ organization_membership_id: :organization_membership_id,
13
+ type: :type,
14
+ created_at: :created_at,
15
+ updated_at: :updated_at
16
+ }.freeze
17
+
18
+ attr_accessor \
19
+ :object,
20
+ :id,
21
+ :agent_blueprint_id,
22
+ :organization_id,
23
+ :organization_membership_id,
24
+ :type,
25
+ :created_at,
26
+ :updated_at
27
+
28
+ def initialize(json)
29
+ hash = self.class.normalize(json)
30
+ @object = hash[:object]
31
+ @id = hash[:id]
32
+ @agent_blueprint_id = hash[:agent_blueprint_id]
33
+ @organization_id = hash[:organization_id]
34
+ @organization_membership_id = hash[:organization_membership_id]
35
+ @type = hash[:type]
36
+ @created_at = hash[:created_at]
37
+ @updated_at = hash[:updated_at]
38
+ end
39
+ end
40
+ 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 AgentInstanceDeleted < 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::AgentInstanceDeletedData.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,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class AgentInstanceDeletedData < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ object: :object,
9
+ id: :id,
10
+ agent_blueprint_id: :agent_blueprint_id,
11
+ organization_id: :organization_id,
12
+ organization_membership_id: :organization_membership_id,
13
+ type: :type,
14
+ created_at: :created_at,
15
+ updated_at: :updated_at
16
+ }.freeze
17
+
18
+ attr_accessor \
19
+ :object,
20
+ :id,
21
+ :agent_blueprint_id,
22
+ :organization_id,
23
+ :organization_membership_id,
24
+ :type,
25
+ :created_at,
26
+ :updated_at
27
+
28
+ def initialize(json)
29
+ hash = self.class.normalize(json)
30
+ @object = hash[:object]
31
+ @id = hash[:id]
32
+ @agent_blueprint_id = hash[:agent_blueprint_id]
33
+ @organization_id = hash[:organization_id]
34
+ @organization_membership_id = hash[:organization_membership_id]
35
+ @type = hash[:type]
36
+ @created_at = hash[:created_at]
37
+ @updated_at = hash[:updated_at]
38
+ end
39
+ end
40
+ 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 AgentInstanceSessionCreated < 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::AgentInstanceSessionCreatedData.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,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class AgentInstanceSessionCreatedData < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ object: :object,
9
+ id: :id,
10
+ agent_instance_id: :agent_instance_id,
11
+ organization_id: :organization_id,
12
+ expires_at: :expires_at,
13
+ revoked_at: :revoked_at,
14
+ created_at: :created_at,
15
+ updated_at: :updated_at,
16
+ permission_slugs: :permission_slugs
17
+ }.freeze
18
+
19
+ attr_accessor \
20
+ :object,
21
+ :id,
22
+ :agent_instance_id,
23
+ :organization_id,
24
+ :expires_at,
25
+ :revoked_at,
26
+ :created_at,
27
+ :updated_at,
28
+ :permission_slugs
29
+
30
+ def initialize(json)
31
+ hash = self.class.normalize(json)
32
+ @object = hash[:object]
33
+ @id = hash[:id]
34
+ @agent_instance_id = hash[:agent_instance_id]
35
+ @organization_id = hash[:organization_id]
36
+ @expires_at = hash[:expires_at]
37
+ @revoked_at = hash[:revoked_at]
38
+ @created_at = hash[:created_at]
39
+ @updated_at = hash[:updated_at]
40
+ @permission_slugs = hash[:permission_slugs] || []
41
+ end
42
+ end
43
+ 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 AgentInstanceSessionRevoked < 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::AgentInstanceSessionRevokedData.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,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class AgentInstanceSessionRevokedData < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ object: :object,
9
+ id: :id,
10
+ agent_instance_id: :agent_instance_id,
11
+ organization_id: :organization_id,
12
+ expires_at: :expires_at,
13
+ revoked_at: :revoked_at,
14
+ created_at: :created_at,
15
+ updated_at: :updated_at
16
+ }.freeze
17
+
18
+ attr_accessor \
19
+ :object,
20
+ :id,
21
+ :agent_instance_id,
22
+ :organization_id,
23
+ :expires_at,
24
+ :revoked_at,
25
+ :created_at,
26
+ :updated_at
27
+
28
+ def initialize(json)
29
+ hash = self.class.normalize(json)
30
+ @object = hash[:object]
31
+ @id = hash[:id]
32
+ @agent_instance_id = hash[:agent_instance_id]
33
+ @organization_id = hash[:organization_id]
34
+ @expires_at = hash[:expires_at]
35
+ @revoked_at = hash[:revoked_at]
36
+ @created_at = hash[:created_at]
37
+ @updated_at = hash[:updated_at]
38
+ end
39
+ end
40
+ end