workos 7.1.1 → 8.0.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 (115) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/docs.yml +46 -0
  3. data/.gitignore +2 -0
  4. data/.last-synced-sha +1 -1
  5. data/.oagen-manifest.json +61 -40
  6. data/.release-please-manifest.json +1 -1
  7. data/.yardopts +6 -0
  8. data/CHANGELOG.md +38 -0
  9. data/Gemfile +6 -0
  10. data/Gemfile.lock +33 -2
  11. data/lib/workos/api_keys/api_key.rb +1 -1
  12. data/lib/workos/api_keys/api_key_created_data.rb +1 -1
  13. data/lib/workos/api_keys/organization_api_key.rb +43 -0
  14. data/lib/workos/{types/events_order.rb → api_keys/organization_api_key_owner.rb} +1 -3
  15. data/lib/workos/api_keys/organization_api_key_with_value.rb +46 -0
  16. data/lib/workos/{types/audit_logs_order.rb → api_keys/organization_api_key_with_value_owner.rb} +1 -3
  17. data/lib/workos/api_keys.rb +46 -46
  18. data/lib/workos/audit_logs.rb +6 -6
  19. data/lib/workos/authorization/user_organization_membership_base_list_data.rb +5 -2
  20. data/lib/workos/authorization/{role_assignment.rb → user_role_assignment.rb} +5 -2
  21. data/lib/workos/authorization/{role_assignment_resource.rb → user_role_assignment_resource.rb} +1 -1
  22. data/lib/workos/authorization.rb +250 -138
  23. data/lib/workos/base_client.rb +6 -1
  24. data/lib/workos/client.rb +4 -4
  25. data/lib/workos/connect.rb +2 -2
  26. data/lib/workos/directory_sync/directory_user.rb +3 -0
  27. data/lib/workos/directory_sync/directory_user_with_groups.rb +4 -1
  28. data/lib/workos/directory_sync/dsync_user_updated_data.rb +3 -0
  29. data/lib/workos/directory_sync.rb +6 -6
  30. data/lib/workos/encryptors/aes_gcm.rb +35 -3
  31. data/lib/workos/events.rb +2 -2
  32. data/lib/workos/feature_flags.rb +6 -6
  33. data/lib/workos/groups.rb +5 -5
  34. data/lib/workos/multi_factor_auth.rb +3 -3
  35. data/lib/workos/organization_domains.rb +1 -1
  36. data/lib/workos/organizations.rb +2 -2
  37. data/lib/workos/radar.rb +2 -2
  38. data/lib/workos/sso/profile.rb +3 -0
  39. data/lib/workos/sso.rb +4 -4
  40. data/lib/workos/types/event_context_actor_source.rb +2 -1
  41. data/lib/workos/types/{applications_order.rb → pagination_order.rb} +1 -1
  42. data/lib/workos/types/{vault_byok_key_verification_completed_data_key_provider.rb → vault_byok_key_provider.rb} +1 -1
  43. data/lib/workos/user_management/create_user_api_key.rb +25 -0
  44. data/lib/workos/user_management/organization_membership.rb +5 -2
  45. data/lib/workos/user_management/user_api_key.rb +43 -0
  46. data/lib/workos/user_management/user_api_key_created_data_owner.rb +25 -0
  47. data/lib/workos/{api_keys/api_key_with_value_owner.rb → user_management/user_api_key_owner.rb} +1 -1
  48. data/lib/workos/{types/webhooks_order.rb → user_management/user_api_key_revoked_data_owner.rb} +1 -3
  49. data/lib/workos/{api_keys/api_key_with_value.rb → user_management/user_api_key_with_value.rb} +2 -2
  50. data/lib/workos/{types/groups_order.rb → user_management/user_api_key_with_value_owner.rb} +1 -3
  51. data/lib/workos/user_management/user_organization_membership.rb +5 -2
  52. data/lib/workos/user_management.rb +181 -75
  53. data/lib/workos/user_management_organization_membership_groups.rb +2 -2
  54. data/lib/workos/vault/vault_byok_key_deleted.rb +34 -0
  55. data/lib/workos/vault/vault_byok_key_deleted_data.rb +22 -0
  56. data/lib/workos/version.rb +1 -1
  57. data/lib/workos/webhooks.rb +3 -3
  58. data/rbi/workos/api_key.rbi +2 -2
  59. data/rbi/workos/api_key_created_data.rbi +2 -2
  60. data/rbi/workos/api_key_revoked_data.rbi +2 -2
  61. data/rbi/workos/api_keys.rbi +17 -17
  62. data/rbi/workos/authorization.rbi +127 -27
  63. data/rbi/workos/client.rbi +3 -3
  64. data/rbi/workos/create_user_api_key.rbi +36 -0
  65. data/rbi/workos/directory_user.rbi +6 -0
  66. data/rbi/workos/directory_user_with_groups.rbi +6 -0
  67. data/rbi/workos/dsync_user_updated_data.rbi +6 -0
  68. data/rbi/workos/organization_api_key.rbi +72 -0
  69. data/rbi/workos/{api_key_with_value_owner.rbi → organization_api_key_owner.rbi} +1 -1
  70. data/rbi/workos/organization_api_key_with_value.rbi +78 -0
  71. data/rbi/workos/organization_api_key_with_value_owner.rbi +30 -0
  72. data/rbi/workos/organization_membership.rbi +6 -0
  73. data/rbi/workos/profile.rbi +6 -0
  74. data/rbi/workos/user_api_key.rbi +72 -0
  75. data/rbi/workos/user_api_key_created_data_owner.rbi +36 -0
  76. data/rbi/workos/user_api_key_owner.rbi +36 -0
  77. data/rbi/workos/user_api_key_revoked_data_owner.rbi +36 -0
  78. data/rbi/workos/{api_key_with_value.rbi → user_api_key_with_value.rbi} +3 -3
  79. data/rbi/workos/user_api_key_with_value_owner.rbi +36 -0
  80. data/rbi/workos/user_management.rbi +91 -14
  81. data/rbi/workos/user_organization_membership.rbi +6 -0
  82. data/rbi/workos/user_organization_membership_base_list_data.rbi +6 -0
  83. data/rbi/workos/{role_assignment.rbi → user_role_assignment.rbi} +9 -3
  84. data/rbi/workos/{role_assignment_resource.rbi → user_role_assignment_resource.rbi} +1 -1
  85. data/rbi/workos/vault_byok_key_deleted.rbi +54 -0
  86. data/rbi/workos/vault_byok_key_deleted_data.rbi +30 -0
  87. data/script/docs +16 -0
  88. data/script/docs-serve +12 -0
  89. data/script/llms-txt +37 -0
  90. data/test/workos/test_api_keys.rb +17 -17
  91. data/test/workos/test_audit_logs.rb +2 -2
  92. data/test/workos/test_authorization.rb +102 -20
  93. data/test/workos/test_encryptors_aes_gcm.rb +21 -0
  94. data/test/workos/test_model_round_trip.rb +278 -83
  95. data/test/workos/test_session.rb +68 -0
  96. data/test/workos/test_user_management.rb +69 -9
  97. data/test/workos/test_webhooks.rb +2 -2
  98. metadata +39 -33
  99. data/lib/workos/types/authorization_order.rb +0 -9
  100. data/lib/workos/types/connections_order.rb +0 -9
  101. data/lib/workos/types/directories_order.rb +0 -9
  102. data/lib/workos/types/directory_groups_order.rb +0 -9
  103. data/lib/workos/types/directory_users_order.rb +0 -9
  104. data/lib/workos/types/feature_flags_order.rb +0 -9
  105. data/lib/workos/types/organizations_api_keys_order.rb +0 -9
  106. data/lib/workos/types/organizations_feature_flags_order.rb +0 -9
  107. data/lib/workos/types/organizations_order.rb +0 -9
  108. data/lib/workos/types/permissions_order.rb +0 -9
  109. data/lib/workos/types/user_management_invitations_order.rb +0 -9
  110. data/lib/workos/types/user_management_multi_factor_authentication_order.rb +0 -9
  111. data/lib/workos/types/user_management_organization_membership_groups_order.rb +0 -9
  112. data/lib/workos/types/user_management_organization_membership_order.rb +0 -9
  113. data/lib/workos/types/user_management_users_authorized_applications_order.rb +0 -9
  114. data/lib/workos/types/user_management_users_feature_flags_order.rb +0 -9
  115. data/lib/workos/types/user_management_users_order.rb +0 -9
@@ -34,7 +34,12 @@ module WorkOS
34
34
  RETRY_BACKOFF_BASE = 0.5
35
35
  LOG_SEVERITY = {debug: 0, info: 1, warn: 2, error: 3, unknown: 4}.freeze
36
36
 
37
- USER_AGENT = "workos-ruby/#{WorkOS::VERSION} ruby/#{RUBY_VERSION} (#{RUBY_PLATFORM})"
37
+ USER_AGENT = [
38
+ "WorkOS",
39
+ "#{defined?(::RUBY_ENGINE) ? ::RUBY_ENGINE : "ruby"}/#{RUBY_VERSION}",
40
+ RUBY_PLATFORM,
41
+ "v#{WorkOS::VERSION}"
42
+ ].join("; ").freeze
38
43
 
39
44
  attr_reader :api_key, :base_url, :client_id, :timeout, :max_retries, :logger, :log_level
40
45
 
data/lib/workos/client.rb CHANGED
@@ -4,10 +4,6 @@
4
4
 
5
5
  module WorkOS
6
6
  class Client < BaseClient
7
- def api_keys
8
- @api_keys ||= WorkOS::ApiKeys.new(self)
9
- end
10
-
11
7
  def multi_factor_auth
12
8
  @multi_factor_auth ||= WorkOS::MultiFactorAuth.new(self)
13
9
  end
@@ -48,6 +44,10 @@ module WorkOS
48
44
  @organizations ||= WorkOS::Organizations.new(self)
49
45
  end
50
46
 
47
+ def api_keys
48
+ @api_keys ||= WorkOS::ApiKeys.new(self)
49
+ end
50
+
51
51
  def groups
52
52
  @groups ||= WorkOS::Groups.new(self)
53
53
  end
@@ -43,14 +43,14 @@ module WorkOS
43
43
  # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
44
44
  # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
45
45
  # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
46
- # @param order [WorkOS::Types::ApplicationsOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending.
46
+ # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending.
47
47
  # @param organization_id [String, nil] Filter Connect Applications by organization ID.
48
48
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
49
49
  # @return [WorkOS::Types::ListStruct<WorkOS::ConnectApplication>]
50
50
  def list_applications(
51
51
  before: nil,
52
52
  after: nil,
53
- limit: nil,
53
+ limit: 10,
54
54
  order: "desc",
55
55
  organization_id: nil,
56
56
  request_options: {}
@@ -13,6 +13,7 @@ module WorkOS
13
13
  email: :email,
14
14
  first_name: :first_name,
15
15
  last_name: :last_name,
16
+ name: :name,
16
17
  emails: :emails,
17
18
  job_title: :job_title,
18
19
  username: :username,
@@ -43,6 +44,7 @@ module WorkOS
43
44
  :email,
44
45
  :first_name,
45
46
  :last_name,
47
+ :name,
46
48
  :state,
47
49
  :custom_attributes,
48
50
  :role,
@@ -88,6 +90,7 @@ module WorkOS
88
90
  @email = hash[:email]
89
91
  @first_name = hash[:first_name]
90
92
  @last_name = hash[:last_name]
93
+ @name = hash[:name]
91
94
  @emails = (hash[:emails] || []).map { |item| item ? WorkOS::DirectoryUserEmail.new(item) : nil }
92
95
  @job_title = hash[:job_title]
93
96
  @username = hash[:username]
@@ -13,6 +13,7 @@ module WorkOS
13
13
  email: :email,
14
14
  first_name: :first_name,
15
15
  last_name: :last_name,
16
+ name: :name,
16
17
  emails: :emails,
17
18
  job_title: :job_title,
18
19
  username: :username,
@@ -35,7 +36,7 @@ module WorkOS
35
36
  # @!attribute raw_attributes
36
37
  # @deprecated The raw attributes received from the directory provider.
37
38
  # @!attribute groups
38
- # @deprecated The directory groups the user belongs to. Use the List Directory Groups endpoint with a user filter instead.
39
+ # @deprecated The directory groups the user belongs to. Deprecated: starting May 1, 2026, this field returns an empty array by default for newly created teams. Existing teams currently depending on this field should migrate to the new access pattern for better throughput performance — the field is unbounded by user, so users with many group memberships produce large, slow response payloads. Use the List Directory Groups endpoint with a `user` filter to fetch a user's group memberships.
39
40
 
40
41
  attr_accessor \
41
42
  :object,
@@ -46,6 +47,7 @@ module WorkOS
46
47
  :email,
47
48
  :first_name,
48
49
  :last_name,
50
+ :name,
49
51
  :state,
50
52
  :custom_attributes,
51
53
  :role,
@@ -98,6 +100,7 @@ module WorkOS
98
100
  @email = hash[:email]
99
101
  @first_name = hash[:first_name]
100
102
  @last_name = hash[:last_name]
103
+ @name = hash[:name]
101
104
  @emails = (hash[:emails] || []).map { |item| item ? WorkOS::DirectoryUserWithGroupsEmail.new(item) : nil }
102
105
  @job_title = hash[:job_title]
103
106
  @username = hash[:username]
@@ -13,6 +13,7 @@ module WorkOS
13
13
  email: :email,
14
14
  first_name: :first_name,
15
15
  last_name: :last_name,
16
+ name: :name,
16
17
  emails: :emails,
17
18
  job_title: :job_title,
18
19
  username: :username,
@@ -44,6 +45,7 @@ module WorkOS
44
45
  :email,
45
46
  :first_name,
46
47
  :last_name,
48
+ :name,
47
49
  :state,
48
50
  :custom_attributes,
49
51
  :role,
@@ -90,6 +92,7 @@ module WorkOS
90
92
  @email = hash[:email]
91
93
  @first_name = hash[:first_name]
92
94
  @last_name = hash[:last_name]
95
+ @name = hash[:name]
93
96
  @emails = (hash[:emails] || []).map { |item| item ? WorkOS::DsyncUserUpdatedDataEmail.new(item) : nil }
94
97
  @job_title = hash[:job_title]
95
98
  @username = hash[:username]
@@ -14,7 +14,7 @@ module WorkOS
14
14
  # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list.
15
15
  # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list.
16
16
  # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
17
- # @param order [WorkOS::Types::DirectoriesOrder, nil] Order the results by the creation time.
17
+ # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time.
18
18
  # @param organization_id [String, nil] Filter Directories by their associated organization.
19
19
  # @param search [String, nil] Searchable text to match against Directory names.
20
20
  # @param domain [String, nil] (deprecated) Filter Directories by their associated domain.
@@ -23,7 +23,7 @@ module WorkOS
23
23
  def list_directories(
24
24
  before: nil,
25
25
  after: nil,
26
- limit: nil,
26
+ limit: 10,
27
27
  order: "desc",
28
28
  organization_id: nil,
29
29
  search: nil,
@@ -106,7 +106,7 @@ module WorkOS
106
106
  # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
107
107
  # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
108
108
  # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
109
- # @param order [WorkOS::Types::DirectoryGroupsOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending.
109
+ # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending.
110
110
  # @param directory [String, nil] Unique identifier of the WorkOS Directory. This value can be obtained from the WorkOS dashboard or from the WorkOS API.
111
111
  # @param user [String, nil] Unique identifier of the WorkOS Directory User. This value can be obtained from the WorkOS API.
112
112
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
@@ -114,7 +114,7 @@ module WorkOS
114
114
  def list_groups(
115
115
  before: nil,
116
116
  after: nil,
117
- limit: nil,
117
+ limit: 10,
118
118
  order: "desc",
119
119
  directory: nil,
120
120
  user: nil,
@@ -177,7 +177,7 @@ module WorkOS
177
177
  # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
178
178
  # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
179
179
  # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
180
- # @param order [WorkOS::Types::DirectoryUsersOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending.
180
+ # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending.
181
181
  # @param directory [String, nil] Unique identifier of the WorkOS Directory. This value can be obtained from the WorkOS dashboard or from the WorkOS API.
182
182
  # @param group [String, nil] Unique identifier of the WorkOS Directory Group. This value can be obtained from the WorkOS API.
183
183
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
@@ -185,7 +185,7 @@ module WorkOS
185
185
  def list_users(
186
186
  before: nil,
187
187
  after: nil,
188
- limit: nil,
188
+ limit: 10,
189
189
  order: "desc",
190
190
  directory: nil,
191
191
  group: nil,
@@ -27,6 +27,18 @@ module WorkOS
27
27
 
28
28
  def unseal(sealed, key)
29
29
  raw = Base64.decode64(sealed.to_s)
30
+ decode_v7(raw, key)
31
+ rescue ArgumentError, OpenSSL::Cipher::CipherError => original_error
32
+ begin
33
+ decode_old(raw, key)
34
+ rescue ArgumentError, OpenSSL::Cipher::CipherError
35
+ raise original_error
36
+ end
37
+ end
38
+
39
+ private
40
+
41
+ def decode_v7(raw, key)
30
42
  raise ArgumentError, "Sealed payload too short" if raw.bytesize < 1 + 12 + 16
31
43
  version = raw.byteslice(0, 1).bytes.first
32
44
  raise ArgumentError, "Unknown seal version: #{version}" unless version == SEAL_VERSION
@@ -37,7 +49,29 @@ module WorkOS
37
49
  cipher.key = derive_key(key)
38
50
  cipher.iv = iv
39
51
  cipher.auth_tag = tag
40
- decoded = cipher.update(ciphertext) + cipher.final
52
+
53
+ parse_decoded(cipher.update(ciphertext) + cipher.final)
54
+ end
55
+
56
+ def decode_old(raw, key)
57
+ # v6 sealed sessions were Base64(iv + ciphertext + auth_tag) using the
58
+ # `encryptor` gem without the v7 version byte or key derivation.
59
+ raise ArgumentError, "Legacy sealed payload too short" if raw.bytesize < 12 + 16
60
+
61
+ iv = raw.byteslice(0, 12)
62
+ encrypted = raw.byteslice(12, raw.bytesize - 12)
63
+ ciphertext = encrypted.byteslice(0, encrypted.bytesize - 16)
64
+ tag = encrypted.byteslice(encrypted.bytesize - 16, 16)
65
+
66
+ cipher = OpenSSL::Cipher.new("aes-256-gcm").decrypt
67
+ cipher.key = key.to_s
68
+ cipher.iv = iv
69
+ cipher.auth_tag = tag
70
+
71
+ parse_decoded(cipher.update(ciphertext) + cipher.final)
72
+ end
73
+
74
+ def parse_decoded(decoded)
41
75
  decoded.force_encoding(Encoding::UTF_8)
42
76
  begin
43
77
  JSON.parse(decoded)
@@ -46,8 +80,6 @@ module WorkOS
46
80
  end
47
81
  end
48
82
 
49
- private
50
-
51
83
  def derive_key(passphrase)
52
84
  Digest::SHA256.digest(passphrase.to_s)
53
85
  end
data/lib/workos/events.rb CHANGED
@@ -14,7 +14,7 @@ module WorkOS
14
14
  # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
15
15
  # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
16
16
  # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
17
- # @param order [WorkOS::Types::EventsOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending.
17
+ # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending.
18
18
  # @param events [Array<String>, nil] Filter events by one or more event types (e.g. `dsync.user.created`).
19
19
  # @param range_start [String, nil] ISO-8601 date string to filter events created after this date.
20
20
  # @param range_end [String, nil] ISO-8601 date string to filter events created before this date.
@@ -24,7 +24,7 @@ module WorkOS
24
24
  def list_events(
25
25
  before: nil,
26
26
  after: nil,
27
- limit: nil,
27
+ limit: 10,
28
28
  order: "desc",
29
29
  events: nil,
30
30
  range_start: nil,
@@ -14,13 +14,13 @@ module WorkOS
14
14
  # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list.
15
15
  # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list.
16
16
  # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
17
- # @param order [WorkOS::Types::FeatureFlagsOrder, nil] Order the results by the creation time.
17
+ # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time.
18
18
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
19
19
  # @return [WorkOS::Types::ListStruct<WorkOS::Flag>]
20
20
  def list_feature_flags(
21
21
  before: nil,
22
22
  after: nil,
23
- limit: nil,
23
+ limit: 10,
24
24
  order: "desc",
25
25
  request_options: {}
26
26
  )
@@ -154,14 +154,14 @@ module WorkOS
154
154
  # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list.
155
155
  # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list.
156
156
  # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
157
- # @param order [WorkOS::Types::OrganizationsFeatureFlagsOrder, nil] Order the results by the creation time.
157
+ # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time.
158
158
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
159
159
  # @return [WorkOS::Types::ListStruct<WorkOS::Flag>]
160
160
  def list_organization_feature_flags(
161
161
  organization_id:,
162
162
  before: nil,
163
163
  after: nil,
164
- limit: nil,
164
+ limit: 10,
165
165
  order: "desc",
166
166
  request_options: {}
167
167
  )
@@ -201,14 +201,14 @@ module WorkOS
201
201
  # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list.
202
202
  # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list.
203
203
  # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
204
- # @param order [WorkOS::Types::UserManagementUsersFeatureFlagsOrder, nil] Order the results by the creation time.
204
+ # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time.
205
205
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
206
206
  # @return [WorkOS::Types::ListStruct<WorkOS::Flag>]
207
207
  def list_user_feature_flags(
208
208
  user_id:,
209
209
  before: nil,
210
210
  after: nil,
211
- limit: nil,
211
+ limit: 10,
212
212
  order: "desc",
213
213
  request_options: {}
214
214
  )
data/lib/workos/groups.rb CHANGED
@@ -15,14 +15,14 @@ module WorkOS
15
15
  # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
16
16
  # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
17
17
  # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
18
- # @param order [WorkOS::Types::GroupsOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending.
18
+ # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending.
19
19
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
20
20
  # @return [WorkOS::Types::ListStruct<WorkOS::Group>]
21
21
  def list_organization_groups(
22
22
  organization_id:,
23
23
  before: nil,
24
24
  after: nil,
25
- limit: nil,
25
+ limit: 10,
26
26
  order: "desc",
27
27
  request_options: {}
28
28
  )
@@ -161,7 +161,7 @@ module WorkOS
161
161
  # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
162
162
  # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
163
163
  # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
164
- # @param order [WorkOS::Types::GroupsOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending.
164
+ # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending.
165
165
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
166
166
  # @return [WorkOS::Types::ListStruct<WorkOS::UserOrganizationMembershipBaseListData>]
167
167
  def list_group_organization_memberships(
@@ -169,7 +169,7 @@ module WorkOS
169
169
  group_id:,
170
170
  before: nil,
171
171
  after: nil,
172
- limit: nil,
172
+ limit: 10,
173
173
  order: "desc",
174
174
  request_options: {}
175
175
  )
@@ -219,7 +219,7 @@ module WorkOS
219
219
  )
220
220
  body = {
221
221
  "organization_membership_id" => organization_membership_id
222
- }.compact
222
+ }
223
223
  response = @client.request(
224
224
  method: :post,
225
225
  path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/groups/#{WorkOS::Util.encode_path(group_id)}/organization-memberships",
@@ -22,7 +22,7 @@ module WorkOS
22
22
  )
23
23
  body = {
24
24
  "code" => code
25
- }.compact
25
+ }
26
26
  response = @client.request(
27
27
  method: :post,
28
28
  path: "/auth/challenges/#{WorkOS::Util.encode_path(id)}/verify",
@@ -136,14 +136,14 @@ module WorkOS
136
136
  # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list.
137
137
  # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list.
138
138
  # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
139
- # @param order [WorkOS::Types::UserManagementMultiFactorAuthenticationOrder, nil] Order the results by the creation time.
139
+ # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time.
140
140
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
141
141
  # @return [WorkOS::Types::ListStruct<WorkOS::AuthenticationFactor>]
142
142
  def list_user_auth_factors(
143
143
  userland_user_id:,
144
144
  before: nil,
145
145
  after: nil,
146
- limit: nil,
146
+ limit: 10,
147
147
  order: "desc",
148
148
  request_options: {}
149
149
  )
@@ -23,7 +23,7 @@ module WorkOS
23
23
  body = {
24
24
  "domain" => domain,
25
25
  "organization_id" => organization_id
26
- }.compact
26
+ }
27
27
  response = @client.request(
28
28
  method: :post,
29
29
  path: "/organization_domains",
@@ -14,7 +14,7 @@ module WorkOS
14
14
  # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
15
15
  # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
16
16
  # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
17
- # @param order [WorkOS::Types::OrganizationsOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending.
17
+ # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending.
18
18
  # @param domains [Array<String>, nil] The domains of an Organization. Any Organization with a matching domain will be returned.
19
19
  # @param search [String, nil] Searchable text for an Organization. Matches against the organization name.
20
20
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
@@ -22,7 +22,7 @@ module WorkOS
22
22
  def list_organizations(
23
23
  before: nil,
24
24
  after: nil,
25
- limit: nil,
25
+ limit: 10,
26
26
  order: "desc",
27
27
  domains: nil,
28
28
  search: nil,
data/lib/workos/radar.rb CHANGED
@@ -91,7 +91,7 @@ module WorkOS
91
91
  )
92
92
  body = {
93
93
  "entry" => entry
94
- }.compact
94
+ }
95
95
  response = @client.request(
96
96
  method: :post,
97
97
  path: "/radar/lists/#{WorkOS::Util.encode_path(type)}/#{WorkOS::Util.encode_path(action)}",
@@ -118,7 +118,7 @@ module WorkOS
118
118
  )
119
119
  body = {
120
120
  "entry" => entry
121
- }.compact
121
+ }
122
122
  @client.request(
123
123
  method: :delete,
124
124
  path: "/radar/lists/#{WorkOS::Util.encode_path(type)}/#{WorkOS::Util.encode_path(action)}",
@@ -14,6 +14,7 @@ module WorkOS
14
14
  email: :email,
15
15
  first_name: :first_name,
16
16
  last_name: :last_name,
17
+ name: :name,
17
18
  role: :role,
18
19
  roles: :roles,
19
20
  groups: :groups,
@@ -31,6 +32,7 @@ module WorkOS
31
32
  :email,
32
33
  :first_name,
33
34
  :last_name,
35
+ :name,
34
36
  :role,
35
37
  :roles,
36
38
  :groups,
@@ -48,6 +50,7 @@ module WorkOS
48
50
  @email = hash[:email]
49
51
  @first_name = hash[:first_name]
50
52
  @last_name = hash[:last_name]
53
+ @name = hash[:name]
51
54
  @role = hash[:role] ? WorkOS::SlimRole.new(hash[:role]) : nil
52
55
  @roles = (hash[:roles] || []).map { |item| item ? WorkOS::SlimRole.new(item) : nil }
53
56
  @groups = hash[:groups] || []
data/lib/workos/sso.rb CHANGED
@@ -14,7 +14,7 @@ module WorkOS
14
14
  # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list.
15
15
  # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list.
16
16
  # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
17
- # @param order [WorkOS::Types::ConnectionsOrder, nil] Order the results by the creation time.
17
+ # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time.
18
18
  # @param connection_type [WorkOS::Types::ConnectionsConnectionType, nil] Filter Connections by their type.
19
19
  # @param domain [String, nil] Filter Connections by their associated domain.
20
20
  # @param organization_id [String, nil] Filter Connections by their associated organization.
@@ -24,7 +24,7 @@ module WorkOS
24
24
  def list_connections(
25
25
  before: nil,
26
26
  after: nil,
27
- limit: nil,
27
+ limit: 10,
28
28
  order: "desc",
29
29
  connection_type: nil,
30
30
  domain: nil,
@@ -116,7 +116,7 @@ module WorkOS
116
116
  )
117
117
  body = {
118
118
  "profile_id" => profile_id
119
- }.compact
119
+ }
120
120
  response = @client.request(
121
121
  method: :post,
122
122
  path: "/sso/logout/authorize",
@@ -157,7 +157,7 @@ module WorkOS
157
157
  "client_id" => request_options[:client_id] || @client.client_id,
158
158
  "client_secret" => request_options[:api_key] || @client.api_key,
159
159
  "code" => code
160
- }.compact
160
+ }
161
161
  response = @client.request(
162
162
  method: :post,
163
163
  path: "/sso/token",
@@ -7,8 +7,9 @@ module WorkOS
7
7
  class EventContextActorSource
8
8
  API = "api"
9
9
  DASHBOARD = "dashboard"
10
+ ADMIN_PORTAL = "admin_portal"
10
11
  SYSTEM = "system"
11
- ALL = [API, DASHBOARD, SYSTEM].freeze
12
+ ALL = [API, DASHBOARD, ADMIN_PORTAL, SYSTEM].freeze
12
13
  end
13
14
  end
14
15
  end
@@ -4,7 +4,7 @@
4
4
 
5
5
  module WorkOS
6
6
  module Types
7
- class ApplicationsOrder
7
+ class PaginationOrder
8
8
  NORMAL = "normal"
9
9
  DESC = "desc"
10
10
  ASC = "asc"
@@ -4,7 +4,7 @@
4
4
 
5
5
  module WorkOS
6
6
  module Types
7
- class VaultByokKeyVerificationCompletedDataKeyProvider
7
+ class VaultByokKeyProvider
8
8
  AWS_KMS = "AWS_KMS"
9
9
  GCP_KMS = "GCP_KMS"
10
10
  AZURE_KEY_VAULT = "AZURE_KEY_VAULT"
@@ -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 CreateUserApiKey < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ name: :name,
9
+ organization_id: :organization_id,
10
+ permissions: :permissions
11
+ }.freeze
12
+
13
+ attr_accessor \
14
+ :name,
15
+ :organization_id,
16
+ :permissions
17
+
18
+ def initialize(json)
19
+ hash = self.class.normalize(json)
20
+ @name = hash[:name]
21
+ @organization_id = hash[:organization_id]
22
+ @permissions = hash[:permissions] || []
23
+ end
24
+ end
25
+ end
@@ -15,7 +15,8 @@ module WorkOS
15
15
  custom_attributes: :custom_attributes,
16
16
  created_at: :created_at,
17
17
  updated_at: :updated_at,
18
- role: :role
18
+ role: :role,
19
+ user: :user
19
20
  }.freeze
20
21
 
21
22
  attr_accessor \
@@ -29,7 +30,8 @@ module WorkOS
29
30
  :custom_attributes,
30
31
  :created_at,
31
32
  :updated_at,
32
- :role
33
+ :role,
34
+ :user
33
35
 
34
36
  def initialize(json)
35
37
  hash = self.class.normalize(json)
@@ -44,6 +46,7 @@ module WorkOS
44
46
  @created_at = hash[:created_at]
45
47
  @updated_at = hash[:updated_at]
46
48
  @role = hash[:role] ? WorkOS::SlimRole.new(hash[:role]) : nil
49
+ @user = hash[:user] ? WorkOS::User.new(hash[:user]) : nil
47
50
  end
48
51
  end
49
52
  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 UserApiKey < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ object: :object,
9
+ id: :id,
10
+ owner: :owner,
11
+ name: :name,
12
+ obfuscated_value: :obfuscated_value,
13
+ last_used_at: :last_used_at,
14
+ permissions: :permissions,
15
+ created_at: :created_at,
16
+ updated_at: :updated_at
17
+ }.freeze
18
+
19
+ attr_accessor \
20
+ :object,
21
+ :id,
22
+ :owner,
23
+ :name,
24
+ :obfuscated_value,
25
+ :last_used_at,
26
+ :permissions,
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
+ @owner = hash[:owner] ? WorkOS::UserApiKeyOwner.new(hash[:owner]) : nil
35
+ @name = hash[:name]
36
+ @obfuscated_value = hash[:obfuscated_value]
37
+ @last_used_at = hash[:last_used_at]
38
+ @permissions = hash[:permissions] || []
39
+ @created_at = hash[:created_at]
40
+ @updated_at = hash[:updated_at]
41
+ end
42
+ end
43
+ end