workos 10.2.1 → 10.3.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 (216) hide show
  1. checksums.yaml +4 -4
  2. data/.last-synced-sha +1 -1
  3. data/.oagen-manifest.json +311 -0
  4. data/.release-please-manifest.json +1 -1
  5. data/CHANGELOG.md +154 -0
  6. data/Gemfile.lock +2 -2
  7. data/lib/workos/agents/agent_blueprint.rb +43 -0
  8. data/lib/workos/agents/agent_blueprint_invocable_by.rb +7 -0
  9. data/lib/workos/agents/agent_blueprint_session_setting.rb +25 -0
  10. data/lib/workos/agents/agent_blueprints_create_request.rb +31 -0
  11. data/lib/workos/agents/agent_blueprints_create_request_invocable_by.rb +22 -0
  12. data/lib/workos/agents/agent_blueprints_create_request_session_setting.rb +7 -0
  13. data/lib/workos/agents/agent_blueprints_token_mint_token_request.rb +34 -0
  14. data/lib/workos/agents/agent_blueprints_token_validate_token_request.rb +18 -0
  15. data/lib/workos/agents/agent_blueprints_update_request.rb +31 -0
  16. data/lib/workos/agents/agent_blueprints_update_request_invocable_by.rb +7 -0
  17. data/lib/workos/agents/agent_blueprints_update_request_session_setting.rb +25 -0
  18. data/lib/workos/agents/agent_instance.rb +40 -0
  19. data/lib/workos/agents/agent_instance_session.rb +40 -0
  20. data/lib/workos/agents/agent_token.rb +40 -0
  21. data/lib/workos/agents/agent_token_validation.rb +40 -0
  22. data/lib/workos/agents.rb +395 -0
  23. data/lib/workos/api_keys/validate_api_key.rb +1 -12
  24. data/lib/workos/audit_logs.rb +23 -5
  25. data/lib/workos/authorization.rb +3 -3
  26. data/lib/workos/client.rb +4 -0
  27. data/lib/workos/inflections.rb +15 -0
  28. data/lib/workos/organizations/create_it_contact.rb +18 -0
  29. data/lib/workos/organizations/invite_it_contact.rb +18 -0
  30. data/lib/workos/organizations/it_contact.rb +31 -0
  31. data/lib/workos/organizations/it_contact_list.rb +25 -0
  32. data/lib/workos/organizations/organization_input.rb +10 -1
  33. data/lib/workos/organizations/update_audit_logs_retention.rb +13 -1
  34. data/lib/workos/organizations.rb +110 -1
  35. data/lib/workos/platform_teams/create_team.rb +22 -0
  36. data/lib/workos/platform_teams/team.rb +37 -0
  37. data/lib/workos/platform_teams.rb +58 -0
  38. data/lib/workos/shared/agent_blueprint_created.rb +34 -0
  39. data/lib/workos/shared/agent_blueprint_created_data.rb +43 -0
  40. data/lib/workos/shared/agent_blueprint_created_data_invocable_by.rb +22 -0
  41. data/lib/workos/shared/agent_blueprint_created_data_session_setting.rb +25 -0
  42. data/lib/workos/shared/agent_blueprint_deleted.rb +34 -0
  43. data/lib/workos/shared/agent_blueprint_deleted_data.rb +31 -0
  44. data/lib/workos/shared/agent_blueprint_updated.rb +34 -0
  45. data/lib/workos/shared/agent_blueprint_updated_data.rb +7 -0
  46. data/lib/workos/shared/agent_blueprint_updated_data_invocable_by.rb +7 -0
  47. data/lib/workos/shared/agent_blueprint_updated_data_session_setting.rb +7 -0
  48. data/lib/workos/shared/agent_instance_created.rb +34 -0
  49. data/lib/workos/shared/agent_instance_created_data.rb +40 -0
  50. data/lib/workos/shared/agent_instance_deleted.rb +34 -0
  51. data/lib/workos/shared/agent_instance_deleted_data.rb +40 -0
  52. data/lib/workos/shared/agent_instance_session_created.rb +34 -0
  53. data/lib/workos/shared/agent_instance_session_created_data.rb +43 -0
  54. data/lib/workos/shared/agent_instance_session_revoked.rb +34 -0
  55. data/lib/workos/shared/agent_instance_session_revoked_data.rb +40 -0
  56. data/lib/workos/shared/resource_export_completed.rb +34 -0
  57. data/lib/workos/shared/resource_export_completed_data.rb +22 -0
  58. data/lib/workos/shared/resource_export_created.rb +34 -0
  59. data/lib/workos/shared/resource_export_created_data.rb +22 -0
  60. data/lib/workos/shared/resource_export_downloaded.rb +34 -0
  61. data/lib/workos/shared/resource_export_downloaded_data.rb +22 -0
  62. data/lib/workos/shared/resource_export_failed.rb +34 -0
  63. data/lib/workos/shared/resource_export_failed_data.rb +22 -0
  64. data/lib/workos/shared/waitlist_user.rb +8 -5
  65. data/lib/workos/sso/create_connection.rb +37 -0
  66. data/lib/workos/sso/create_connection_attribute_maps.rb +22 -0
  67. data/lib/workos/sso/create_connection_key_pair.rb +22 -0
  68. data/lib/workos/sso/create_connection_oidc_options.rb +43 -0
  69. data/lib/workos/sso/create_connection_saml_options.rb +40 -0
  70. data/lib/workos/sso/create_connection_standard_attributes.rb +34 -0
  71. data/lib/workos/sso/create_saml_idp_signing_certificate.rb +18 -0
  72. data/lib/workos/sso/patch_connection.rb +34 -0
  73. data/lib/workos/sso/patch_connection_attribute_maps.rb +22 -0
  74. data/lib/workos/sso/patch_connection_oidc_options.rb +40 -0
  75. data/lib/workos/sso/patch_connection_saml_options.rb +31 -0
  76. data/lib/workos/sso/patch_connection_standard_attributes.rb +7 -0
  77. data/lib/workos/sso/saml_idp_signing_certificate.rb +34 -0
  78. data/lib/workos/sso/saml_idp_signing_certificate_list.rb +22 -0
  79. data/lib/workos/sso/saml_sp_encryption_certificate.rb +34 -0
  80. data/lib/workos/sso/saml_sp_encryption_certificate_list.rb +22 -0
  81. data/lib/workos/sso/saml_sp_signing_certificate.rb +34 -0
  82. data/lib/workos/sso/token_query.rb +11 -2
  83. data/lib/workos/sso.rb +305 -4
  84. data/lib/workos/types/agent_blueprints_token_mint_token_request_type.rb +15 -0
  85. data/lib/workos/types/agent_instance_created_data_type.rb +13 -0
  86. data/lib/workos/types/agent_instance_deleted_data_type.rb +9 -0
  87. data/lib/workos/types/agent_instance_session_status.rb +14 -0
  88. data/lib/workos/types/agent_instance_type.rb +9 -0
  89. data/lib/workos/types/authenticate_response_authentication_method.rb +1 -4
  90. data/lib/workos/types/connection_activated_data_connection_type.rb +1 -4
  91. data/lib/workos/types/connection_type.rb +1 -4
  92. data/lib/workos/types/connections_connection_type.rb +1 -4
  93. data/lib/workos/types/create_connection_oidc_options_id_token_signature_algorithm.rb +24 -0
  94. data/lib/workos/types/create_connection_oidc_options_token_authentication_method.rb +14 -0
  95. data/lib/workos/types/create_webhook_endpoint_events.rb +8 -1
  96. data/lib/workos/types/invite_it_contact_intents.rb +16 -0
  97. data/lib/workos/types/patch_connection_oidc_options_id_token_signature_algorithm.rb +9 -0
  98. data/lib/workos/types/patch_connection_oidc_options_token_authentication_method.rb +9 -0
  99. data/lib/workos/types/resource_export_completed_data_resource_type.rb +16 -0
  100. data/lib/workos/types/resource_export_created_data_resource_type.rb +9 -0
  101. data/lib/workos/types/resource_export_downloaded_data_resource_type.rb +9 -0
  102. data/lib/workos/types/resource_export_failed_data_resource_type.rb +9 -0
  103. data/lib/workos/types/session_created_data_status.rb +1 -6
  104. data/lib/workos/types/session_revoked_data_status.rb +1 -1
  105. data/lib/workos/types/sso_grant_type.rb +13 -0
  106. data/lib/workos/types/team_production_state.rb +15 -0
  107. data/lib/workos/types/token_query_grant_type.rb +9 -0
  108. data/lib/workos/types/update_audit_logs_retention_retention_period.rb +32 -0
  109. data/lib/workos/types/user_identities_get_item_provider.rb +1 -4
  110. data/lib/workos/types/user_management_waitlists_state.rb +14 -0
  111. data/lib/workos/types/user_sessions_status.rb +1 -1
  112. data/lib/workos/types/waitlist_entry_state.rb +9 -0
  113. data/lib/workos/types/waitlist_user_state.rb +1 -6
  114. data/lib/workos/user_management/authentication_oauth_failed_data.rb +5 -2
  115. data/lib/workos/user_management/authentication_oauth_succeeded_data.rb +5 -2
  116. data/lib/workos/user_management/create_password_reset_token.rb +1 -12
  117. data/lib/workos/user_management/create_waitlist_entry.rb +25 -0
  118. data/lib/workos/user_management/email_completion_session_authenticate_request.rb +43 -0
  119. data/lib/workos/user_management/waitlist.rb +28 -0
  120. data/lib/workos/user_management/waitlist_entry.rb +43 -0
  121. data/lib/workos/user_management.rb +176 -0
  122. data/lib/workos/version.rb +1 -1
  123. data/lib/workos.rb +1 -0
  124. data/rbi/workos/agent_blueprint.rbi +72 -0
  125. data/rbi/workos/agent_blueprint_created.rbi +54 -0
  126. data/rbi/workos/agent_blueprint_created_data.rbi +72 -0
  127. data/rbi/workos/agent_blueprint_created_data_invocable_by.rbi +30 -0
  128. data/rbi/workos/agent_blueprint_created_data_session_setting.rbi +36 -0
  129. data/rbi/workos/agent_blueprint_deleted.rbi +54 -0
  130. data/rbi/workos/agent_blueprint_deleted_data.rbi +48 -0
  131. data/rbi/workos/agent_blueprint_invocable_by.rbi +30 -0
  132. data/rbi/workos/agent_blueprint_session_setting.rbi +36 -0
  133. data/rbi/workos/agent_blueprint_updated.rbi +54 -0
  134. data/rbi/workos/agent_blueprint_updated_data.rbi +72 -0
  135. data/rbi/workos/agent_blueprint_updated_data_invocable_by.rbi +30 -0
  136. data/rbi/workos/agent_blueprint_updated_data_session_setting.rbi +36 -0
  137. data/rbi/workos/agent_blueprints_create_request.rbi +48 -0
  138. data/rbi/workos/agent_blueprints_create_request_invocable_by.rbi +30 -0
  139. data/rbi/workos/agent_blueprints_create_request_session_setting.rbi +36 -0
  140. data/rbi/workos/agent_blueprints_token_mint_token_request.rbi +54 -0
  141. data/rbi/workos/agent_blueprints_token_validate_token_request.rbi +24 -0
  142. data/rbi/workos/agent_blueprints_update_request.rbi +48 -0
  143. data/rbi/workos/agent_blueprints_update_request_invocable_by.rbi +30 -0
  144. data/rbi/workos/agent_blueprints_update_request_session_setting.rbi +36 -0
  145. data/rbi/workos/agent_instance.rbi +66 -0
  146. data/rbi/workos/agent_instance_created.rbi +54 -0
  147. data/rbi/workos/agent_instance_created_data.rbi +66 -0
  148. data/rbi/workos/agent_instance_deleted.rbi +54 -0
  149. data/rbi/workos/agent_instance_deleted_data.rbi +66 -0
  150. data/rbi/workos/agent_instance_session.rbi +66 -0
  151. data/rbi/workos/agent_instance_session_created.rbi +54 -0
  152. data/rbi/workos/agent_instance_session_created_data.rbi +72 -0
  153. data/rbi/workos/agent_instance_session_revoked.rbi +54 -0
  154. data/rbi/workos/agent_instance_session_revoked_data.rbi +66 -0
  155. data/rbi/workos/agent_token.rbi +66 -0
  156. data/rbi/workos/agent_token_validation.rbi +66 -0
  157. data/rbi/workos/agents.rbi +133 -0
  158. data/rbi/workos/audit_logs.rbi +26 -2
  159. data/rbi/workos/authentication_oauth_failed_data.rbi +6 -0
  160. data/rbi/workos/authentication_oauth_succeeded_data.rbi +6 -0
  161. data/rbi/workos/client.rbi +3 -0
  162. data/rbi/workos/create_connection.rbi +60 -0
  163. data/rbi/workos/create_connection_attribute_maps.rbi +30 -0
  164. data/rbi/workos/create_connection_key_pair.rbi +30 -0
  165. data/rbi/workos/create_connection_oidc_options.rbi +72 -0
  166. data/rbi/workos/create_connection_saml_options.rbi +66 -0
  167. data/rbi/workos/create_connection_standard_attributes.rbi +54 -0
  168. data/rbi/workos/create_it_contact.rbi +24 -0
  169. data/rbi/workos/create_saml_idp_signing_certificate.rbi +24 -0
  170. data/rbi/workos/create_team.rbi +30 -0
  171. data/rbi/workos/create_waitlist_entry.rbi +36 -0
  172. data/rbi/workos/email_completion_session_authenticate_request.rbi +72 -0
  173. data/rbi/workos/invite_it_contact.rbi +24 -0
  174. data/rbi/workos/it_contact.rbi +48 -0
  175. data/rbi/workos/organizations.rbi +45 -0
  176. data/rbi/workos/patch_connection.rbi +54 -0
  177. data/rbi/workos/patch_connection_attribute_maps.rbi +30 -0
  178. data/rbi/workos/patch_connection_oidc_options.rbi +66 -0
  179. data/rbi/workos/patch_connection_saml_options.rbi +48 -0
  180. data/rbi/workos/patch_connection_standard_attributes.rbi +54 -0
  181. data/rbi/workos/platform_teams.rbi +30 -0
  182. data/rbi/workos/resource_export_completed.rbi +54 -0
  183. data/rbi/workos/resource_export_completed_data.rbi +30 -0
  184. data/rbi/workos/resource_export_created.rbi +54 -0
  185. data/rbi/workos/resource_export_created_data.rbi +30 -0
  186. data/rbi/workos/resource_export_downloaded.rbi +54 -0
  187. data/rbi/workos/resource_export_downloaded_data.rbi +30 -0
  188. data/rbi/workos/resource_export_failed.rbi +54 -0
  189. data/rbi/workos/resource_export_failed_data.rbi +30 -0
  190. data/rbi/workos/saml_idp_signing_certificate.rbi +54 -0
  191. data/rbi/workos/saml_idp_signing_certificate_list.rbi +30 -0
  192. data/rbi/workos/saml_sp_encryption_certificate.rbi +54 -0
  193. data/rbi/workos/saml_sp_encryption_certificate_list.rbi +30 -0
  194. data/rbi/workos/saml_sp_signing_certificate.rbi +54 -0
  195. data/rbi/workos/sso.rbi +155 -2
  196. data/rbi/workos/team.rbi +60 -0
  197. data/rbi/workos/token_query.rbi +20 -2
  198. data/rbi/workos/update_audit_logs_retention.rbi +8 -2
  199. data/rbi/workos/user_management.rbi +64 -0
  200. data/rbi/workos/waitlist.rbi +42 -0
  201. data/rbi/workos/waitlist_entry.rbi +72 -0
  202. data/rbi/workos/waitlist_user.rbi +12 -6
  203. data/test/workos/test_agents.rb +105 -1
  204. data/test/workos/test_agents_model_round_trip.rb +245 -0
  205. data/test/workos/test_audit_logs.rb +11 -2
  206. data/test/workos/test_authorization.rb +6 -6
  207. data/test/workos/test_organizations.rb +41 -1
  208. data/test/workos/test_organizations_model_round_trip.rb +40 -1
  209. data/test/workos/test_platform_teams.rb +41 -0
  210. data/test/workos/test_platform_teams_model_round_trip.rb +41 -0
  211. data/test/workos/test_shared_model_round_trip.rb +449 -2
  212. data/test/workos/test_sso.rb +108 -2
  213. data/test/workos/test_sso_model_round_trip.rb +262 -2
  214. data/test/workos/test_user_management.rb +56 -0
  215. data/test/workos/test_user_management_model_round_trip.rb +78 -2
  216. metadata +160 -1
@@ -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 PatchConnectionAttributeMaps < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ standard_attributes: :standard_attributes,
9
+ custom_attributes: :custom_attributes
10
+ }.freeze
11
+
12
+ attr_accessor \
13
+ :standard_attributes,
14
+ :custom_attributes
15
+
16
+ def initialize(json)
17
+ hash = self.class.normalize(json)
18
+ @standard_attributes = hash[:standard_attributes] ? WorkOS::PatchConnectionStandardAttributes.new(hash[:standard_attributes]) : nil
19
+ @custom_attributes = hash[:custom_attributes] || {}
20
+ end
21
+ end
22
+ 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 PatchConnectionOIDCOptions < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ discovery_endpoint: :discovery_endpoint,
9
+ client_id: :client_id,
10
+ client_secret: :client_secret,
11
+ redirect_uri: :redirect_uri,
12
+ pkce: :pkce,
13
+ token_authentication_method: :token_authentication_method,
14
+ id_token_signature_algorithm: :id_token_signature_algorithm,
15
+ fetch_user_info: :fetch_user_info
16
+ }.freeze
17
+
18
+ attr_accessor \
19
+ :discovery_endpoint,
20
+ :client_id,
21
+ :client_secret,
22
+ :redirect_uri,
23
+ :pkce,
24
+ :token_authentication_method,
25
+ :id_token_signature_algorithm,
26
+ :fetch_user_info
27
+
28
+ def initialize(json)
29
+ hash = self.class.normalize(json)
30
+ @discovery_endpoint = hash[:discovery_endpoint]
31
+ @client_id = hash[:client_id]
32
+ @client_secret = hash[:client_secret]
33
+ @redirect_uri = hash[:redirect_uri]
34
+ @pkce = hash[:pkce]
35
+ @token_authentication_method = hash[:token_authentication_method]
36
+ @id_token_signature_algorithm = hash[:id_token_signature_algorithm]
37
+ @fetch_user_info = hash[:fetch_user_info]
38
+ end
39
+ end
40
+ 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 PatchConnectionSAMLOptions < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ idp_metadata_url: :idp_metadata_url,
9
+ acs_url: :acs_url,
10
+ sp_entity_id: :sp_entity_id,
11
+ idp_entity_id: :idp_entity_id,
12
+ idp_sso_url: :idp_sso_url
13
+ }.freeze
14
+
15
+ attr_accessor \
16
+ :idp_metadata_url,
17
+ :acs_url,
18
+ :sp_entity_id,
19
+ :idp_entity_id,
20
+ :idp_sso_url
21
+
22
+ def initialize(json)
23
+ hash = self.class.normalize(json)
24
+ @idp_metadata_url = hash[:idp_metadata_url]
25
+ @acs_url = hash[:acs_url]
26
+ @sp_entity_id = hash[:sp_entity_id]
27
+ @idp_entity_id = hash[:idp_entity_id]
28
+ @idp_sso_url = hash[:idp_sso_url]
29
+ end
30
+ end
31
+ 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
+ PatchConnectionStandardAttributes = CreateConnectionStandardAttributes
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 SAMLIdpSigningCertificate < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ object: :object,
9
+ id: :id,
10
+ value: :value,
11
+ not_before: :not_before,
12
+ not_after: :not_after,
13
+ created_at: :created_at
14
+ }.freeze
15
+
16
+ attr_accessor \
17
+ :object,
18
+ :id,
19
+ :value,
20
+ :not_before,
21
+ :not_after,
22
+ :created_at
23
+
24
+ def initialize(json)
25
+ hash = self.class.normalize(json)
26
+ @object = hash[:object]
27
+ @id = hash[:id]
28
+ @value = hash[:value]
29
+ @not_before = hash[:not_before]
30
+ @not_after = hash[:not_after]
31
+ @created_at = hash[:created_at]
32
+ end
33
+ end
34
+ 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 SAMLIdpSigningCertificateList < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ object: :object,
9
+ data: :data
10
+ }.freeze
11
+
12
+ attr_accessor \
13
+ :object,
14
+ :data
15
+
16
+ def initialize(json)
17
+ hash = self.class.normalize(json)
18
+ @object = hash[:object]
19
+ @data = (hash[:data] || []).map { |item| item ? WorkOS::SAMLIdpSigningCertificate.new(item) : nil }
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 SAMLSpEncryptionCertificate < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ object: :object,
9
+ id: :id,
10
+ value: :value,
11
+ not_before: :not_before,
12
+ not_after: :not_after,
13
+ created_at: :created_at
14
+ }.freeze
15
+
16
+ attr_accessor \
17
+ :object,
18
+ :id,
19
+ :value,
20
+ :not_before,
21
+ :not_after,
22
+ :created_at
23
+
24
+ def initialize(json)
25
+ hash = self.class.normalize(json)
26
+ @object = hash[:object]
27
+ @id = hash[:id]
28
+ @value = hash[:value]
29
+ @not_before = hash[:not_before]
30
+ @not_after = hash[:not_after]
31
+ @created_at = hash[:created_at]
32
+ end
33
+ end
34
+ 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 SAMLSpEncryptionCertificateList < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ object: :object,
9
+ data: :data
10
+ }.freeze
11
+
12
+ attr_accessor \
13
+ :object,
14
+ :data
15
+
16
+ def initialize(json)
17
+ hash = self.class.normalize(json)
18
+ @object = hash[:object]
19
+ @data = (hash[:data] || []).map { |item| item ? WorkOS::SAMLSpEncryptionCertificate.new(item) : nil }
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 SAMLSpSigningCertificate < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ object: :object,
9
+ id: :id,
10
+ value: :value,
11
+ not_before: :not_before,
12
+ not_after: :not_after,
13
+ created_at: :created_at
14
+ }.freeze
15
+
16
+ attr_accessor \
17
+ :object,
18
+ :id,
19
+ :value,
20
+ :not_before,
21
+ :not_after,
22
+ :created_at
23
+
24
+ def initialize(json)
25
+ hash = self.class.normalize(json)
26
+ @object = hash[:object]
27
+ @id = hash[:id]
28
+ @value = hash[:value]
29
+ @not_before = hash[:not_before]
30
+ @not_after = hash[:not_after]
31
+ @created_at = hash[:created_at]
32
+ end
33
+ end
34
+ end
@@ -8,14 +8,20 @@ module WorkOS
8
8
  client_id: :client_id,
9
9
  client_secret: :client_secret,
10
10
  code: :code,
11
- grant_type: :grant_type
11
+ grant_type: :grant_type,
12
+ subject_token: :subject_token,
13
+ subject_token_type: :subject_token_type,
14
+ organization_id: :organization_id
12
15
  }.freeze
13
16
 
14
17
  attr_accessor \
15
18
  :client_id,
16
19
  :client_secret,
17
20
  :code,
18
- :grant_type
21
+ :grant_type,
22
+ :subject_token,
23
+ :subject_token_type,
24
+ :organization_id
19
25
 
20
26
  def initialize(json)
21
27
  hash = self.class.normalize(json)
@@ -23,6 +29,9 @@ module WorkOS
23
29
  @client_secret = hash[:client_secret]
24
30
  @code = hash[:code]
25
31
  @grant_type = hash[:grant_type]
32
+ @subject_token = hash[:subject_token]
33
+ @subject_token_type = hash[:subject_token_type]
34
+ @organization_id = hash[:organization_id]
26
35
  end
27
36
  end
28
37
  end
data/lib/workos/sso.rb CHANGED
@@ -7,6 +7,30 @@ require "uri"
7
7
 
8
8
  module WorkOS
9
9
  class SSO
10
+ # Identifies the protocol options (saml variant).
11
+ #
12
+ # @!attribute [r] saml_options
13
+ # @return [WorkOS::CreateConnectionSAMLOptions]
14
+ CreateProtocolOptionsSAML = Data.define(:saml_options)
15
+
16
+ # Identifies the protocol options (oidc variant).
17
+ #
18
+ # @!attribute [r] oidc_options
19
+ # @return [WorkOS::CreateConnectionOIDCOptions]
20
+ CreateProtocolOptionsOIDC = Data.define(:oidc_options)
21
+
22
+ # Identifies the protocol options (saml variant).
23
+ #
24
+ # @!attribute [r] saml_options
25
+ # @return [WorkOS::PatchConnectionSAMLOptions]
26
+ PatchProtocolOptionsSAML = Data.define(:saml_options)
27
+
28
+ # Identifies the protocol options (oidc variant).
29
+ #
30
+ # @!attribute [r] oidc_options
31
+ # @return [WorkOS::PatchConnectionOIDCOptions]
32
+ PatchProtocolOptionsOIDC = Data.define(:oidc_options)
33
+
10
34
  def initialize(client)
11
35
  @client = client
12
36
  end
@@ -71,6 +95,228 @@ module WorkOS
71
95
  )
72
96
  end
73
97
 
98
+ # Create a Connection
99
+ # @param organization_id [String] Unique identifier for the Organization in which the Connection resides.
100
+ # @param name [String, nil] A human-readable name for the Connection. This will most commonly be the organization's name.
101
+ # @param external_id [String, nil] The customer-owned identifier for the Connection.
102
+ # @param connection_type [String, nil] The type of the Connection. Only SAML and OIDC connection types may be created. When omitted, the type is inferred from the provided options.
103
+ # @param attribute_maps [WorkOS::CreateConnectionAttributeMaps, nil] How IdP attributes or claims map onto WorkOS profile fields. Provided fields override the defaults for the connection type.
104
+ # @param protocol_options [WorkOS::SSO::CreateProtocolOptionsSAML, WorkOS::SSO::CreateProtocolOptionsOIDC] Identifies the protocol options.
105
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
106
+ # @return [WorkOS::Connection]
107
+ def create_connection(
108
+ organization_id:,
109
+ protocol_options:,
110
+ name: nil,
111
+ external_id: nil,
112
+ connection_type: nil,
113
+ attribute_maps: nil,
114
+ request_options: {}
115
+ )
116
+ body = {
117
+ "organization_id" => organization_id,
118
+ "name" => name,
119
+ "external_id" => external_id,
120
+ "connection_type" => connection_type,
121
+ "attribute_maps" => attribute_maps
122
+ }.compact
123
+ case protocol_options
124
+ when WorkOS::SSO::CreateProtocolOptionsSAML
125
+ body["saml_options"] = protocol_options.saml_options
126
+ when WorkOS::SSO::CreateProtocolOptionsOIDC
127
+ body["oidc_options"] = protocol_options.oidc_options
128
+ else
129
+ raise ArgumentError, "expected protocol_options to be one of: WorkOS::SSO::CreateProtocolOptionsSAML, WorkOS::SSO::CreateProtocolOptionsOIDC, got #{protocol_options.class}"
130
+ end
131
+ response = @client.request(
132
+ method: :post,
133
+ path: "/connections",
134
+ auth: true,
135
+ body: body,
136
+ request_options: request_options
137
+ )
138
+ result = WorkOS::Connection.new(response.body)
139
+ 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"])
140
+ result
141
+ end
142
+
143
+ # List IdP signing certificates
144
+ # @param connection_id [String] Unique identifier for the Connection.
145
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
146
+ # @return [WorkOS::SAMLIdpSigningCertificateList]
147
+ def list_connection_saml_idp_signing_certs(
148
+ connection_id:,
149
+ request_options: {}
150
+ )
151
+ response = @client.request(
152
+ method: :get,
153
+ path: "/connections/#{WorkOS::Util.encode_path(connection_id)}/saml_idp_signing_certs",
154
+ auth: true,
155
+ request_options: request_options
156
+ )
157
+ result = WorkOS::SAMLIdpSigningCertificateList.new(response.body)
158
+ 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"])
159
+ result
160
+ end
161
+
162
+ # Create an IdP signing certificate
163
+ # @param connection_id [String] Unique identifier for the Connection.
164
+ # @param value [String] The PEM-encoded X.509 certificate.
165
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
166
+ # @return [WorkOS::SAMLIdpSigningCertificate]
167
+ def create_connection_saml_idp_signing_cert(
168
+ connection_id:,
169
+ value:,
170
+ request_options: {}
171
+ )
172
+ body = {
173
+ "value" => value
174
+ }
175
+ response = @client.request(
176
+ method: :post,
177
+ path: "/connections/#{WorkOS::Util.encode_path(connection_id)}/saml_idp_signing_certs",
178
+ auth: true,
179
+ body: body,
180
+ request_options: request_options
181
+ )
182
+ result = WorkOS::SAMLIdpSigningCertificate.new(response.body)
183
+ 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"])
184
+ result
185
+ end
186
+
187
+ # Delete an IdP signing certificate
188
+ # @param connection_id [String] Unique identifier for the Connection.
189
+ # @param certificate_id [String] Unique identifier for the Identity Provider signing certificate.
190
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
191
+ # @return [void]
192
+ def delete_connection_saml_idp_signing_cert(
193
+ connection_id:,
194
+ certificate_id:,
195
+ request_options: {}
196
+ )
197
+ @client.request(
198
+ method: :delete,
199
+ path: "/connections/#{WorkOS::Util.encode_path(connection_id)}/saml_idp_signing_certs/#{WorkOS::Util.encode_path(certificate_id)}",
200
+ auth: true,
201
+ request_options: request_options
202
+ )
203
+ nil
204
+ end
205
+
206
+ # List SP encryption certificates
207
+ # @param connection_id [String] Unique identifier for the Connection.
208
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
209
+ # @return [WorkOS::SAMLSpEncryptionCertificateList]
210
+ def list_connection_saml_sp_encryption_certs(
211
+ connection_id:,
212
+ request_options: {}
213
+ )
214
+ response = @client.request(
215
+ method: :get,
216
+ path: "/connections/#{WorkOS::Util.encode_path(connection_id)}/saml_sp_encryption_certs",
217
+ auth: true,
218
+ request_options: request_options
219
+ )
220
+ result = WorkOS::SAMLSpEncryptionCertificateList.new(response.body)
221
+ 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"])
222
+ result
223
+ end
224
+
225
+ # Create an SP encryption certificate
226
+ # @param connection_id [String] Unique identifier for the Connection.
227
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
228
+ # @return [WorkOS::SAMLSpEncryptionCertificate]
229
+ def create_connection_saml_sp_encryption_cert(
230
+ connection_id:,
231
+ request_options: {}
232
+ )
233
+ response = @client.request(
234
+ method: :post,
235
+ path: "/connections/#{WorkOS::Util.encode_path(connection_id)}/saml_sp_encryption_certs",
236
+ auth: true,
237
+ request_options: request_options
238
+ )
239
+ result = WorkOS::SAMLSpEncryptionCertificate.new(response.body)
240
+ 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"])
241
+ result
242
+ end
243
+
244
+ # Delete an SP encryption certificate
245
+ # @param connection_id [String] Unique identifier for the Connection.
246
+ # @param certificate_id [String] Unique identifier for the Service Provider encryption key pair. WorkOS holds the corresponding private key, which is never exposed.
247
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
248
+ # @return [void]
249
+ def delete_connection_saml_sp_encryption_cert(
250
+ connection_id:,
251
+ certificate_id:,
252
+ request_options: {}
253
+ )
254
+ @client.request(
255
+ method: :delete,
256
+ path: "/connections/#{WorkOS::Util.encode_path(connection_id)}/saml_sp_encryption_certs/#{WorkOS::Util.encode_path(certificate_id)}",
257
+ auth: true,
258
+ request_options: request_options
259
+ )
260
+ nil
261
+ end
262
+
263
+ # Get the SP signing certificate
264
+ # @param connection_id [String] Unique identifier for the Connection.
265
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
266
+ # @return [WorkOS::SAMLSpSigningCertificate]
267
+ def list_connection_saml_sp_signing_cert(
268
+ connection_id:,
269
+ request_options: {}
270
+ )
271
+ response = @client.request(
272
+ method: :get,
273
+ path: "/connections/#{WorkOS::Util.encode_path(connection_id)}/saml_sp_signing_cert",
274
+ auth: true,
275
+ request_options: request_options
276
+ )
277
+ result = WorkOS::SAMLSpSigningCertificate.new(response.body)
278
+ 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"])
279
+ result
280
+ end
281
+
282
+ # Create an SP signing certificate
283
+ # @param connection_id [String] Unique identifier for the Connection.
284
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
285
+ # @return [WorkOS::SAMLSpSigningCertificate]
286
+ def create_connection_saml_sp_signing_cert(
287
+ connection_id:,
288
+ request_options: {}
289
+ )
290
+ response = @client.request(
291
+ method: :post,
292
+ path: "/connections/#{WorkOS::Util.encode_path(connection_id)}/saml_sp_signing_cert",
293
+ auth: true,
294
+ request_options: request_options
295
+ )
296
+ result = WorkOS::SAMLSpSigningCertificate.new(response.body)
297
+ 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"])
298
+ result
299
+ end
300
+
301
+ # Delete the SP signing certificate
302
+ # @param connection_id [String] Unique identifier for the Connection.
303
+ # @param certificate_id [String] Unique identifier for the Service Provider signing key pair. WorkOS holds the corresponding private key, which is never exposed.
304
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
305
+ # @return [void]
306
+ def delete_connection_saml_sp_signing_cert(
307
+ connection_id:,
308
+ certificate_id:,
309
+ request_options: {}
310
+ )
311
+ @client.request(
312
+ method: :delete,
313
+ path: "/connections/#{WorkOS::Util.encode_path(connection_id)}/saml_sp_signing_cert/#{WorkOS::Util.encode_path(certificate_id)}",
314
+ auth: true,
315
+ request_options: request_options
316
+ )
317
+ nil
318
+ end
319
+
74
320
  # Get a Connection
75
321
  # @param id [String] Unique identifier for the Connection.
76
322
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
@@ -90,6 +336,52 @@ module WorkOS
90
336
  result
91
337
  end
92
338
 
339
+ # Update a Connection
340
+ # @param id [String] Unique identifier for the Connection.
341
+ # @param name [String, nil] A human-readable name for the Connection.
342
+ # @param external_id [String, nil] The customer-owned identifier for the Connection. Set to `null` to stop tracking one.
343
+ # @param connection_type [String, nil] The type of the Connection. Immutable after creation — it may be sent, but only with the Connection current type.
344
+ # @param attribute_maps [WorkOS::PatchConnectionAttributeMaps, nil] How IdP attributes or claims map onto WorkOS profile fields. Only the provided fields are updated.
345
+ # @param protocol_options [WorkOS::SSO::PatchProtocolOptionsSAML, WorkOS::SSO::PatchProtocolOptionsOIDC, nil] Identifies the protocol options.
346
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
347
+ # @return [WorkOS::Connection]
348
+ def update_connection(
349
+ id:,
350
+ name: nil,
351
+ external_id: WorkOS::OMIT,
352
+ connection_type: nil,
353
+ attribute_maps: nil,
354
+ protocol_options: nil,
355
+ request_options: {}
356
+ )
357
+ body = {
358
+ "name" => name,
359
+ "connection_type" => connection_type,
360
+ "attribute_maps" => attribute_maps
361
+ }.compact
362
+ body["external_id"] = external_id unless external_id.equal?(WorkOS::OMIT)
363
+ if protocol_options
364
+ case protocol_options
365
+ when WorkOS::SSO::PatchProtocolOptionsSAML
366
+ body["saml_options"] = protocol_options.saml_options
367
+ when WorkOS::SSO::PatchProtocolOptionsOIDC
368
+ body["oidc_options"] = protocol_options.oidc_options
369
+ else
370
+ raise ArgumentError, "expected protocol_options to be one of: WorkOS::SSO::PatchProtocolOptionsSAML, WorkOS::SSO::PatchProtocolOptionsOIDC, got #{protocol_options.class}"
371
+ end
372
+ end
373
+ response = @client.request(
374
+ method: :patch,
375
+ path: "/connections/#{WorkOS::Util.encode_path(id)}",
376
+ auth: true,
377
+ body: body,
378
+ request_options: request_options
379
+ )
380
+ result = WorkOS::Connection.new(response.body)
381
+ 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"])
382
+ result
383
+ end
384
+
93
385
  # Delete a Connection
94
386
  # @param id [String] Unique identifier for the Connection.
95
387
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
@@ -214,19 +506,28 @@ module WorkOS
214
506
  end
215
507
 
216
508
  # Get a Profile and Token
217
- # @param code [String] The authorization code received from the authorization callback.
509
+ # @param code [String, nil] The authorization code received from the authorization callback. Required when `grant_type` is `authorization_code`.
510
+ # @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
+ # @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
+ # @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.
218
513
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
219
514
  # @return [WorkOS::SSOTokenResponse]
220
515
  def get_profile_and_token(
221
- code:,
516
+ code: nil,
517
+ subject_token: nil,
518
+ subject_token_type: nil,
519
+ organization_id: nil,
222
520
  request_options: {}
223
521
  )
224
522
  body = {
225
523
  "grant_type" => "authorization_code",
226
524
  "client_id" => request_options[:client_id] || @client.client_id,
227
525
  "client_secret" => request_options[:api_key] || @client.api_key,
228
- "code" => code
229
- }
526
+ "code" => code,
527
+ "subject_token" => subject_token,
528
+ "subject_token_type" => subject_token_type,
529
+ "organization_id" => organization_id
530
+ }.compact
230
531
  response = @client.request(
231
532
  method: :post,
232
533
  path: "/sso/token",
@@ -0,0 +1,15 @@
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 AgentBlueprintsTokenMintTokenRequestType
8
+ USER_DELEGATED = "user_delegated"
9
+ AUTONOMOUS = "autonomous"
10
+ AGENT_DELEGATED = "agent_delegated"
11
+ REFRESH = "refresh"
12
+ ALL = [USER_DELEGATED, AUTONOMOUS, AGENT_DELEGATED, REFRESH].freeze
13
+ end
14
+ end
15
+ 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 AgentInstanceCreatedDataType
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
+ AgentInstanceDeletedDataType = AgentInstanceCreatedDataType
8
+ end
9
+ end
@@ -0,0 +1,14 @@
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 AgentInstanceSessionStatus
8
+ ACTIVE = "active"
9
+ REVOKED = "revoked"
10
+ EXPIRED = "expired"
11
+ ALL = [ACTIVE, REVOKED, EXPIRED].freeze
12
+ end
13
+ end
14
+ end