workos 3.1.0 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/.semaphore/semaphore.yml +1 -1
  3. data/Gemfile.lock +1 -1
  4. data/lib/workos/authentication_response.rb +11 -1
  5. data/lib/workos/directory_sync.rb +3 -0
  6. data/lib/workos/impersonator.rb +26 -0
  7. data/lib/workos/organization_membership.rb +4 -1
  8. data/lib/workos/organizations.rb +1 -0
  9. data/lib/workos/refresh_authentication_response.rb +27 -0
  10. data/lib/workos/sso.rb +1 -0
  11. data/lib/workos/types/organization_membership_struct.rb +2 -1
  12. data/lib/workos/user_management.rb +103 -0
  13. data/lib/workos/version.rb +1 -1
  14. data/lib/workos.rb +2 -0
  15. data/spec/lib/workos/directory_sync_spec.rb +30 -15
  16. data/spec/lib/workos/organizations_spec.rb +6 -3
  17. data/spec/lib/workos/sso_spec.rb +12 -6
  18. data/spec/lib/workos/user_management_spec.rb +72 -15
  19. data/spec/spec_helper.rb +6 -0
  20. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_after.yml +1 -1
  21. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_before.yml +1 -1
  22. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_domain.yml +1 -1
  23. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_limit.yml +1 -1
  24. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_no_options.yml +1 -1
  25. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_search.yml +1 -1
  26. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_after.yml +1 -1
  27. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_before.yml +1 -1
  28. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_directory.yml +1 -1
  29. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_limit.yml +1 -1
  30. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_no_options.yml +1 -1
  31. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_user.yml +1 -1
  32. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_after.yml +1 -1
  33. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_before.yml +1 -1
  34. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_directory.yml +1 -1
  35. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_group.yml +1 -1
  36. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_limit.yml +1 -1
  37. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_no_options.yml +72 -71
  38. data/spec/support/fixtures/vcr_cassettes/organization/list.yml +1 -1
  39. data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_after.yml +1 -1
  40. data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_before.yml +1 -1
  41. data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_connection_type.yml +1 -1
  42. data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_domain.yml +1 -1
  43. data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_limit.yml +1 -1
  44. data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_no_options.yml +1 -1
  45. data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_organization_id.yml +1 -1
  46. data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/valid.yml +1 -1
  47. data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/valid_with_impersonator.yml +80 -0
  48. data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_email_verification/valid.yml +1 -1
  49. data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_magic_auth/valid.yml +1 -1
  50. data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_organization_selection/valid.yml +1 -1
  51. data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_password/valid.yml +1 -1
  52. data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_refresh_code/invalid.yml +81 -0
  53. data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_refresh_token/valid.yml +81 -0
  54. data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_totp/valid.yml +1 -1
  55. data/spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/valid.yml +1 -1
  56. data/spec/support/fixtures/vcr_cassettes/user_management/get_organization_membership.yml +1 -1
  57. data/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_after.yml +1 -1
  58. data/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_before.yml +1 -1
  59. data/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_limit.yml +1 -1
  60. data/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_no_options.yml +1 -1
  61. data/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_organization_id.yml +1 -1
  62. data/spec/support/fixtures/vcr_cassettes/user_management/list_organization_memberships/no_options.yml +2 -2
  63. data/spec/support/fixtures/vcr_cassettes/user_management/list_organization_memberships/with_options.yml +1 -1
  64. data/spec/support/fixtures/vcr_cassettes/user_management/list_users/no_options.yml +1 -1
  65. metadata +10 -2
@@ -0,0 +1,80 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.workos.com/user_management/authenticate
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"code":"01HRX85ATQB2MN40K4FZ9C2HFR","client_id":"client_01GS91XFB2YPR1C0NR5SH758Q0","client_secret":"<API_KEY>","ip_address":null,"user_agent":null,"grant_type":"authorization_code"}'
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.1; arm64-darwin21; v4.0.0
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Thu, 14 Mar 2024 01:10:34 GMT
25
+ Content-Type:
26
+ - application/json; charset=utf-8
27
+ Content-Length:
28
+ - '875'
29
+ Connection:
30
+ - keep-alive
31
+ Cf-Ray:
32
+ - 8640628169fa0d54-LAX
33
+ Cf-Cache-Status:
34
+ - DYNAMIC
35
+ Etag:
36
+ - W/"47c-66YSPNMN47PZx4ahCgTQvmryR90"
37
+ Strict-Transport-Security:
38
+ - max-age=15552000; includeSubDomains
39
+ Vary:
40
+ - Origin, Accept-Encoding
41
+ Via:
42
+ - 1.1 spaces-router (devel)
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
+ - f22ea52f-bf1a-4d5e-acb1-10b2e99ffbe5
65
+ X-Xss-Protection:
66
+ - '0'
67
+ Set-Cookie:
68
+ - __cf_bm=pYiV6zsrN3V8vd8vKA_bp0qN2LYd1HUQAIVHcevLYw4-1710378634-1.0.1.1-wNPVRK6jpySHc7bqiAVCtM6T64oKxFAjrcvJNJAPU.RhZFRgPfQRGWYbC4l0ckcsyhZ2_I7GTu17yNowC.smHA;
69
+ path=/; expires=Thu, 14-Mar-24 01:40:34 GMT; domain=.workos.com; HttpOnly;
70
+ Secure; SameSite=None
71
+ - __cfruid=914cc38ede83520e897d1eaef25a8e5daa4975d0-1710378634; path=/; domain=.workos.com;
72
+ HttpOnly; Secure; SameSite=None
73
+ Server:
74
+ - cloudflare
75
+ body:
76
+ encoding: ASCII-8BIT
77
+ string: '{"user":{"object":"user","id":"user_01HP0B4ZV2FWWVY0BF16GFDAER","email":"bob@example.com","email_verified":false,"first_name":"Bob","last_name":"Loblaw","profile_picture_url":null,"created_at":"2024-02-06T23:13:18.137Z","updated_at":"2024-02-06T23:13:36.946Z"},"impersonator":{"email":"admin@foocorp.com","reason":"For testing."},"access_token":"<ACCESS_TOKEN>","refresh_token":"<REFRESH_TOKEN>"}'
78
+ http_version:
79
+ recorded_at: Thu, 14 Mar 2024 01:10:34 GMT
80
+ recorded_with: VCR 5.0.0
@@ -75,7 +75,7 @@ http_interactions:
75
75
  - cloudflare
76
76
  body:
77
77
  encoding: ASCII-8BIT
78
- string: '{"user":{"object":"user","id":"user_01H93ZY4F80YZRRS6N59Z2HFVS","email":"test@workos.app","email_verified":false,"first_name":"Lucille","last_name":"Bluth","created_at":"2023-08-30T19:50:13.214Z","updated_at":"2023-08-30T19:50:13.214Z","user_type":"managed","sso_profile_id":"prof_01H93ZTVWYPAT4RKDSPFPPXH0J"}}'
78
+ string: '{"user":{"object":"user","id":"user_01H93ZY4F80YZRRS6N59Z2HFVS","email":"test@workos.app","email_verified":false,"first_name":"Lucille","last_name":"Bluth","created_at":"2023-08-30T19:50:13.214Z","updated_at":"2023-08-30T19:50:13.214Z","user_type":"managed","sso_profile_id":"prof_01H93ZTVWYPAT4RKDSPFPPXH0J"},"access_token":"<ACCESS_TOKEN>","refresh_token":"<REFRESH_TOKEN>"}'
79
79
  http_version:
80
80
  recorded_at: Wed, 30 Aug 2023 19:51:51 GMT
81
81
  recorded_with: VCR 5.0.0
@@ -76,7 +76,7 @@ http_interactions:
76
76
  - cloudflare
77
77
  body:
78
78
  encoding: ASCII-8BIT
79
- string: '{"user":{"object":"user","id":"user_01H93WD0R0KWF8Q7BK02C0RPYJ","email":"test@workos.app","email_verified":true,"first_name":"Lucille","last_name":"Bluth","created_at":"2023-08-30T18:48:26.517Z","updated_at":"2023-08-30T18:58:00.821Z","user_type":"unmanaged","email_verified_at":"2023-08-30T18:58:00.915Z","google_oauth_profile_id":null,"microsoft_oauth_profile_id":null}}'
79
+ string: '{"user":{"object":"user","id":"user_01H93WD0R0KWF8Q7BK02C0RPYJ","email":"test@workos.app","email_verified":true,"first_name":"Lucille","last_name":"Bluth","created_at":"2023-08-30T18:48:26.517Z","updated_at":"2023-08-30T18:58:00.821Z","user_type":"unmanaged","email_verified_at":"2023-08-30T18:58:00.915Z","google_oauth_profile_id":null,"microsoft_oauth_profile_id":null},"access_token":"<ACCESS_TOKEN>","refresh_token":"<REFRESH_TOKEN>"}'
80
80
  http_version:
81
81
  recorded_at: Wed, 30 Aug 2023 18:58:00 GMT
82
82
  recorded_with: VCR 5.0.0
@@ -76,7 +76,7 @@ http_interactions:
76
76
  - cloudflare
77
77
  body:
78
78
  encoding: UTF-8
79
- string: '{"organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","user":{"object":"user","id":"user_01H93WD0R0KWF8Q7BK02C0RPYJ","email":"test@workos.app","email_verified":true,"first_name":"Lucille","last_name":"Bluth","created_at":"2023-08-30T18:48:26.517Z","updated_at":"2023-08-30T18:58:00.821Z","user_type":"unmanaged","email_verified_at":"2023-08-30T18:58:00.915Z","google_oauth_profile_id":null,"microsoft_oauth_profile_id":null}}'
79
+ string: '{"organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","user":{"object":"user","id":"user_01H93WD0R0KWF8Q7BK02C0RPYJ","email":"test@workos.app","email_verified":true,"first_name":"Lucille","last_name":"Bluth","created_at":"2023-08-30T18:48:26.517Z","updated_at":"2023-08-30T18:58:00.821Z","user_type":"unmanaged","email_verified_at":"2023-08-30T18:58:00.915Z","google_oauth_profile_id":null,"microsoft_oauth_profile_id":null},"access_token":"<ACCESS_TOKEN>","refresh_token":"<REFRESH_TOKEN>"}'
80
80
  http_version:
81
81
  recorded_at: Wed, 20 Dec 2023 22:00:12 GMT
82
82
  recorded_with: VCR 5.0.0
@@ -76,7 +76,7 @@ http_interactions:
76
76
  - cloudflare
77
77
  body:
78
78
  encoding: ASCII-8BIT
79
- string: '{"user":{"object":"user","id":"user_01H7TVSKS45SDHN5V9XPSM6H44","email":"test@workos.app","email_verified":true,"first_name":null,"last_name":null,"created_at":"2023-08-14T20:28:58.929Z","updated_at":"2023-08-28T15:56:19.798Z","user_type":"unmanaged","email_verified_at":"2023-08-22T11:18:01.850Z","google_oauth_profile_id":null,"microsoft_oauth_profile_id":null}}'
79
+ string: '{"user":{"object":"user","id":"user_01H7TVSKS45SDHN5V9XPSM6H44","email":"test@workos.app","email_verified":true,"first_name":null,"last_name":null,"created_at":"2023-08-14T20:28:58.929Z","updated_at":"2023-08-28T15:56:19.798Z","user_type":"unmanaged","email_verified_at":"2023-08-22T11:18:01.850Z","google_oauth_profile_id":null,"microsoft_oauth_profile_id":null},"access_token":"<ACCESS_TOKEN>","refresh_token":"<REFRESH_TOKEN>"}'
80
80
  http_version:
81
81
  recorded_at: Tue, 29 Aug 2023 00:24:25 GMT
82
82
  recorded_with: VCR 5.0.0
@@ -0,0 +1,81 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.workos.com/user_management/authenticate
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"refresh_token":"invalid","client_id":"client_123","client_secret":"<API_KEY>","ip_address":"200.240.210.16","user_agent":"Mozilla/5.0
9
+ (Macintosh; Intel Mac OS X 10_15_7) Chrome/108.0.0.0 Safari/537.36","grant_type":"refresh_token"}'
10
+ headers:
11
+ Content-Type:
12
+ - application/json
13
+ Accept-Encoding:
14
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
15
+ Accept:
16
+ - "*/*"
17
+ User-Agent:
18
+ - WorkOS; ruby/3.2.2; arm64-darwin22; v4.0.0
19
+ response:
20
+ status:
21
+ code: 400
22
+ message: Bad Request
23
+ headers:
24
+ Date:
25
+ - Tue, 19 Mar 2024 16:06:37 GMT
26
+ Content-Type:
27
+ - application/json; charset=utf-8
28
+ Content-Length:
29
+ - '70'
30
+ Connection:
31
+ - keep-alive
32
+ Cf-Ray:
33
+ - 866eb5f11e5f5304-SLC
34
+ Cf-Cache-Status:
35
+ - DYNAMIC
36
+ Etag:
37
+ - W/"46-6ugkBnqF9SxNnhijAAHjGcT083A"
38
+ Strict-Transport-Security:
39
+ - max-age=15552000; includeSubDomains
40
+ Vary:
41
+ - Origin, Accept-Encoding
42
+ Via:
43
+ - 1.1 spaces-router (devel)
44
+ Access-Control-Allow-Credentials:
45
+ - 'true'
46
+ Content-Security-Policy:
47
+ - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
48
+ https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
49
+ ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
50
+ Expect-Ct:
51
+ - max-age=0
52
+ Referrer-Policy:
53
+ - no-referrer
54
+ X-Content-Type-Options:
55
+ - nosniff
56
+ X-Dns-Prefetch-Control:
57
+ - 'off'
58
+ X-Download-Options:
59
+ - noopen
60
+ X-Frame-Options:
61
+ - SAMEORIGIN
62
+ X-Permitted-Cross-Domain-Policies:
63
+ - none
64
+ X-Request-Id:
65
+ - 32619697-61a5-4ad1-80ab-9d26a6a74d12
66
+ X-Xss-Protection:
67
+ - '0'
68
+ Set-Cookie:
69
+ - __cf_bm=QdnPZspsJTPGj.ljZ.hfxMSzw0C1in.rjVkGjY75Ht8-1710864397-1.0.1.1-dA2qdL_CwORHen0HwGvbeJXGixoc_htTepIFYUnChePSsMpTdvHI7pWe0ddNWtrRbDD6GEK7TkgM7qPdAXVsaw;
70
+ path=/; expires=Tue, 19-Mar-24 16:36:37 GMT; domain=.workos.com; HttpOnly;
71
+ Secure; SameSite=None
72
+ - __cfruid=a7cc4637e2746cb557755f0665c5f2a6206b907a-1710864397; path=/; domain=.workos.com;
73
+ HttpOnly; Secure; SameSite=None
74
+ Server:
75
+ - cloudflare
76
+ body:
77
+ encoding: UTF-8
78
+ string: '{"error":"invalid_grant","error_description":"Invalid refresh token."}'
79
+ http_version:
80
+ recorded_at: Tue, 19 Mar 2024 16:06:37 GMT
81
+ recorded_with: VCR 5.0.0
@@ -0,0 +1,81 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.workos.com/user_management/authenticate
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"refresh_token":"some_refresh_token","client_id":"client_123","client_secret":"<API_KEY>","ip_address":"200.240.210.16","user_agent":"Mozilla/5.0
9
+ (Macintosh; Intel Mac OS X 10_15_7) Chrome/108.0.0.0 Safari/537.36","grant_type":"refresh_token"}'
10
+ headers:
11
+ Content-Type:
12
+ - application/json
13
+ Accept-Encoding:
14
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
15
+ Accept:
16
+ - "*/*"
17
+ User-Agent:
18
+ - WorkOS; ruby/3.2.2; arm64-darwin22; v4.0.0
19
+ response:
20
+ status:
21
+ code: 200
22
+ message: OK
23
+ headers:
24
+ Date:
25
+ - Mon, 18 Mar 2024 19:00:53 GMT
26
+ Content-Type:
27
+ - application/json; charset=utf-8
28
+ Transfer-Encoding:
29
+ - chunked
30
+ Connection:
31
+ - keep-alive
32
+ Cf-Ray:
33
+ - 866777d63b4627e8-SLC
34
+ Cf-Cache-Status:
35
+ - DYNAMIC
36
+ Etag:
37
+ - W/"335-M3MDQYhs5724SayBHHCwnBDn3qA"
38
+ Strict-Transport-Security:
39
+ - max-age=15552000; includeSubDomains
40
+ Vary:
41
+ - Origin, Accept-Encoding
42
+ Via:
43
+ - 1.1 spaces-router (devel)
44
+ Access-Control-Allow-Credentials:
45
+ - 'true'
46
+ Content-Security-Policy:
47
+ - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
48
+ https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
49
+ ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
50
+ Expect-Ct:
51
+ - max-age=0
52
+ Referrer-Policy:
53
+ - no-referrer
54
+ X-Content-Type-Options:
55
+ - nosniff
56
+ X-Dns-Prefetch-Control:
57
+ - 'off'
58
+ X-Download-Options:
59
+ - noopen
60
+ X-Frame-Options:
61
+ - SAMEORIGIN
62
+ X-Permitted-Cross-Domain-Policies:
63
+ - none
64
+ X-Request-Id:
65
+ - 995ed1ed-e892-4049-86c9-0e07baa6cc4b
66
+ X-Xss-Protection:
67
+ - '0'
68
+ Set-Cookie:
69
+ - __cf_bm=2NHqv1cd1BisOc8KKcQ0oNzFxZZT4OHQd6c2QDuGnUU-1710788453-1.0.1.1-4BxBRzVrhL7rCH895PcfORXr_6Rnj3Oh5w1YG4xi7X1st62LMzb5dHZO7u7P.V1P8nBDAAt3Wbz7xsDTWrfWJg;
70
+ path=/; expires=Mon, 18-Mar-24 19:30:53 GMT; domain=.workos.com; HttpOnly;
71
+ Secure; SameSite=None
72
+ - __cfruid=06035c17e9b60a1d7a42a5b568146a0bb71a06dc-1710788453; path=/; domain=.workos.com;
73
+ HttpOnly; Secure; SameSite=None
74
+ Server:
75
+ - cloudflare
76
+ body:
77
+ encoding: UTF-8
78
+ string: '{"access_token":"<ACCESS_TOKEN>","refresh_token":"<REFRESH_TOKEN>"}'
79
+ http_version:
80
+ recorded_at: Mon, 18 Mar 2024 19:00:53 GMT
81
+ recorded_with: VCR 5.0.0
@@ -75,7 +75,7 @@ http_interactions:
75
75
  - cloudflare
76
76
  body:
77
77
  encoding: ASCII-8BIT
78
- string: '{"user":{"object":"user","id":"user_01H93ZY4F80YZRRS6N59Z2HFVS","email":"test@workos.app","email_verified":false,"first_name":"Lucille","last_name":"Bluth","created_at":"2023-08-30T19:50:13.214Z","updated_at":"2023-08-30T19:50:13.214Z","user_type":"managed","sso_profile_id":"prof_01H93ZTVWYPAT4RKDSPFPPXH0J"}}'
78
+ string: '{"user":{"object":"user","id":"user_01H93ZY4F80YZRRS6N59Z2HFVS","email":"test@workos.app","email_verified":false,"first_name":"Lucille","last_name":"Bluth","created_at":"2023-08-30T19:50:13.214Z","updated_at":"2023-08-30T19:50:13.214Z","user_type":"managed","sso_profile_id":"prof_01H93ZTVWYPAT4RKDSPFPPXH0J"},"access_token":"<ACCESS_TOKEN>","refresh_token":"<REFRESH_TOKEN>"}'
79
79
  http_version:
80
80
  recorded_at: Wed, 30 Aug 2023 19:51:51 GMT
81
81
  recorded_with: VCR 5.0.0
@@ -76,7 +76,7 @@ http_interactions:
76
76
  - cloudflare
77
77
  body:
78
78
  encoding: UTF-8
79
- string: '{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}'
79
+ string: '{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status":"active","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}'
80
80
  http_version:
81
81
  recorded_at: Thu, 17 Aug 2023 14:20:07 GMT
82
82
  recorded_with: VCR 5.0.0
@@ -76,7 +76,7 @@ http_interactions:
76
76
  - cloudflare
77
77
  body:
78
78
  encoding: ASCII-8BIT
79
- string: '{"object": "organization_membership", "id": "om_01H5JQDV7R7ATEYZDEG0W5PRYS", "user_id": "user_01H5JQDV7R7ATEYZDEG0W5PRYS", "organization_id": "organization_01H5JQDV7R7ATEYZDEG0W5PRYS", "created_at": "2023-07-18T02:07:19.911Z", "updated_at": "2023-07-18T02:07:19.911Z"}'
79
+ string: '{"object": "organization_membership", "id": "om_01H5JQDV7R7ATEYZDEG0W5PRYS", "user_id": "user_01H5JQDV7R7ATEYZDEG0W5PRYS", "organization_id": "organization_01H5JQDV7R7ATEYZDEG0W5PRYS", "status": "active", "created_at": "2023-07-18T02:07:19.911Z", "updated_at": "2023-07-18T02:07:19.911Z"}'
80
80
  http_version:
81
81
  recorded_at: Mon, 14 Aug 2023 21:42:04 GMT
82
82
  recorded_with: VCR 5.0.0
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api.workos.com/user_management/invitations?after=invitation_01H5JQDV7R7ATEYZDEG0W5PRYS
5
+ uri: https://api.workos.com/user_management/invitations?after=invitation_01H5JQDV7R7ATEYZDEG0W5PRYS&order=desc
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api.workos.com/user_management/invitations?before=invitation_01H5JQDV7R7ATEYZDEG0W5PRYS
5
+ uri: https://api.workos.com/user_management/invitations?before=invitation_01H5JQDV7R7ATEYZDEG0W5PRYS&order=desc
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api.workos.com/user_management/invitations?limit=2
5
+ uri: https://api.workos.com/user_management/invitations?limit=2&order=desc
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api.workos.com/user_management/invitations
5
+ uri: https://api.workos.com/user_management/invitations?order=desc
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api.workos.com/user_management/invitations?organization_id=org_01H5JQDV7R7ATEYZDEG0W5PRYS
5
+ uri: https://api.workos.com/user_management/invitations?order=desc&organization_id=org_01H5JQDV7R7ATEYZDEG0W5PRYS
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api.workos.com/user_management/organization_memberships
5
+ uri: https://api.workos.com/user_management/organization_memberships?order=desc
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ""
@@ -76,7 +76,7 @@ http_interactions:
76
76
  - cloudflare
77
77
  body:
78
78
  encoding: ASCII-8BIT
79
- string: '{"object":"list","data":[{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}, {"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":"before-id","after":null}}'
79
+ string: '{"object":"list","data":[{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status": "active","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}, {"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status": "active","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":"before-id","after":null}}'
80
80
  http_version:
81
81
  recorded_at: Tue, 15 Aug 2023 14:12:43 GMT
82
82
  recorded_with: VCR 5.0.0
@@ -76,7 +76,7 @@ http_interactions:
76
76
  - cloudflare
77
77
  body:
78
78
  encoding: ASCII-8BIT
79
- string: '{"object":"list","data":[{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":null,"after":null}}'
79
+ string: '{"object":"list","data":[{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status": "active","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":null,"after":null}}'
80
80
  http_version:
81
81
  recorded_at: Tue, 15 Aug 2023 16:37:20 GMT
82
82
  recorded_with: VCR 5.0.0
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api.workos.com/user_management/users
5
+ uri: https://api.workos.com/user_management/users?order=desc
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ""
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: 3.1.0
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - WorkOS
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-07 00:00:00.000000000 Z
11
+ date: 2024-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sorbet-runtime
@@ -182,6 +182,7 @@ files:
182
182
  - lib/workos/events.rb
183
183
  - lib/workos/factor.rb
184
184
  - lib/workos/hash_provider.rb
185
+ - lib/workos/impersonator.rb
185
186
  - lib/workos/invitation.rb
186
187
  - lib/workos/mfa.rb
187
188
  - lib/workos/organization.rb
@@ -191,6 +192,7 @@ files:
191
192
  - lib/workos/portal.rb
192
193
  - lib/workos/profile.rb
193
194
  - lib/workos/profile_and_token.rb
195
+ - lib/workos/refresh_authentication_response.rb
194
196
  - lib/workos/sso.rb
195
197
  - lib/workos/types.rb
196
198
  - lib/workos/types/audit_log_export_struct.rb
@@ -364,6 +366,7 @@ files:
364
366
  - spec/support/fixtures/vcr_cassettes/sso/profile.yml
365
367
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/invalid.yml
366
368
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/valid.yml
369
+ - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/valid_with_impersonator.yml
367
370
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_email_verification/invalid.yml
368
371
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_email_verification/valid.yml
369
372
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_magic_auth/invalid.yml
@@ -372,6 +375,8 @@ files:
372
375
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_organization_selection/valid.yml
373
376
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_password/invalid.yml
374
377
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_password/valid.yml
378
+ - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_refresh_code/invalid.yml
379
+ - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_refresh_token/valid.yml
375
380
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_totp/invalid.yml
376
381
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_totp/valid.yml
377
382
  - spec/support/fixtures/vcr_cassettes/user_management/confirm_password_reset/invalid.yml
@@ -549,6 +554,7 @@ test_files:
549
554
  - spec/support/fixtures/vcr_cassettes/sso/profile.yml
550
555
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/invalid.yml
551
556
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/valid.yml
557
+ - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/valid_with_impersonator.yml
552
558
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_email_verification/invalid.yml
553
559
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_email_verification/valid.yml
554
560
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_magic_auth/invalid.yml
@@ -557,6 +563,8 @@ test_files:
557
563
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_organization_selection/valid.yml
558
564
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_password/invalid.yml
559
565
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_password/valid.yml
566
+ - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_refresh_code/invalid.yml
567
+ - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_refresh_token/valid.yml
560
568
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_totp/invalid.yml
561
569
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_totp/valid.yml
562
570
  - spec/support/fixtures/vcr_cassettes/user_management/confirm_password_reset/invalid.yml