workos 2.0.0 → 2.2.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 +4 -4
- data/.semaphore/semaphore.yml +13 -39
- data/Gemfile.lock +2 -2
- data/README.md +4 -0
- data/lib/workos/challenge.rb +54 -0
- data/lib/workos/client.rb +2 -0
- data/lib/workos/directory_sync.rb +1 -0
- data/lib/workos/errors.rb +3 -1
- data/lib/workos/factor.rb +58 -0
- data/lib/workos/mfa.rb +165 -0
- data/lib/workos/sso.rb +38 -15
- data/lib/workos/types/challenge_struct.rb +18 -0
- data/lib/workos/types/factor_struct.rb +19 -0
- data/lib/workos/types/verify_factor_struct.rb +15 -0
- data/lib/workos/types.rb +3 -0
- data/lib/workos/verify_factor.rb +39 -0
- data/lib/workos/version.rb +1 -1
- data/lib/workos/webhooks.rb +9 -7
- data/lib/workos.rb +5 -0
- data/spec/lib/workos/mfa_spec.rb +232 -0
- data/spec/lib/workos/sso_spec.rb +140 -4
- data/spec/lib/workos/webhooks_spec.rb +1 -1
- data/spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_generic_valid.yml +82 -0
- data/spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_sms_valid.yml +82 -0
- data/spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_totp_valid.yml +82 -0
- data/spec/support/fixtures/vcr_cassettes/mfa/delete_factor.yml +80 -0
- data/spec/support/fixtures/vcr_cassettes/mfa/enroll_factor_generic_valid.yml +82 -0
- data/spec/support/fixtures/vcr_cassettes/mfa/enroll_factor_sms_valid.yml +82 -0
- data/spec/support/fixtures/vcr_cassettes/mfa/enroll_factor_totp_valid.yml +82 -0
- data/spec/support/fixtures/vcr_cassettes/mfa/get_factor_invalid.yml +82 -0
- data/spec/support/fixtures/vcr_cassettes/mfa/get_factor_valid.yml +82 -0
- data/spec/support/fixtures/vcr_cassettes/mfa/verify_factor_generic_expired.yml +84 -0
- data/spec/support/fixtures/vcr_cassettes/mfa/verify_factor_generic_invalid.yml +84 -0
- data/spec/support/fixtures/vcr_cassettes/mfa/verify_factor_generic_valid.yml +82 -0
- metadata +36 -3
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
http_interactions:
|
|
3
|
+
- request:
|
|
4
|
+
method: post
|
|
5
|
+
uri: https://api.workos.com/auth/factors/verify
|
|
6
|
+
body:
|
|
7
|
+
encoding: UTF-8
|
|
8
|
+
string: '{"authentication_challenge_id":"auth_challenge_01FZ4YVRBMXP5ZM0A7BP4AJ12J","code":"897792"}'
|
|
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.0.2; arm64-darwin21; v2.1.1
|
|
18
|
+
Authorization:
|
|
19
|
+
- Bearer <API_KEY>
|
|
20
|
+
response:
|
|
21
|
+
status:
|
|
22
|
+
code: 422
|
|
23
|
+
message: Unprocessable Entity
|
|
24
|
+
headers:
|
|
25
|
+
Date:
|
|
26
|
+
- Sun, 27 Mar 2022 05:54:30 GMT
|
|
27
|
+
Content-Type:
|
|
28
|
+
- application/json; charset=utf-8
|
|
29
|
+
Content-Length:
|
|
30
|
+
- '167'
|
|
31
|
+
Connection:
|
|
32
|
+
- keep-alive
|
|
33
|
+
Content-Security-Policy:
|
|
34
|
+
- 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
|
|
35
|
+
https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
|
|
36
|
+
''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
|
|
37
|
+
X-Dns-Prefetch-Control:
|
|
38
|
+
- 'off'
|
|
39
|
+
Expect-Ct:
|
|
40
|
+
- max-age=0
|
|
41
|
+
X-Frame-Options:
|
|
42
|
+
- SAMEORIGIN
|
|
43
|
+
Strict-Transport-Security:
|
|
44
|
+
- max-age=15552000; includeSubDomains
|
|
45
|
+
X-Download-Options:
|
|
46
|
+
- noopen
|
|
47
|
+
X-Content-Type-Options:
|
|
48
|
+
- nosniff
|
|
49
|
+
X-Permitted-Cross-Domain-Policies:
|
|
50
|
+
- none
|
|
51
|
+
Referrer-Policy:
|
|
52
|
+
- no-referrer
|
|
53
|
+
X-Xss-Protection:
|
|
54
|
+
- '0'
|
|
55
|
+
Vary:
|
|
56
|
+
- Origin, Accept-Encoding
|
|
57
|
+
Access-Control-Allow-Credentials:
|
|
58
|
+
- 'true'
|
|
59
|
+
X-Request-Id:
|
|
60
|
+
- 3bf7c473-ef39-4a3f-85fa-609ab4fcfdb4
|
|
61
|
+
Etag:
|
|
62
|
+
- W/"a7-3Az5u04ipYu1XY+wqhSwUOFImFI"
|
|
63
|
+
Via:
|
|
64
|
+
- 1.1 vegur
|
|
65
|
+
Cf-Cache-Status:
|
|
66
|
+
- DYNAMIC
|
|
67
|
+
Report-To:
|
|
68
|
+
- '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=gQNkvWQQyL0h1kES333sXgQvo4JV9Bzm%2Bre%2BzJSsD8l%2F4sVjZ1ehj0dDfP40lHYCwx%2FLZ93avI155XM9JkY%2BxYyCAlRXobk2DfsyKmkTkhnWR4AxV%2BTWECeARqtTewSryA%3D%3D"}],"group":"cf-nel","max_age":604800}'
|
|
69
|
+
Nel:
|
|
70
|
+
- '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}'
|
|
71
|
+
Server:
|
|
72
|
+
- cloudflare
|
|
73
|
+
Cf-Ray:
|
|
74
|
+
- 6f25df294a253a32-SEA
|
|
75
|
+
Alt-Svc:
|
|
76
|
+
- h3=":443"; ma=86400, h3-29=":443"; ma=86400
|
|
77
|
+
body:
|
|
78
|
+
encoding: UTF-8
|
|
79
|
+
string: '{"code":"authentication_challenge_previously_verified","message":"The
|
|
80
|
+
authentication challenge ''auth_challenge_01FZ4YVRBMXP5ZM0A7BP4AJ12J'' has
|
|
81
|
+
already been verified."}'
|
|
82
|
+
http_version:
|
|
83
|
+
recorded_at: Sun, 27 Mar 2022 05:54:30 GMT
|
|
84
|
+
recorded_with: VCR 5.0.0
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
http_interactions:
|
|
3
|
+
- request:
|
|
4
|
+
method: post
|
|
5
|
+
uri: https://api.workos.com/auth/factors/verify
|
|
6
|
+
body:
|
|
7
|
+
encoding: UTF-8
|
|
8
|
+
string: '{"authentication_challenge_id":"auth_challenge_01FZ4YVRBMXP5ZM0A7BP4AJ12J","code":"897792"}'
|
|
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.0.2; arm64-darwin21; v2.1.1
|
|
18
|
+
Authorization:
|
|
19
|
+
- Bearer <API_KEY>
|
|
20
|
+
response:
|
|
21
|
+
status:
|
|
22
|
+
code: 201
|
|
23
|
+
message: Created
|
|
24
|
+
headers:
|
|
25
|
+
Date:
|
|
26
|
+
- Sun, 27 Mar 2022 05:53:03 GMT
|
|
27
|
+
Content-Type:
|
|
28
|
+
- application/json; charset=utf-8
|
|
29
|
+
Content-Length:
|
|
30
|
+
- '317'
|
|
31
|
+
Connection:
|
|
32
|
+
- keep-alive
|
|
33
|
+
Content-Security-Policy:
|
|
34
|
+
- 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
|
|
35
|
+
https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
|
|
36
|
+
''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
|
|
37
|
+
X-Dns-Prefetch-Control:
|
|
38
|
+
- 'off'
|
|
39
|
+
Expect-Ct:
|
|
40
|
+
- max-age=0
|
|
41
|
+
X-Frame-Options:
|
|
42
|
+
- SAMEORIGIN
|
|
43
|
+
Strict-Transport-Security:
|
|
44
|
+
- max-age=15552000; includeSubDomains
|
|
45
|
+
X-Download-Options:
|
|
46
|
+
- noopen
|
|
47
|
+
X-Content-Type-Options:
|
|
48
|
+
- nosniff
|
|
49
|
+
X-Permitted-Cross-Domain-Policies:
|
|
50
|
+
- none
|
|
51
|
+
Referrer-Policy:
|
|
52
|
+
- no-referrer
|
|
53
|
+
X-Xss-Protection:
|
|
54
|
+
- '0'
|
|
55
|
+
Vary:
|
|
56
|
+
- Origin, Accept-Encoding
|
|
57
|
+
Access-Control-Allow-Credentials:
|
|
58
|
+
- 'true'
|
|
59
|
+
X-Request-Id:
|
|
60
|
+
- 78db6375-0b0a-4492-a913-5e0802a721b7
|
|
61
|
+
Etag:
|
|
62
|
+
- W/"13d-MlhrtKBkD4LjqRYZFv0nos58XA8"
|
|
63
|
+
Via:
|
|
64
|
+
- 1.1 vegur
|
|
65
|
+
Cf-Cache-Status:
|
|
66
|
+
- DYNAMIC
|
|
67
|
+
Report-To:
|
|
68
|
+
- '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=bN92hPz7GN42QtyRg4YR%2BKMTuzd3R241D6A2ktALsB%2F%2FaFwI%2BeJHUMZ9G0oXrDbp%2Binu76aBI%2FC0ICO2Tr0zc8fi9tF1q4XnqyLfgosTjaDE%2BNDcPlRmaduFoDmkc28D4w%3D%3D"}],"group":"cf-nel","max_age":604800}'
|
|
69
|
+
Nel:
|
|
70
|
+
- '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}'
|
|
71
|
+
Server:
|
|
72
|
+
- cloudflare
|
|
73
|
+
Cf-Ray:
|
|
74
|
+
- 6f25dd0d0882dee9-SEA
|
|
75
|
+
Alt-Svc:
|
|
76
|
+
- h3=":443"; ma=86400, h3-29=":443"; ma=86400
|
|
77
|
+
body:
|
|
78
|
+
encoding: UTF-8
|
|
79
|
+
string: '{"challenge":{"object":"authentication_challenge","id":"auth_challenge_01FZ4YVRBMXP5ZM0A7BP4AJ12J","created_at":"2022-03-27T05:51:24.531Z","updated_at":"2022-03-27T05:51:24.531Z","expires_at":"2022-03-27T06:01:24.532Z","code":"897792","authentication_factor_id":"auth_factor_01FZ4YVH2XFQBJXJ4NQVJSSY8Q"},"valid":true}'
|
|
80
|
+
http_version:
|
|
81
|
+
recorded_at: Sun, 27 Mar 2022 05:53:03 GMT
|
|
82
|
+
recorded_with: VCR 5.0.0
|
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: 2.
|
|
4
|
+
version: 2.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- WorkOS
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2022-03-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: sorbet-runtime
|
|
@@ -209,6 +209,7 @@ files:
|
|
|
209
209
|
- lib/workos.rb
|
|
210
210
|
- lib/workos/audit_trail.rb
|
|
211
211
|
- lib/workos/base.rb
|
|
212
|
+
- lib/workos/challenge.rb
|
|
212
213
|
- lib/workos/client.rb
|
|
213
214
|
- lib/workos/connection.rb
|
|
214
215
|
- lib/workos/directory.rb
|
|
@@ -216,6 +217,8 @@ files:
|
|
|
216
217
|
- lib/workos/directory_sync.rb
|
|
217
218
|
- lib/workos/directory_user.rb
|
|
218
219
|
- lib/workos/errors.rb
|
|
220
|
+
- lib/workos/factor.rb
|
|
221
|
+
- lib/workos/mfa.rb
|
|
219
222
|
- lib/workos/organization.rb
|
|
220
223
|
- lib/workos/organizations.rb
|
|
221
224
|
- lib/workos/passwordless.rb
|
|
@@ -224,17 +227,21 @@ files:
|
|
|
224
227
|
- lib/workos/profile_and_token.rb
|
|
225
228
|
- lib/workos/sso.rb
|
|
226
229
|
- lib/workos/types.rb
|
|
230
|
+
- lib/workos/types/challenge_struct.rb
|
|
227
231
|
- lib/workos/types/connection_struct.rb
|
|
228
232
|
- lib/workos/types/directory_group_struct.rb
|
|
229
233
|
- lib/workos/types/directory_struct.rb
|
|
230
234
|
- lib/workos/types/directory_user_struct.rb
|
|
235
|
+
- lib/workos/types/factor_struct.rb
|
|
231
236
|
- lib/workos/types/intent_enum.rb
|
|
232
237
|
- lib/workos/types/list_struct.rb
|
|
233
238
|
- lib/workos/types/organization_struct.rb
|
|
234
239
|
- lib/workos/types/passwordless_session_struct.rb
|
|
235
240
|
- lib/workos/types/profile_struct.rb
|
|
236
241
|
- lib/workos/types/provider_enum.rb
|
|
242
|
+
- lib/workos/types/verify_factor_struct.rb
|
|
237
243
|
- lib/workos/types/webhook_struct.rb
|
|
244
|
+
- lib/workos/verify_factor.rb
|
|
238
245
|
- lib/workos/version.rb
|
|
239
246
|
- lib/workos/webhook.rb
|
|
240
247
|
- lib/workos/webhooks.rb
|
|
@@ -275,6 +282,7 @@ files:
|
|
|
275
282
|
- spec/lib/workos/audit_trail_spec.rb
|
|
276
283
|
- spec/lib/workos/base_spec.rb
|
|
277
284
|
- spec/lib/workos/directory_sync_spec.rb
|
|
285
|
+
- spec/lib/workos/mfa_spec.rb
|
|
278
286
|
- spec/lib/workos/organizations_spec.rb
|
|
279
287
|
- spec/lib/workos/passwordless_spec.rb
|
|
280
288
|
- spec/lib/workos/portal_spec.rb
|
|
@@ -313,6 +321,18 @@ files:
|
|
|
313
321
|
- spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_group.yml
|
|
314
322
|
- spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_limit.yml
|
|
315
323
|
- spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_no_options.yml
|
|
324
|
+
- spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_generic_valid.yml
|
|
325
|
+
- spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_sms_valid.yml
|
|
326
|
+
- spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_totp_valid.yml
|
|
327
|
+
- spec/support/fixtures/vcr_cassettes/mfa/delete_factor.yml
|
|
328
|
+
- spec/support/fixtures/vcr_cassettes/mfa/enroll_factor_generic_valid.yml
|
|
329
|
+
- spec/support/fixtures/vcr_cassettes/mfa/enroll_factor_sms_valid.yml
|
|
330
|
+
- spec/support/fixtures/vcr_cassettes/mfa/enroll_factor_totp_valid.yml
|
|
331
|
+
- spec/support/fixtures/vcr_cassettes/mfa/get_factor_invalid.yml
|
|
332
|
+
- spec/support/fixtures/vcr_cassettes/mfa/get_factor_valid.yml
|
|
333
|
+
- spec/support/fixtures/vcr_cassettes/mfa/verify_factor_generic_expired.yml
|
|
334
|
+
- spec/support/fixtures/vcr_cassettes/mfa/verify_factor_generic_invalid.yml
|
|
335
|
+
- spec/support/fixtures/vcr_cassettes/mfa/verify_factor_generic_valid.yml
|
|
316
336
|
- spec/support/fixtures/vcr_cassettes/organization/create.yml
|
|
317
337
|
- spec/support/fixtures/vcr_cassettes/organization/create_invalid.yml
|
|
318
338
|
- spec/support/fixtures/vcr_cassettes/organization/delete.yml
|
|
@@ -364,7 +384,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
364
384
|
- !ruby/object:Gem::Version
|
|
365
385
|
version: '0'
|
|
366
386
|
requirements: []
|
|
367
|
-
rubygems_version: 3.
|
|
387
|
+
rubygems_version: 3.3.10
|
|
368
388
|
signing_key:
|
|
369
389
|
specification_version: 4
|
|
370
390
|
summary: API client for WorkOS
|
|
@@ -372,6 +392,7 @@ test_files:
|
|
|
372
392
|
- spec/lib/workos/audit_trail_spec.rb
|
|
373
393
|
- spec/lib/workos/base_spec.rb
|
|
374
394
|
- spec/lib/workos/directory_sync_spec.rb
|
|
395
|
+
- spec/lib/workos/mfa_spec.rb
|
|
375
396
|
- spec/lib/workos/organizations_spec.rb
|
|
376
397
|
- spec/lib/workos/passwordless_spec.rb
|
|
377
398
|
- spec/lib/workos/portal_spec.rb
|
|
@@ -410,6 +431,18 @@ test_files:
|
|
|
410
431
|
- spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_group.yml
|
|
411
432
|
- spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_limit.yml
|
|
412
433
|
- spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_no_options.yml
|
|
434
|
+
- spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_generic_valid.yml
|
|
435
|
+
- spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_sms_valid.yml
|
|
436
|
+
- spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_totp_valid.yml
|
|
437
|
+
- spec/support/fixtures/vcr_cassettes/mfa/delete_factor.yml
|
|
438
|
+
- spec/support/fixtures/vcr_cassettes/mfa/enroll_factor_generic_valid.yml
|
|
439
|
+
- spec/support/fixtures/vcr_cassettes/mfa/enroll_factor_sms_valid.yml
|
|
440
|
+
- spec/support/fixtures/vcr_cassettes/mfa/enroll_factor_totp_valid.yml
|
|
441
|
+
- spec/support/fixtures/vcr_cassettes/mfa/get_factor_invalid.yml
|
|
442
|
+
- spec/support/fixtures/vcr_cassettes/mfa/get_factor_valid.yml
|
|
443
|
+
- spec/support/fixtures/vcr_cassettes/mfa/verify_factor_generic_expired.yml
|
|
444
|
+
- spec/support/fixtures/vcr_cassettes/mfa/verify_factor_generic_invalid.yml
|
|
445
|
+
- spec/support/fixtures/vcr_cassettes/mfa/verify_factor_generic_valid.yml
|
|
413
446
|
- spec/support/fixtures/vcr_cassettes/organization/create.yml
|
|
414
447
|
- spec/support/fixtures/vcr_cassettes/organization/create_invalid.yml
|
|
415
448
|
- spec/support/fixtures/vcr_cassettes/organization/delete.yml
|