workos 4.0.0 → 4.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +37 -0
  3. data/.github/workflows/release.yml +43 -0
  4. data/.rubocop.yml +8 -1
  5. data/Gemfile.lock +22 -69
  6. data/lib/workos/audit_log_export.rb +8 -31
  7. data/lib/workos/audit_logs.rb +0 -26
  8. data/lib/workos/authentication_factor_and_challenge.rb +0 -3
  9. data/lib/workos/authentication_response.rb +12 -5
  10. data/lib/workos/challenge.rb +9 -28
  11. data/lib/workos/client.rb +0 -41
  12. data/lib/workos/configuration.rb +0 -1
  13. data/lib/workos/connection.rb +11 -35
  14. data/lib/workos/directory.rb +10 -37
  15. data/lib/workos/directory_group.rb +9 -36
  16. data/lib/workos/directory_sync.rb +0 -21
  17. data/lib/workos/directory_user.rb +17 -51
  18. data/lib/workos/errors.rb +0 -16
  19. data/lib/workos/event.rb +5 -26
  20. data/lib/workos/events.rb +0 -7
  21. data/lib/workos/factor.rb +9 -28
  22. data/lib/workos/hash_provider.rb +0 -1
  23. data/lib/workos/impersonator.rb +23 -0
  24. data/lib/workos/invitation.rb +12 -37
  25. data/lib/workos/mfa.rb +0 -42
  26. data/lib/workos/organization.rb +8 -31
  27. data/lib/workos/organization_membership.rb +8 -27
  28. data/lib/workos/organizations.rb +0 -26
  29. data/lib/workos/passwordless.rb +0 -14
  30. data/lib/workos/portal.rb +1 -13
  31. data/lib/workos/profile.rb +12 -39
  32. data/lib/workos/profile_and_token.rb +1 -4
  33. data/lib/workos/refresh_authentication_response.rb +24 -0
  34. data/lib/workos/sso.rb +1 -43
  35. data/lib/workos/types/intent.rb +16 -0
  36. data/lib/workos/types/list_struct.rb +8 -5
  37. data/lib/workos/types/passwordless_session_struct.rb +10 -9
  38. data/lib/workos/types/provider.rb +15 -0
  39. data/lib/workos/types.rb +5 -23
  40. data/lib/workos/user.rb +10 -31
  41. data/lib/workos/user_and_token.rb +1 -4
  42. data/lib/workos/user_management.rb +108 -219
  43. data/lib/workos/user_response.rb +0 -3
  44. data/lib/workos/verify_challenge.rb +4 -18
  45. data/lib/workos/version.rb +1 -2
  46. data/lib/workos/webhook.rb +5 -26
  47. data/lib/workos/webhooks.rb +1 -38
  48. data/lib/workos.rb +2 -2
  49. data/spec/lib/workos/audit_logs_spec.rb +2 -3
  50. data/spec/lib/workos/configuration_spec.rb +0 -1
  51. data/spec/lib/workos/directory_sync_spec.rb +0 -1
  52. data/spec/lib/workos/directory_user_spec.rb +0 -1
  53. data/spec/lib/workos/event_spec.rb +0 -1
  54. data/spec/lib/workos/mfa_spec.rb +0 -1
  55. data/spec/lib/workos/organizations_spec.rb +0 -1
  56. data/spec/lib/workos/passwordless_spec.rb +0 -1
  57. data/spec/lib/workos/portal_spec.rb +0 -1
  58. data/spec/lib/workos/sso_spec.rb +0 -1
  59. data/spec/lib/workos/user_management_spec.rb +59 -10
  60. data/spec/lib/workos/webhooks_spec.rb +0 -1
  61. data/spec/spec_helper.rb +6 -9
  62. data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/valid.yml +1 -1
  63. data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/valid_with_impersonator.yml +80 -0
  64. data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_email_verification/valid.yml +1 -1
  65. data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_magic_auth/valid.yml +1 -1
  66. data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_organization_selection/valid.yml +1 -1
  67. data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_password/valid.yml +1 -1
  68. data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_refresh_code/invalid.yml +81 -0
  69. data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_refresh_token/valid.yml +81 -0
  70. data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_totp/valid.yml +1 -1
  71. data/spec/support/shared_examples/client_spec.rb +0 -1
  72. data/workos.gemspec +1 -6
  73. metadata +19 -129
  74. data/.semaphore/rubygems.yml +0 -24
  75. data/.semaphore/semaphore.yml +0 -51
  76. data/bin/tapioca +0 -29
  77. data/codecov.yml +0 -12
  78. data/devbox.json +0 -18
  79. data/devbox.lock +0 -11
  80. data/lib/workos/types/audit_log_export_struct.rb +0 -17
  81. data/lib/workos/types/challenge_struct.rb +0 -18
  82. data/lib/workos/types/connection_struct.rb +0 -20
  83. data/lib/workos/types/directory_group_struct.rb +0 -19
  84. data/lib/workos/types/directory_struct.rb +0 -19
  85. data/lib/workos/types/directory_user_struct.rb +0 -26
  86. data/lib/workos/types/event_struct.rb +0 -15
  87. data/lib/workos/types/factor_struct.rb +0 -18
  88. data/lib/workos/types/intent_enum.rb +0 -17
  89. data/lib/workos/types/invitation_struct.rb +0 -20
  90. data/lib/workos/types/magic_auth_challenge_struct.rb +0 -12
  91. data/lib/workos/types/organization_membership_struct.rb +0 -16
  92. data/lib/workos/types/organization_struct.rb +0 -17
  93. data/lib/workos/types/profile_struct.rb +0 -21
  94. data/lib/workos/types/provider_enum.rb +0 -16
  95. data/lib/workos/types/user_struct.rb +0 -18
  96. data/lib/workos/types/verify_challenge_struct.rb +0 -13
  97. data/lib/workos/types/webhook_struct.rb +0 -15
  98. data/sorbet/config +0 -2
  99. data/sorbet/rbi/gems/addressable@2.8.0.rbi +0 -290
  100. data/sorbet/rbi/gems/ast@2.4.2.rbi +0 -54
  101. data/sorbet/rbi/gems/codecov@0.2.12.rbi +0 -55
  102. data/sorbet/rbi/gems/coderay@1.1.3.rbi +0 -8
  103. data/sorbet/rbi/gems/crack@0.4.5.rbi +0 -57
  104. data/sorbet/rbi/gems/diff-lcs@1.4.4.rbi +0 -185
  105. data/sorbet/rbi/gems/docile@1.3.5.rbi +0 -54
  106. data/sorbet/rbi/gems/hashdiff@1.0.1.rbi +0 -82
  107. data/sorbet/rbi/gems/json@2.5.1.rbi +0 -109
  108. data/sorbet/rbi/gems/method_source@1.0.0.rbi +0 -8
  109. data/sorbet/rbi/gems/parallel@1.20.1.rbi +0 -113
  110. data/sorbet/rbi/gems/parser@3.0.1.0.rbi +0 -1187
  111. data/sorbet/rbi/gems/pry@0.14.2.rbi +0 -8
  112. data/sorbet/rbi/gems/public_suffix@4.0.6.rbi +0 -146
  113. data/sorbet/rbi/gems/rainbow@3.0.0.rbi +0 -153
  114. data/sorbet/rbi/gems/rake@13.0.3.rbi +0 -807
  115. data/sorbet/rbi/gems/rbi@0.0.16.rbi +0 -2118
  116. data/sorbet/rbi/gems/regexp_parser@2.1.1.rbi +0 -1117
  117. data/sorbet/rbi/gems/rexml@3.2.5.rbi +0 -709
  118. data/sorbet/rbi/gems/rspec-core@3.9.3.rbi +0 -2467
  119. data/sorbet/rbi/gems/rspec-expectations@3.9.4.rbi +0 -1569
  120. data/sorbet/rbi/gems/rspec-mocks@3.9.1.rbi +0 -1493
  121. data/sorbet/rbi/gems/rspec-support@3.9.4.rbi +0 -511
  122. data/sorbet/rbi/gems/rspec@3.9.0.rbi +0 -38
  123. data/sorbet/rbi/gems/rubocop-ast@1.4.1.rbi +0 -1881
  124. data/sorbet/rbi/gems/rubocop@0.93.1.rbi +0 -11497
  125. data/sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi +0 -405
  126. data/sorbet/rbi/gems/simplecov-html@0.12.3.rbi +0 -89
  127. data/sorbet/rbi/gems/simplecov@0.21.2.rbi +0 -577
  128. data/sorbet/rbi/gems/simplecov_json_formatter@0.1.2.rbi +0 -8
  129. data/sorbet/rbi/gems/spoom@1.1.15.rbi +0 -1549
  130. data/sorbet/rbi/gems/tapioca@0.7.3.rbi +0 -1718
  131. data/sorbet/rbi/gems/thor@1.2.1.rbi +0 -844
  132. data/sorbet/rbi/gems/unicode-display_width@1.7.0.rbi +0 -22
  133. data/sorbet/rbi/gems/unparser@0.6.2.rbi +0 -8
  134. data/sorbet/rbi/gems/vcr@5.0.0.rbi +0 -699
  135. data/sorbet/rbi/gems/webmock@3.12.2.rbi +0 -662
  136. data/sorbet/rbi/gems/yard-sorbet@0.8.0.rbi +0 -268
  137. data/sorbet/rbi/gems/yard@0.9.26.rbi +0 -4048
  138. data/sorbet/tapioca/config.yml +0 -13
  139. data/sorbet/tapioca/require.rb +0 -4
@@ -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
@@ -1,5 +1,4 @@
1
1
  # frozen_string_literal: true
2
- # typed: false
3
2
 
4
3
  RSpec.shared_examples 'client' do
5
4
  subject(:client) { described_class.client }
data/workos.gemspec CHANGED
@@ -21,16 +21,11 @@ Gem::Specification.new do |spec|
21
21
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
22
22
  spec.require_paths = ['lib']
23
23
 
24
- spec.add_dependency 'sorbet-runtime', '~> 0.5'
25
-
26
24
  spec.add_development_dependency 'bundler', '>= 2.0.1'
27
- spec.add_development_dependency 'codecov', '~> 0.2.8'
28
25
  spec.add_development_dependency 'rspec', '~> 3.9.0'
29
26
  spec.add_development_dependency 'rubocop', '~> 0.77'
30
- spec.add_development_dependency 'sorbet', '~> 0.5'
31
- spec.add_development_dependency 'tapioca'
32
27
  spec.add_development_dependency 'vcr', '~> 5.0.0'
33
28
  spec.add_development_dependency 'webmock'
34
29
 
35
- spec.required_ruby_version = '>= 2.5'
30
+ spec.required_ruby_version = '>= 2.7'
36
31
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workos
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - WorkOS
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-08 00:00:00.000000000 Z
11
+ date: 2024-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: sorbet-runtime
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '0.5'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '0.5'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: bundler
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -38,20 +24,6 @@ dependencies:
38
24
  - - ">="
39
25
  - !ruby/object:Gem::Version
40
26
  version: 2.0.1
41
- - !ruby/object:Gem::Dependency
42
- name: codecov
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: 0.2.8
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: 0.2.8
55
27
  - !ruby/object:Gem::Dependency
56
28
  name: rspec
57
29
  requirement: !ruby/object:Gem::Requirement
@@ -80,34 +52,6 @@ dependencies:
80
52
  - - "~>"
81
53
  - !ruby/object:Gem::Version
82
54
  version: '0.77'
83
- - !ruby/object:Gem::Dependency
84
- name: sorbet
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '0.5'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '0.5'
97
- - !ruby/object:Gem::Dependency
98
- name: tapioca
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
55
  - !ruby/object:Gem::Dependency
112
56
  name: vcr
113
57
  requirement: !ruby/object:Gem::Requirement
@@ -146,12 +90,12 @@ files:
146
90
  - ".github/CODEOWNERS"
147
91
  - ".github/pull_request_template.md"
148
92
  - ".github/renovate.json"
93
+ - ".github/workflows/ci.yml"
94
+ - ".github/workflows/release.yml"
149
95
  - ".gitignore"
150
96
  - ".rspec"
151
97
  - ".rubocop.yml"
152
98
  - ".ruby-version"
153
- - ".semaphore/rubygems.yml"
154
- - ".semaphore/semaphore.yml"
155
99
  - Gemfile
156
100
  - Gemfile.lock
157
101
  - LICENSE
@@ -159,10 +103,6 @@ files:
159
103
  - bin/build
160
104
  - bin/console
161
105
  - bin/publish
162
- - bin/tapioca
163
- - codecov.yml
164
- - devbox.json
165
- - devbox.lock
166
106
  - lib/workos.rb
167
107
  - lib/workos/audit_log_export.rb
168
108
  - lib/workos/audit_logs.rb
@@ -182,6 +122,7 @@ files:
182
122
  - lib/workos/events.rb
183
123
  - lib/workos/factor.rb
184
124
  - lib/workos/hash_provider.rb
125
+ - lib/workos/impersonator.rb
185
126
  - lib/workos/invitation.rb
186
127
  - lib/workos/mfa.rb
187
128
  - lib/workos/organization.rb
@@ -191,28 +132,13 @@ files:
191
132
  - lib/workos/portal.rb
192
133
  - lib/workos/profile.rb
193
134
  - lib/workos/profile_and_token.rb
135
+ - lib/workos/refresh_authentication_response.rb
194
136
  - lib/workos/sso.rb
195
137
  - lib/workos/types.rb
196
- - lib/workos/types/audit_log_export_struct.rb
197
- - lib/workos/types/challenge_struct.rb
198
- - lib/workos/types/connection_struct.rb
199
- - lib/workos/types/directory_group_struct.rb
200
- - lib/workos/types/directory_struct.rb
201
- - lib/workos/types/directory_user_struct.rb
202
- - lib/workos/types/event_struct.rb
203
- - lib/workos/types/factor_struct.rb
204
- - lib/workos/types/intent_enum.rb
205
- - lib/workos/types/invitation_struct.rb
138
+ - lib/workos/types/intent.rb
206
139
  - lib/workos/types/list_struct.rb
207
- - lib/workos/types/magic_auth_challenge_struct.rb
208
- - lib/workos/types/organization_membership_struct.rb
209
- - lib/workos/types/organization_struct.rb
210
140
  - lib/workos/types/passwordless_session_struct.rb
211
- - lib/workos/types/profile_struct.rb
212
- - lib/workos/types/provider_enum.rb
213
- - lib/workos/types/user_struct.rb
214
- - lib/workos/types/verify_challenge_struct.rb
215
- - lib/workos/types/webhook_struct.rb
141
+ - lib/workos/types/provider.rb
216
142
  - lib/workos/user.rb
217
143
  - lib/workos/user_and_token.rb
218
144
  - lib/workos/user_management.rb
@@ -221,48 +147,6 @@ files:
221
147
  - lib/workos/version.rb
222
148
  - lib/workos/webhook.rb
223
149
  - lib/workos/webhooks.rb
224
- - sorbet/config
225
- - sorbet/rbi/gems/addressable@2.8.0.rbi
226
- - sorbet/rbi/gems/ast@2.4.2.rbi
227
- - sorbet/rbi/gems/codecov@0.2.12.rbi
228
- - sorbet/rbi/gems/coderay@1.1.3.rbi
229
- - sorbet/rbi/gems/crack@0.4.5.rbi
230
- - sorbet/rbi/gems/diff-lcs@1.4.4.rbi
231
- - sorbet/rbi/gems/docile@1.3.5.rbi
232
- - sorbet/rbi/gems/hashdiff@1.0.1.rbi
233
- - sorbet/rbi/gems/json@2.5.1.rbi
234
- - sorbet/rbi/gems/method_source@1.0.0.rbi
235
- - sorbet/rbi/gems/parallel@1.20.1.rbi
236
- - sorbet/rbi/gems/parser@3.0.1.0.rbi
237
- - sorbet/rbi/gems/pry@0.14.2.rbi
238
- - sorbet/rbi/gems/public_suffix@4.0.6.rbi
239
- - sorbet/rbi/gems/rainbow@3.0.0.rbi
240
- - sorbet/rbi/gems/rake@13.0.3.rbi
241
- - sorbet/rbi/gems/rbi@0.0.16.rbi
242
- - sorbet/rbi/gems/regexp_parser@2.1.1.rbi
243
- - sorbet/rbi/gems/rexml@3.2.5.rbi
244
- - sorbet/rbi/gems/rspec-core@3.9.3.rbi
245
- - sorbet/rbi/gems/rspec-expectations@3.9.4.rbi
246
- - sorbet/rbi/gems/rspec-mocks@3.9.1.rbi
247
- - sorbet/rbi/gems/rspec-support@3.9.4.rbi
248
- - sorbet/rbi/gems/rspec@3.9.0.rbi
249
- - sorbet/rbi/gems/rubocop-ast@1.4.1.rbi
250
- - sorbet/rbi/gems/rubocop@0.93.1.rbi
251
- - sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi
252
- - sorbet/rbi/gems/simplecov-html@0.12.3.rbi
253
- - sorbet/rbi/gems/simplecov@0.21.2.rbi
254
- - sorbet/rbi/gems/simplecov_json_formatter@0.1.2.rbi
255
- - sorbet/rbi/gems/spoom@1.1.15.rbi
256
- - sorbet/rbi/gems/tapioca@0.7.3.rbi
257
- - sorbet/rbi/gems/thor@1.2.1.rbi
258
- - sorbet/rbi/gems/unicode-display_width@1.7.0.rbi
259
- - sorbet/rbi/gems/unparser@0.6.2.rbi
260
- - sorbet/rbi/gems/vcr@5.0.0.rbi
261
- - sorbet/rbi/gems/webmock@3.12.2.rbi
262
- - sorbet/rbi/gems/yard-sorbet@0.8.0.rbi
263
- - sorbet/rbi/gems/yard@0.9.26.rbi
264
- - sorbet/tapioca/config.yml
265
- - sorbet/tapioca/require.rb
266
150
  - spec/lib/workos/audit_logs_spec.rb
267
151
  - spec/lib/workos/configuration_spec.rb
268
152
  - spec/lib/workos/directory_sync_spec.rb
@@ -364,6 +248,7 @@ files:
364
248
  - spec/support/fixtures/vcr_cassettes/sso/profile.yml
365
249
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/invalid.yml
366
250
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/valid.yml
251
+ - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/valid_with_impersonator.yml
367
252
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_email_verification/invalid.yml
368
253
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_email_verification/valid.yml
369
254
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_magic_auth/invalid.yml
@@ -372,6 +257,8 @@ files:
372
257
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_organization_selection/valid.yml
373
258
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_password/invalid.yml
374
259
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_password/valid.yml
260
+ - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_refresh_code/invalid.yml
261
+ - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_refresh_token/valid.yml
375
262
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_totp/invalid.yml
376
263
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_totp/valid.yml
377
264
  - spec/support/fixtures/vcr_cassettes/user_management/confirm_password_reset/invalid.yml
@@ -428,7 +315,7 @@ licenses:
428
315
  - MIT
429
316
  metadata:
430
317
  documentation_uri: https://docs.workos.com/sdk/ruby
431
- post_install_message:
318
+ post_install_message:
432
319
  rdoc_options: []
433
320
  require_paths:
434
321
  - lib
@@ -436,15 +323,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
436
323
  requirements:
437
324
  - - ">="
438
325
  - !ruby/object:Gem::Version
439
- version: '2.5'
326
+ version: '2.7'
440
327
  required_rubygems_version: !ruby/object:Gem::Requirement
441
328
  requirements:
442
329
  - - ">="
443
330
  - !ruby/object:Gem::Version
444
331
  version: '0'
445
332
  requirements: []
446
- rubygems_version: 3.5.6
447
- signing_key:
333
+ rubygems_version: 3.4.19
334
+ signing_key:
448
335
  specification_version: 4
449
336
  summary: API client for WorkOS
450
337
  test_files:
@@ -549,6 +436,7 @@ test_files:
549
436
  - spec/support/fixtures/vcr_cassettes/sso/profile.yml
550
437
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/invalid.yml
551
438
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/valid.yml
439
+ - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/valid_with_impersonator.yml
552
440
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_email_verification/invalid.yml
553
441
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_email_verification/valid.yml
554
442
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_magic_auth/invalid.yml
@@ -557,6 +445,8 @@ test_files:
557
445
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_organization_selection/valid.yml
558
446
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_password/invalid.yml
559
447
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_password/valid.yml
448
+ - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_refresh_code/invalid.yml
449
+ - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_refresh_token/valid.yml
560
450
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_totp/invalid.yml
561
451
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_totp/valid.yml
562
452
  - spec/support/fixtures/vcr_cassettes/user_management/confirm_password_reset/invalid.yml
@@ -1,24 +0,0 @@
1
- version: v1.0
2
-
3
- name: Rubygems deployment
4
- agent:
5
- machine:
6
- type: e1-standard-2
7
- os_image: ubuntu1804
8
-
9
- blocks:
10
- - name: Build & Publish 🛠 💎
11
- task:
12
- secrets:
13
- - name: workos-rubygems
14
- jobs:
15
- - name: Publish to Rubygems
16
- commands:
17
- - checkout
18
- - sem-version ruby 2.6.5
19
- - gem update --system
20
- - gem install bundler
21
- - bundle install
22
- - chmod 0600 /home/semaphore/.gem/credentials
23
- - bundle exec gem build workos --output=release.gem
24
- - bundle exec gem push release.gem
@@ -1,51 +0,0 @@
1
- version: v1.0
2
- name: Ruby
3
-
4
- agent:
5
- machine:
6
- type: e1-standard-2
7
- os_image: ubuntu2004
8
-
9
- blocks:
10
- - name: Run Sorbet 🍦
11
- task:
12
- jobs:
13
- - name: srb tc
14
- commands:
15
- - checkout
16
- - bundle install
17
- - bundle exec srb tc
18
-
19
- - name: Run Rubocop 🚔
20
- task:
21
- jobs:
22
- - name: rubocop
23
- commands:
24
- - checkout
25
- - bundle install
26
- - bundle exec rubocop
27
-
28
- - name: Run Tests 👩🏽‍🔬
29
- task:
30
- secrets:
31
- - name: codecov-workos-ruby
32
- jobs:
33
- - name: Ruby 1.9.3
34
- matrix:
35
- - env_var: RUBY_VERSION
36
- values:
37
- - 1.9.3-p551
38
- - 2.0.0-p648
39
- - 2.3.4
40
- - 2.5.7
41
- - 2.6.5
42
- - 2.7.3
43
- - 3.0.2
44
- commands:
45
- - checkout
46
- - sem-version ruby $RUBY_VERSION
47
- - bundle install
48
- - bundle exec rspec
49
- promotions:
50
- - name: Deploy workos-rb to rubygems
51
- pipeline_file: rubygems.yml
data/bin/tapioca DELETED
@@ -1,29 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- #
5
- # This file was generated by Bundler.
6
- #
7
- # The application 'tapioca' is installed as part of a gem, and
8
- # this file is here to facilitate running it.
9
- #
10
-
11
- require 'pathname'
12
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
13
- Pathname.new(__FILE__).realpath,)
14
-
15
- bundle_binstub = File.expand_path('bundle', __dir__)
16
-
17
- if File.file?(bundle_binstub)
18
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
- load(bundle_binstub)
20
- else
21
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
- Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
- end
24
- end
25
-
26
- require 'rubygems'
27
- require 'bundler/setup'
28
-
29
- load Gem.bin_path('tapioca', 'tapioca')
data/codecov.yml DELETED
@@ -1,12 +0,0 @@
1
- coverage:
2
- status:
3
- patch: off
4
- project:
5
- default:
6
- target: 90%
7
- parsers:
8
- v1:
9
- include_full_missed_files: true
10
- ignore:
11
- - "spec/*/**"
12
- - "sorbet/*/**"
data/devbox.json DELETED
@@ -1,18 +0,0 @@
1
- {
2
- "packages": [
3
- "ruby@3.0.2"
4
- ],
5
- "shell": {
6
- "init_hook": [
7
- "bundle install"
8
- ],
9
- "scripts": {
10
- "test": [
11
- "bundle exec rspec"
12
- ],
13
- "lint": [
14
- "bundle exec rubocop"
15
- ]
16
- }
17
- }
18
- }
data/devbox.lock DELETED
@@ -1,11 +0,0 @@
1
- {
2
- "lockfile_version": "1",
3
- "packages": {
4
- "ruby@3.0.2": {
5
- "last_modified": "2021-11-01T15:39:33Z",
6
- "plugin_version": "0.0.1",
7
- "resolved": "github:NixOS/nixpkgs/7053541084bf5ce2921ef307e5585d39d7ba8b3f#ruby_3_0",
8
- "version": "3.0.2"
9
- }
10
- }
11
- }
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
- # typed: strict
3
-
4
- module WorkOS
5
- module Types
6
- # This AuditLogExportStruct acts as a typed interface
7
- # for the AuditLogExport class
8
- class AuditLogExportStruct < T::Struct
9
- const :object, String
10
- const :id, String
11
- const :state, String
12
- const :url, T.nilable(String)
13
- const :created_at, String
14
- const :updated_at, String
15
- end
16
- end
17
- end
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
- # typed: strict
3
-
4
- module WorkOS
5
- module Types
6
- # This ChallgengeStruct acts as a typed interface
7
- # for the Factor class
8
- class ChallengeStruct < T::Struct
9
- const :id, String
10
- const :object, String
11
- const :expires_at, String
12
- const :code, T.nilable(String)
13
- const :authentication_factor_id, String
14
- const :created_at, String
15
- const :updated_at, String
16
- end
17
- end
18
- end
@@ -1,20 +0,0 @@
1
- # frozen_string_literal: true
2
- # typed: strict
3
-
4
- module WorkOS
5
- module Types
6
- # This ConnectionStruct acts as a typed interface
7
- # for the Connection class
8
- class ConnectionStruct < T::Struct
9
- const :id, String
10
- const :name, String
11
- const :connection_type, String
12
- const :domains, T::Array[T.untyped]
13
- const :organization_id, T.nilable(String)
14
- const :state, String
15
- const :status, String
16
- const :created_at, String
17
- const :updated_at, String
18
- end
19
- end
20
- end