workos 5.22.0 → 5.24.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 65c18f67663b8681a74442c6771d1527b66fecd20a9c114557255d4ce8d9ca38
4
- data.tar.gz: 242b03d06e9caa456b3128d284fee00481fb4e7edec79934fd22c2e57598901b
3
+ metadata.gz: d7f42db282e0cd23cad458937055c17ec9fa9e82672b9aa1b888ce2200aa8891
4
+ data.tar.gz: 1e05a96b056eba6bef1e8f89d7ad6b2cabba616b3911c2afccee6133e8749b9f
5
5
  SHA512:
6
- metadata.gz: f6f3ccbbc9b6026beee00f92fcb8d87ce3f321ba8be4c808cd524daeb1dc1aa7fa13ef3c9c885096f83e8a68347b70a78d2d9297a396a8071727506e31787c9f
7
- data.tar.gz: d8f71832e8767dcfbcc2bcad5760ff5f59cbb3513a73708dc41c50dd5d4f3ac515788a8b81c596b9bb069244d912f3c3a2db9b1e39a0e34ff920bc87a7233b39
6
+ metadata.gz: 1f3282f8a5c632f2f03a98ce2c43824cfe2fbbb57b575ee51def000a5b03073b1ab284368f55543a79e3281223b6409854fdb98a45457b17268f9768a7717957
7
+ data.tar.gz: dbf3dd84bc9758fd141649e1dbb5c7d41fc06b6d5e8e64d1ae597e8188a87369783ecdae026c7b6a6f947afbc28c25fd475aa8f927cb422feb6766c6ddfa0804
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- workos (5.22.0)
4
+ workos (5.24.0)
5
5
  encryptor (~> 3.0)
6
6
  jwt (~> 2.8)
7
7
 
@@ -32,7 +32,6 @@ GEM
32
32
  rainbow (3.1.1)
33
33
  regexp_parser (2.10.0)
34
34
  rexml (3.4.1)
35
- strscan
36
35
  rspec (3.9.0)
37
36
  rspec-core (~> 3.9.0)
38
37
  rspec-expectations (~> 3.9.0)
@@ -59,11 +58,11 @@ GEM
59
58
  rubocop-ast (1.37.0)
60
59
  parser (>= 3.3.1.0)
61
60
  ruby-progressbar (1.13.0)
62
- strscan (3.1.0)
63
61
  unicode-display_width (3.1.4)
64
62
  unicode-emoji (~> 4.0, >= 4.0.4)
65
63
  unicode-emoji (4.0.4)
66
- vcr (5.0.0)
64
+ vcr (6.3.1)
65
+ base64
67
66
  webmock (3.23.0)
68
67
  addressable (>= 2.8.0)
69
68
  crack (>= 0.3.2)
@@ -76,7 +75,7 @@ DEPENDENCIES
76
75
  bundler (>= 2.0.1)
77
76
  rspec (~> 3.9.0)
78
77
  rubocop (~> 1.71)
79
- vcr (~> 5.0.0)
78
+ vcr (~> 6.0)
80
79
  webmock
81
80
  workos!
82
81
 
@@ -12,6 +12,7 @@ module WorkOS
12
12
  :domains,
13
13
  :stripe_customer_id,
14
14
  :name,
15
+ :external_id,
15
16
  :allow_profiles_outside_organization,
16
17
  :created_at,
17
18
  :updated_at,
@@ -22,6 +23,7 @@ module WorkOS
22
23
 
23
24
  @id = hash[:id]
24
25
  @name = hash[:name]
26
+ @external_id = hash[:external_id]
25
27
  @allow_profiles_outside_organization = hash[:allow_profiles_outside_organization]
26
28
  @domains = hash[:domains]
27
29
  @stripe_customer_id = hash[:stripe_customer_id]
@@ -33,6 +35,7 @@ module WorkOS
33
35
  {
34
36
  id: id,
35
37
  name: name,
38
+ external_id: external_id,
36
39
  allow_profiles_outside_organization: allow_profiles_outside_organization,
37
40
  domains: domains,
38
41
  stripe_customer_id: stripe_customer_id,
@@ -75,6 +75,7 @@ module WorkOS
75
75
  # @option domain_data [String] domain The domain that belongs to the organization.
76
76
  # @option domain_data [String] state The state of the domain. "verified" or "pending"
77
77
  # @param [String] name A unique, descriptive name for the organization
78
+ # @param [String] external_id The organization's external ID.
78
79
  # @param [String] idempotency_key An idempotency key
79
80
  # @param [Boolean, nil] allow_profiles_outside_organization Whether Connections
80
81
  # within the Organization allow profiles that are outside of the Organization's configured User Email Domains.
@@ -85,11 +86,13 @@ module WorkOS
85
86
  domain_data: nil,
86
87
  domains: nil,
87
88
  name:,
89
+ external_id: nil,
88
90
  allow_profiles_outside_organization: nil,
89
91
  idempotency_key: nil
90
92
  )
91
93
  body = { name: name }
92
94
  body[:domain_data] = domain_data if domain_data
95
+ body[:external_id] = external_id if external_id
93
96
 
94
97
  if domains
95
98
  warn_deprecation '`domains` is deprecated. Use `domain_data` instead.'
@@ -123,22 +126,26 @@ module WorkOS
123
126
  # @option domain_data [String] state The state of the domain. "verified" or "pending"
124
127
  # @param [String] stripe_customer_id The Stripe customer ID associated with this organization.
125
128
  # @param [String] name A unique, descriptive name for the organization
129
+ # @param [String] external_id The organization's external ID.
126
130
  # @param [Boolean, nil] allow_profiles_outside_organization Whether Connections
127
131
  # within the Organization allow profiles that are outside of the Organization's configured User Email Domains.
128
132
  # Deprecated: If you need to allow sign-ins from any email domain, contact suppport@workos.com.
129
133
  # @param [Array<String>] domains List of domains that belong to the organization.
130
134
  # Deprecated: Use domain_data instead.
135
+ # rubocop:disable Metrics/ParameterLists
131
136
  def update_organization(
132
137
  organization:,
133
138
  stripe_customer_id: nil,
134
139
  domain_data: nil,
135
140
  domains: nil,
136
141
  name: nil,
142
+ external_id: :not_set,
137
143
  allow_profiles_outside_organization: nil
138
144
  )
139
145
  body = { name: name }
140
146
  body[:domain_data] = domain_data if domain_data
141
147
  body[:stripe_customer_id] = stripe_customer_id if stripe_customer_id
148
+ body[:external_id] = external_id if external_id != :not_set
142
149
 
143
150
  if domains
144
151
  warn_deprecation '`domains` is deprecated. Use `domain_data` instead.'
@@ -162,6 +169,7 @@ module WorkOS
162
169
 
163
170
  WorkOS::Organization.new(response.body)
164
171
  end
172
+ # rubocop:enable Metrics/ParameterLists
165
173
 
166
174
  # Delete an Organization
167
175
  #
@@ -69,6 +69,8 @@ module WorkOS
69
69
  # that is preserved and available to the client in the response.
70
70
  # @param [String] login_hint Can be used to pre-fill the username/email address
71
71
  # field of the IdP sign-in page for the user, if you know their username ahead of time.
72
+ # @param [String] screen_hint Specify which AuthKit screen users should land on upon redirection
73
+ # (Only applicable when provider is 'authkit').
72
74
  # @param [String] domain_hint Can be used to pre-fill the domain field when
73
75
  # initiating authentication with Microsoft OAuth, or with a GoogleSAML connection type.
74
76
  # @param [Array<String>] provider_scopes An array of additional OAuth scopes to request from the provider.
@@ -94,6 +96,7 @@ module WorkOS
94
96
  client_id: nil,
95
97
  domain_hint: nil,
96
98
  login_hint: nil,
99
+ screen_hint: nil,
97
100
  provider: nil,
98
101
  connection_id: nil,
99
102
  organization_id: nil,
@@ -114,6 +117,7 @@ module WorkOS
114
117
  state: state,
115
118
  domain_hint: domain_hint,
116
119
  login_hint: login_hint,
120
+ screen_hint: screen_hint,
117
121
  provider: provider,
118
122
  connection_id: connection_id,
119
123
  organization_id: organization_id,
@@ -182,6 +186,7 @@ module WorkOS
182
186
  # @param [String] first_name The user's first name.
183
187
  # @param [String] last_name The user's last name.
184
188
  # @param [Boolean] email_verified Whether the user's email address was previously verified.
189
+ # @param [String] external_id The user's external ID.
185
190
  # @param [String] password_hash The user's hashed password.
186
191
  # @option [String] password_hash_type The algorithm originally used to hash the password.
187
192
  #
@@ -193,6 +198,7 @@ module WorkOS
193
198
  first_name: nil,
194
199
  last_name: nil,
195
200
  email_verified: nil,
201
+ external_id: nil,
196
202
  password_hash: nil,
197
203
  password_hash_type: nil
198
204
  )
@@ -204,6 +210,7 @@ module WorkOS
204
210
  first_name: first_name,
205
211
  last_name: last_name,
206
212
  email_verified: email_verified,
213
+ external_id: external_id,
207
214
  password_hash: password_hash,
208
215
  password_hash_type: password_hash_type,
209
216
  }.compact,
@@ -231,14 +238,14 @@ module WorkOS
231
238
  # @return [WorkOS::User]
232
239
  def update_user(
233
240
  id:,
234
- email: nil,
235
- first_name: nil,
236
- last_name: nil,
237
- email_verified: nil,
238
- external_id: nil,
239
- password: nil,
240
- password_hash: nil,
241
- password_hash_type: nil
241
+ email: :not_set,
242
+ first_name: :not_set,
243
+ last_name: :not_set,
244
+ email_verified: :not_set,
245
+ external_id: :not_set,
246
+ password: :not_set,
247
+ password_hash: :not_set,
248
+ password_hash_type: :not_set
242
249
  )
243
250
  request = put_request(
244
251
  path: "/user_management/users/#{id}",
@@ -251,7 +258,7 @@ module WorkOS
251
258
  password: password,
252
259
  password_hash: password_hash,
253
260
  password_hash_type: password_hash_type,
254
- }.compact,
261
+ }.reject { |_, v| v == :not_set },
255
262
  auth: true,
256
263
  )
257
264
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WorkOS
4
- VERSION = '5.22.0'
4
+ VERSION = '5.24.0'
5
5
  end
@@ -33,6 +33,21 @@ describe WorkOS::Organizations do
33
33
  end
34
34
  end
35
35
 
36
+ context 'with external_id' do
37
+ it 'creates an organization with external_id' do
38
+ VCR.use_cassette 'organization/create_with_external_id' do
39
+ organization = described_class.create_organization(
40
+ name: 'Test Organization with External ID',
41
+ external_id: 'ext_org_123',
42
+ )
43
+
44
+ expect(organization.id).to start_with('org_')
45
+ expect(organization.name).to eq('Test Organization with External ID')
46
+ expect(organization.external_id).to eq('ext_org_123')
47
+ end
48
+ end
49
+ end
50
+
36
51
  context 'with domains' do
37
52
  it 'creates an organization and warns' do
38
53
  VCR.use_cassette 'organization/create_with_domains' do
@@ -310,6 +325,43 @@ describe WorkOS::Organizations do
310
325
  end
311
326
  end
312
327
  end
328
+ context 'with an external_id' do
329
+ it 'updates the organization' do
330
+ VCR.use_cassette 'organization/update_with_external_id' do
331
+ organization = described_class.update_organization(
332
+ organization: 'org_01K0SQV0S6EPWK2ZDEFD1CP1JC',
333
+ name: 'Test Organization',
334
+ external_id: 'ext_org_456',
335
+ )
336
+
337
+ expect(organization.id).to eq('org_01K0SQV0S6EPWK2ZDEFD1CP1JC')
338
+ expect(organization.name).to eq('Test Organization')
339
+ expect(organization.external_id).to eq('ext_org_456')
340
+ end
341
+ end
342
+ end
343
+
344
+ context 'can set external_id to null explicitly' do
345
+ it 'includes external_id null in request body' do
346
+ original_method = described_class.method(:put_request)
347
+ allow(described_class).to receive(:put_request) do |kwargs|
348
+ original_method.call(**kwargs)
349
+ end
350
+
351
+ VCR.use_cassette 'organization/update_with_external_id_null' do
352
+ described_class.update_organization(
353
+ organization: 'org_01K0SQV0S6EPWK2ZDEFD1CP1JC',
354
+ name: 'Test Organization',
355
+ external_id: nil,
356
+ )
357
+ end
358
+
359
+ # Verify the spy captured the right call
360
+ expect(described_class).to have_received(:put_request).with(
361
+ hash_including(body: hash_including(external_id: nil)),
362
+ )
363
+ end
364
+ end
313
365
  end
314
366
 
315
367
  describe '.delete_organization' do
@@ -202,6 +202,41 @@ describe WorkOS::UserManagement do
202
202
  end
203
203
  end
204
204
 
205
+ context 'with a screen hint' do
206
+ let(:args) do
207
+ {
208
+ provider: 'authkit',
209
+ screen_hint: 'sign_up',
210
+ client_id: 'workos-proj-123',
211
+ redirect_uri: 'foo.com/auth/callback',
212
+ state: {
213
+ next_page: '/dashboard/edit',
214
+ }.to_s,
215
+ }
216
+ end
217
+ it 'returns a valid URL' do
218
+ authorization_url = described_class.authorization_url(**args)
219
+
220
+ expect(URI.parse(authorization_url)).to be_a URI
221
+ end
222
+
223
+ it 'returns the expected hostname' do
224
+ authorization_url = described_class.authorization_url(**args)
225
+
226
+ expect(URI.parse(authorization_url).host).to eq(WorkOS.config.api_hostname)
227
+ end
228
+
229
+ it 'returns the expected query string' do
230
+ authorization_url = described_class.authorization_url(**args)
231
+
232
+ expect(URI.parse(authorization_url).query).to eq(
233
+ 'client_id=workos-proj-123&redirect_uri=foo.com%2Fauth%2Fcallback' \
234
+ '&response_type=code&state=%7B%3Anext_page%3D%3E%22%2Fdashboard%2F' \
235
+ 'edit%22%7D&screen_hint=sign_up&provider=authkit',
236
+ )
237
+ end
238
+ end
239
+
205
240
  context 'with neither connection_id, organization_id or provider' do
206
241
  let(:args) do
207
242
  {
@@ -358,6 +393,22 @@ describe WorkOS::UserManagement do
358
393
  )
359
394
  end
360
395
 
396
+ it 'creates a user with external_id' do
397
+ VCR.use_cassette 'user_management/create_user_with_external_id' do
398
+ user = described_class.create_user(
399
+ email: 'external@example.com',
400
+ first_name: 'External',
401
+ last_name: 'User',
402
+ external_id: 'ext_user_123',
403
+ )
404
+
405
+ expect(user.first_name).to eq('External')
406
+ expect(user.last_name).to eq('User')
407
+ expect(user.email).to eq('external@example.com')
408
+ expect(user.external_id).to eq('ext_user_123')
409
+ end
410
+ end
411
+
361
412
  context 'with an invalid payload' do
362
413
  it 'returns an error' do
363
414
  VCR.use_cassette 'user_management/create_user_invalid' do
@@ -426,6 +477,25 @@ describe WorkOS::UserManagement do
426
477
  )
427
478
  end
428
479
 
480
+ it 'can set external_id to null explicitly' do
481
+ original_method = described_class.method(:put_request)
482
+ allow(described_class).to receive(:put_request) do |kwargs|
483
+ original_method.call(**kwargs)
484
+ end
485
+
486
+ VCR.use_cassette 'user_management/update_user_external_id_null' do
487
+ described_class.update_user(
488
+ id: 'user_01K0SR53HJ58M957MYAB6TDZ9X',
489
+ first_name: 'John',
490
+ external_id: nil,
491
+ )
492
+ end
493
+
494
+ expect(described_class).to have_received(:put_request).with(
495
+ hash_including(body: hash_including(external_id: nil)),
496
+ )
497
+ end
498
+
429
499
  context 'with an invalid payload' do
430
500
  it 'returns an error' do
431
501
  VCR.use_cassette 'user_management/update_user/invalid' do
@@ -0,0 +1,83 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.workos.com/organizations
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"name":"Test Organization with External ID","external_id":"ext_org_123"}'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - "*/*"
16
+ User-Agent:
17
+ - WorkOS; ruby/3.1.4; arm64-darwin24; v5.20.0
18
+ Authorization:
19
+ - Bearer <API_KEY>
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: Created
24
+ headers:
25
+ Date:
26
+ - Tue, 22 Jul 2025 18:55:20 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Content-Length:
30
+ - '286'
31
+ Connection:
32
+ - keep-alive
33
+ Cf-Ray:
34
+ - 963526d76e29aafd-YYZ
35
+ Cf-Cache-Status:
36
+ - DYNAMIC
37
+ Etag:
38
+ - W/"11e-Op9TWXVRjSmUm44yQl7F4OmXvVQ"
39
+ Strict-Transport-Security:
40
+ - max-age=15552000; includeSubDomains
41
+ Vary:
42
+ - Origin, Accept-Encoding
43
+ Access-Control-Allow-Credentials:
44
+ - 'true'
45
+ Content-Security-Policy:
46
+ - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
47
+ https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
48
+ ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
49
+ Expect-Ct:
50
+ - max-age=0
51
+ Referrer-Policy:
52
+ - no-referrer
53
+ X-Content-Type-Options:
54
+ - nosniff
55
+ X-Dns-Prefetch-Control:
56
+ - 'off'
57
+ X-Download-Options:
58
+ - noopen
59
+ X-Frame-Options:
60
+ - SAMEORIGIN
61
+ X-Permitted-Cross-Domain-Policies:
62
+ - none
63
+ X-Request-Id:
64
+ - 56c9630e-4889-4c81-989b-5a0399cdfcc2
65
+ X-Xss-Protection:
66
+ - '0'
67
+ Report-To:
68
+ - '{"endpoints":[{"url":"https:\/\/csp-reporting.cloudflare.com\/cdn-cgi\/script_monitor\/report?m=RvRh6EQA2egPx6JdFhsw.m.1RATK00LOdPev9hq3f8A-1753210520-1.0.1.1-Uchst_eeyl0_BAQRRODtUIhYDUBNZKYADoELB62ZrhleV2Q.J_Wdk59lUFdfwSqAAX2vWrW_nejregFofyr3sox0aNmZolb8G_7Nzpy2RD9uyKH4l3OgsDbo.LRttnqfDPXocdCCB9G61E4QJ8Q1ug"}],"group":"cf-csp-endpoint","max_age":86400}'
69
+ Content-Security-Policy-Report-Only:
70
+ - script-src 'none'; connect-src 'none'; report-uri https://csp-reporting.cloudflare.com/cdn-cgi/script_monitor/report?m=RvRh6EQA2egPx6JdFhsw.m.1RATK00LOdPev9hq3f8A-1753210520-1.0.1.1-Uchst_eeyl0_BAQRRODtUIhYDUBNZKYADoELB62ZrhleV2Q.J_Wdk59lUFdfwSqAAX2vWrW_nejregFofyr3sox0aNmZolb8G_7Nzpy2RD9uyKH4l3OgsDbo.LRttnqfDPXocdCCB9G61E4QJ8Q1ug;
71
+ report-to cf-csp-endpoint
72
+ Set-Cookie:
73
+ - _cfuvid=PQ8Lx7_xKyiAL1Mx.Ib3Gjf0xXL4n9.aJfbpov473xY-1753210520423-0.0.1.1-604800000;
74
+ path=/; domain=.workos.com; HttpOnly; Secure; SameSite=None
75
+ Server:
76
+ - cloudflare
77
+ body:
78
+ encoding: UTF-8
79
+ string: '{"object":"organization","id":"org_01K0SQV0S6EPWK2ZDEFD1CP1JC","name":"Test
80
+ Organization with External ID","allow_profiles_outside_organization":false,"created_at":"2025-07-22T18:55:20.355Z","updated_at":"2025-07-22T18:55:20.355Z","domains":[],"metadata":{},"external_id":"ext_org_123"}'
81
+ http_version:
82
+ recorded_at: Tue, 22 Jul 2025 18:55:20 GMT
83
+ recorded_with: VCR 5.0.0
@@ -0,0 +1,78 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: https://api.workos.com/organizations/org_01K0SQV0S6EPWK2ZDEFD1CP1JC
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"name":"Test Organization","external_id":"ext_org_456"}'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - "*/*"
16
+ User-Agent:
17
+ - WorkOS; ruby/3.1.4; arm64-darwin24; v5.20.0
18
+ Authorization:
19
+ - Bearer <API_KEY>
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Tue, 22 Jul 2025 18:59:20 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Cf-Ray:
34
+ - 96352cb1598936bf-YYZ
35
+ Cf-Cache-Status:
36
+ - DYNAMIC
37
+ Etag:
38
+ - W/"10d-7PesLGj94PWb6A5HO530ZxGdEf4"
39
+ Strict-Transport-Security:
40
+ - max-age=15552000; includeSubDomains
41
+ Vary:
42
+ - Origin, Accept-Encoding
43
+ Access-Control-Allow-Credentials:
44
+ - 'true'
45
+ Content-Security-Policy:
46
+ - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
47
+ https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
48
+ ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
49
+ Expect-Ct:
50
+ - max-age=0
51
+ Referrer-Policy:
52
+ - no-referrer
53
+ X-Content-Type-Options:
54
+ - nosniff
55
+ X-Dns-Prefetch-Control:
56
+ - 'off'
57
+ X-Download-Options:
58
+ - noopen
59
+ X-Frame-Options:
60
+ - SAMEORIGIN
61
+ X-Permitted-Cross-Domain-Policies:
62
+ - none
63
+ X-Request-Id:
64
+ - fdca4330-1a27-4bd5-9e78-75e58eefb233
65
+ X-Xss-Protection:
66
+ - '0'
67
+ Set-Cookie:
68
+ - _cfuvid=hbA98zPccWnkbrQxoYNYNSHeQq3brYDB.grPijC_WV4-1753210760158-0.0.1.1-604800000;
69
+ path=/; domain=.workos.com; HttpOnly; Secure; SameSite=None
70
+ Server:
71
+ - cloudflare
72
+ body:
73
+ encoding: ASCII-8BIT
74
+ string: '{"object":"organization","id":"org_01K0SQV0S6EPWK2ZDEFD1CP1JC","name":"Test
75
+ Organization","allow_profiles_outside_organization":false,"created_at":"2025-07-22T18:55:20.355Z","updated_at":"2025-07-22T18:59:20.064Z","domains":[],"metadata":{},"external_id":"ext_org_456"}'
76
+ http_version:
77
+ recorded_at: Tue, 22 Jul 2025 18:59:20 GMT
78
+ recorded_with: VCR 5.0.0
@@ -0,0 +1,78 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: https://api.workos.com/organizations/org_01K0SQV0S6EPWK2ZDEFD1CP1JC
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"name":"Test Organization","external_id":null}'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - "*/*"
16
+ User-Agent:
17
+ - WorkOS; ruby/3.1.4; arm64-darwin24; v5.22.0
18
+ Authorization:
19
+ - Bearer <API_KEY>
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Wed, 23 Jul 2025 14:19:40 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Cf-Ray:
34
+ - 963bd06b7d9fac70-YYZ
35
+ Cf-Cache-Status:
36
+ - DYNAMIC
37
+ Etag:
38
+ - W/"104-iVnG8ziU2vR/dhIQFse9HLEGA6c"
39
+ Strict-Transport-Security:
40
+ - max-age=15552000; includeSubDomains
41
+ Vary:
42
+ - Origin, Accept-Encoding
43
+ Access-Control-Allow-Credentials:
44
+ - 'true'
45
+ Content-Security-Policy:
46
+ - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
47
+ https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
48
+ ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
49
+ Expect-Ct:
50
+ - max-age=0
51
+ Referrer-Policy:
52
+ - no-referrer
53
+ X-Content-Type-Options:
54
+ - nosniff
55
+ X-Dns-Prefetch-Control:
56
+ - 'off'
57
+ X-Download-Options:
58
+ - noopen
59
+ X-Frame-Options:
60
+ - SAMEORIGIN
61
+ X-Permitted-Cross-Domain-Policies:
62
+ - none
63
+ X-Request-Id:
64
+ - f38969a5-158e-4ed5-b165-a7789d1b0a07
65
+ X-Xss-Protection:
66
+ - '0'
67
+ Set-Cookie:
68
+ - _cfuvid=7pLWC5qh1CKmolFiECCkKsRg3QAx7aM07F6bX4r6VMU-1753280380885-0.0.1.1-604800000;
69
+ path=/; domain=.workos.com; HttpOnly; Secure; SameSite=None
70
+ Server:
71
+ - cloudflare
72
+ body:
73
+ encoding: ASCII-8BIT
74
+ string: '{"object":"organization","id":"org_01K0SQV0S6EPWK2ZDEFD1CP1JC","name":"Test
75
+ Organization","allow_profiles_outside_organization":false,"created_at":"2025-07-22T18:55:20.355Z","updated_at":"2025-07-23T14:19:40.831Z","domains":[],"metadata":{},"external_id":null}'
76
+ http_version:
77
+ recorded_at: Wed, 23 Jul 2025 14:19:40 GMT
78
+ recorded_with: VCR 5.0.0
@@ -0,0 +1,77 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.workos.com/user_management/users
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"email":"external@example.com","password":null,"first_name":"External","last_name":"User","email_verified":null,"external_id":"ext_user_123","password_hash":null,"password_hash_type":null}'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - "*/*"
16
+ User-Agent:
17
+ - WorkOS; ruby/3.1.4; arm64-darwin24; v5.20.0
18
+ Authorization:
19
+ - Bearer <API_KEY>
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: Created
24
+ headers:
25
+ Date:
26
+ - Tue, 22 Jul 2025 19:00:50 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Content-Length:
30
+ - '326'
31
+ Connection:
32
+ - keep-alive
33
+ Cf-Ray:
34
+ - 96352ee9395c36b3-YYZ
35
+ Cf-Cache-Status:
36
+ - DYNAMIC
37
+ Etag:
38
+ - W/"146-upR+rp+FopOrmNrHPnshQZCSTFg"
39
+ Strict-Transport-Security:
40
+ - max-age=15552000; includeSubDomains
41
+ Vary:
42
+ - Origin, Accept-Encoding
43
+ Access-Control-Allow-Credentials:
44
+ - 'true'
45
+ Content-Security-Policy:
46
+ - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
47
+ https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
48
+ ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
49
+ Expect-Ct:
50
+ - max-age=0
51
+ Referrer-Policy:
52
+ - no-referrer
53
+ X-Content-Type-Options:
54
+ - nosniff
55
+ X-Dns-Prefetch-Control:
56
+ - 'off'
57
+ X-Download-Options:
58
+ - noopen
59
+ X-Frame-Options:
60
+ - SAMEORIGIN
61
+ X-Permitted-Cross-Domain-Policies:
62
+ - none
63
+ X-Request-Id:
64
+ - 0ca01f80-ab79-4dac-ac38-85013ee190fc
65
+ X-Xss-Protection:
66
+ - '0'
67
+ Set-Cookie:
68
+ - _cfuvid=eS3jraDP_ZTVdNpNKtpQG80hPBRXhXcHuq1V_QbAQjY-1753210850912-0.0.1.1-604800000;
69
+ path=/; domain=.workos.com; HttpOnly; Secure; SameSite=None
70
+ Server:
71
+ - cloudflare
72
+ body:
73
+ encoding: UTF-8
74
+ string: '{"object":"user","id":"user_01K0SR53HJ58M957MYAB6TDZ9X","email":"external@example.com","email_verified":false,"first_name":"External","last_name":"User","profile_picture_url":null,"metadata":{},"last_sign_in_at":null,"created_at":"2025-07-22T19:00:50.852Z","updated_at":"2025-07-22T19:00:50.852Z","external_id":"ext_user_123"}'
75
+ http_version:
76
+ recorded_at: Tue, 22 Jul 2025 19:00:50 GMT
77
+ recorded_with: VCR 5.0.0
@@ -0,0 +1,77 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: https://api.workos.com/user_management/users/user_01K0SR53HJ58M957MYAB6TDZ9X
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"first_name":"John","external_id":null}'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - "*/*"
16
+ User-Agent:
17
+ - WorkOS; ruby/3.1.4; arm64-darwin24; v5.22.0
18
+ Authorization:
19
+ - Bearer <API_KEY>
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Wed, 23 Jul 2025 14:19:37 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Cf-Ray:
34
+ - 963bd0578b723987-YYZ
35
+ Cf-Cache-Status:
36
+ - DYNAMIC
37
+ Etag:
38
+ - W/"138-cAQWhb1gyLa/WXSej+rjaxcQD5k"
39
+ Strict-Transport-Security:
40
+ - max-age=15552000; includeSubDomains
41
+ Vary:
42
+ - Origin, Accept-Encoding
43
+ Access-Control-Allow-Credentials:
44
+ - 'true'
45
+ Content-Security-Policy:
46
+ - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
47
+ https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
48
+ ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
49
+ Expect-Ct:
50
+ - max-age=0
51
+ Referrer-Policy:
52
+ - no-referrer
53
+ X-Content-Type-Options:
54
+ - nosniff
55
+ X-Dns-Prefetch-Control:
56
+ - 'off'
57
+ X-Download-Options:
58
+ - noopen
59
+ X-Frame-Options:
60
+ - SAMEORIGIN
61
+ X-Permitted-Cross-Domain-Policies:
62
+ - none
63
+ X-Request-Id:
64
+ - e32c5c22-9dba-480d-9b70-cb985f8de386
65
+ X-Xss-Protection:
66
+ - '0'
67
+ Set-Cookie:
68
+ - _cfuvid=0ljO.TFpHbzOeVWd7XzlanO5UxaeU_RBUAsoWNtWaF0-1753280377738-0.0.1.1-604800000;
69
+ path=/; domain=.workos.com; HttpOnly; Secure; SameSite=None
70
+ Server:
71
+ - cloudflare
72
+ body:
73
+ encoding: ASCII-8BIT
74
+ string: '{"object":"user","id":"user_01K0SR53HJ58M957MYAB6TDZ9X","email":"external@example.com","email_verified":false,"first_name":"John","last_name":"User","profile_picture_url":null,"metadata":{},"last_sign_in_at":null,"created_at":"2025-07-22T19:00:50.852Z","updated_at":"2025-07-23T14:19:37.660Z","external_id":null}'
75
+ http_version:
76
+ recorded_at: Wed, 23 Jul 2025 14:19:37 GMT
77
+ recorded_with: VCR 5.0.0
data/workos.gemspec CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.add_development_dependency 'bundler', '>= 2.0.1'
28
28
  spec.add_development_dependency 'rspec', '~> 3.9.0'
29
29
  spec.add_development_dependency 'rubocop', '~> 1.71'
30
- spec.add_development_dependency 'vcr', '~> 5.0.0'
30
+ spec.add_development_dependency 'vcr', '~> 6.0'
31
31
  spec.add_development_dependency 'webmock'
32
32
 
33
33
  spec.required_ruby_version = '>= 3.1'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workos
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.22.0
4
+ version: 5.24.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - WorkOS
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-07-22 00:00:00.000000000 Z
11
+ date: 2025-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: encryptor
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 5.0.0
89
+ version: '6.0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 5.0.0
96
+ version: '6.0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: webmock
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -266,6 +266,7 @@ files:
266
266
  - spec/support/fixtures/vcr_cassettes/organization/create_with_domains.yml
267
267
  - spec/support/fixtures/vcr_cassettes/organization/create_with_duplicate_idempotency_key_and_different_payload.yml
268
268
  - spec/support/fixtures/vcr_cassettes/organization/create_with_duplicate_idempotency_key_and_payload.yml
269
+ - spec/support/fixtures/vcr_cassettes/organization/create_with_external_id.yml
269
270
  - spec/support/fixtures/vcr_cassettes/organization/create_with_idempotency_key.yml
270
271
  - spec/support/fixtures/vcr_cassettes/organization/create_without_domains.yml
271
272
  - spec/support/fixtures/vcr_cassettes/organization/delete.yml
@@ -275,6 +276,8 @@ files:
275
276
  - spec/support/fixtures/vcr_cassettes/organization/list.yml
276
277
  - spec/support/fixtures/vcr_cassettes/organization/list_organization_roles.yml
277
278
  - spec/support/fixtures/vcr_cassettes/organization/update.yml
279
+ - spec/support/fixtures/vcr_cassettes/organization/update_with_external_id.yml
280
+ - spec/support/fixtures/vcr_cassettes/organization/update_with_external_id_null.yml
278
281
  - spec/support/fixtures/vcr_cassettes/organization/update_with_stripe_customer_id.yml
279
282
  - spec/support/fixtures/vcr_cassettes/organization/update_without_name.yml
280
283
  - spec/support/fixtures/vcr_cassettes/passwordless/create_session.yml
@@ -324,6 +327,7 @@ files:
324
327
  - spec/support/fixtures/vcr_cassettes/user_management/create_password_reset/valid.yml
325
328
  - spec/support/fixtures/vcr_cassettes/user_management/create_user_invalid.yml
326
329
  - spec/support/fixtures/vcr_cassettes/user_management/create_user_valid.yml
330
+ - spec/support/fixtures/vcr_cassettes/user_management/create_user_with_external_id.yml
327
331
  - spec/support/fixtures/vcr_cassettes/user_management/deactivate_organization_membership.yml
328
332
  - spec/support/fixtures/vcr_cassettes/user_management/delete_organization_membership/invalid.yml
329
333
  - spec/support/fixtures/vcr_cassettes/user_management/delete_organization_membership/valid.yml
@@ -374,6 +378,7 @@ files:
374
378
  - spec/support/fixtures/vcr_cassettes/user_management/update_user/email.yml
375
379
  - spec/support/fixtures/vcr_cassettes/user_management/update_user/invalid.yml
376
380
  - spec/support/fixtures/vcr_cassettes/user_management/update_user/valid.yml
381
+ - spec/support/fixtures/vcr_cassettes/user_management/update_user_external_id_null.yml
377
382
  - spec/support/fixtures/vcr_cassettes/user_management/update_user_password/invalid.yml
378
383
  - spec/support/fixtures/vcr_cassettes/user_management/update_user_password/valid.yml
379
384
  - spec/support/fixtures/vcr_cassettes/user_management/verify_email/invalid_code.yml
@@ -491,6 +496,7 @@ test_files:
491
496
  - spec/support/fixtures/vcr_cassettes/organization/create_with_domains.yml
492
497
  - spec/support/fixtures/vcr_cassettes/organization/create_with_duplicate_idempotency_key_and_different_payload.yml
493
498
  - spec/support/fixtures/vcr_cassettes/organization/create_with_duplicate_idempotency_key_and_payload.yml
499
+ - spec/support/fixtures/vcr_cassettes/organization/create_with_external_id.yml
494
500
  - spec/support/fixtures/vcr_cassettes/organization/create_with_idempotency_key.yml
495
501
  - spec/support/fixtures/vcr_cassettes/organization/create_without_domains.yml
496
502
  - spec/support/fixtures/vcr_cassettes/organization/delete.yml
@@ -500,6 +506,8 @@ test_files:
500
506
  - spec/support/fixtures/vcr_cassettes/organization/list.yml
501
507
  - spec/support/fixtures/vcr_cassettes/organization/list_organization_roles.yml
502
508
  - spec/support/fixtures/vcr_cassettes/organization/update.yml
509
+ - spec/support/fixtures/vcr_cassettes/organization/update_with_external_id.yml
510
+ - spec/support/fixtures/vcr_cassettes/organization/update_with_external_id_null.yml
503
511
  - spec/support/fixtures/vcr_cassettes/organization/update_with_stripe_customer_id.yml
504
512
  - spec/support/fixtures/vcr_cassettes/organization/update_without_name.yml
505
513
  - spec/support/fixtures/vcr_cassettes/passwordless/create_session.yml
@@ -549,6 +557,7 @@ test_files:
549
557
  - spec/support/fixtures/vcr_cassettes/user_management/create_password_reset/valid.yml
550
558
  - spec/support/fixtures/vcr_cassettes/user_management/create_user_invalid.yml
551
559
  - spec/support/fixtures/vcr_cassettes/user_management/create_user_valid.yml
560
+ - spec/support/fixtures/vcr_cassettes/user_management/create_user_with_external_id.yml
552
561
  - spec/support/fixtures/vcr_cassettes/user_management/deactivate_organization_membership.yml
553
562
  - spec/support/fixtures/vcr_cassettes/user_management/delete_organization_membership/invalid.yml
554
563
  - spec/support/fixtures/vcr_cassettes/user_management/delete_organization_membership/valid.yml
@@ -599,6 +608,7 @@ test_files:
599
608
  - spec/support/fixtures/vcr_cassettes/user_management/update_user/email.yml
600
609
  - spec/support/fixtures/vcr_cassettes/user_management/update_user/invalid.yml
601
610
  - spec/support/fixtures/vcr_cassettes/user_management/update_user/valid.yml
611
+ - spec/support/fixtures/vcr_cassettes/user_management/update_user_external_id_null.yml
602
612
  - spec/support/fixtures/vcr_cassettes/user_management/update_user_password/invalid.yml
603
613
  - spec/support/fixtures/vcr_cassettes/user_management/update_user_password/valid.yml
604
614
  - spec/support/fixtures/vcr_cassettes/user_management/verify_email/invalid_code.yml