workos 4.7.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/workos/client.rb +16 -4
- data/lib/workos/directory_sync.rb +0 -2
- data/lib/workos/errors.rb +18 -1
- data/lib/workos/events.rb +2 -0
- data/lib/workos/user_management.rb +20 -1
- data/lib/workos/version.rb +1 -1
- data/lib/workos.rb +3 -0
- data/spec/lib/workos/client.rb +67 -0
- data/spec/lib/workos/directory_sync_spec.rb +5 -28
- data/spec/lib/workos/event_spec.rb +13 -13
- data/spec/lib/workos/mfa_spec.rb +3 -3
- data/spec/lib/workos/organizations_spec.rb +2 -2
- data/spec/lib/workos/passwordless_spec.rb +2 -2
- data/spec/lib/workos/sso_spec.rb +2 -2
- data/spec/lib/workos/user_management_spec.rb +43 -17
- data/spec/support/fixtures/vcr_cassettes/base/execute_request_unauthenticated.yml +63 -63
- data/spec/support/fixtures/vcr_cassettes/events/list_events_with_after.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/events/list_events_with_no_options.yml +26 -25
- data/spec/support/fixtures/vcr_cassettes/events/list_events_with_organization_id.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/events/list_events_with_range.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/user_management/find_invitation_by_token/invalid.yml +80 -0
- data/spec/support/fixtures/vcr_cassettes/user_management/find_invitation_by_token/valid.yml +80 -0
- metadata +8 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7d59f479bcadc439580843b8c8a608b41e4c0183d657241955ed3cfbc0f75a38
|
|
4
|
+
data.tar.gz: 48209d43a10edf6d5afa7b4ed5d92c69ee400afb660d23152706b46970602dcc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4457fcc8b132f5c7229d8ac5a480b0a3b86de5c1f5a8f28b688cca1e228a1d745fb906495708cf1466cc3a97aaead69fcb970f5fbffd457cdb8cf474ae72eda9
|
|
7
|
+
data.tar.gz: 778cebe2ed866d97858822ec755de7ebe105203450e1cc1de8858b863c1af21788582c74d86f249ea2c5561d5c330c669540d970e2769fadbed8f997e223daba
|
data/Gemfile.lock
CHANGED
data/lib/workos/client.rb
CHANGED
|
@@ -86,7 +86,7 @@ module WorkOS
|
|
|
86
86
|
].join('; ')
|
|
87
87
|
end
|
|
88
88
|
|
|
89
|
-
# rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
|
89
|
+
# rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity:
|
|
90
90
|
def handle_error_response(response:)
|
|
91
91
|
http_status = response.code.to_i
|
|
92
92
|
json = JSON.parse(response.body)
|
|
@@ -99,6 +99,9 @@ module WorkOS
|
|
|
99
99
|
request_id: response['x-request-id'],
|
|
100
100
|
code: json['code'],
|
|
101
101
|
errors: json['errors'],
|
|
102
|
+
error: json['error'],
|
|
103
|
+
error_description: json['error_description'],
|
|
104
|
+
data: json,
|
|
102
105
|
)
|
|
103
106
|
when 401
|
|
104
107
|
raise AuthenticationError.new(
|
|
@@ -107,7 +110,7 @@ module WorkOS
|
|
|
107
110
|
request_id: response['x-request-id'],
|
|
108
111
|
)
|
|
109
112
|
when 404
|
|
110
|
-
raise
|
|
113
|
+
raise NotFoundError.new(
|
|
111
114
|
message: json['message'],
|
|
112
115
|
http_status: http_status,
|
|
113
116
|
request_id: response['x-request-id'],
|
|
@@ -118,12 +121,21 @@ module WorkOS
|
|
|
118
121
|
errors = extract_error(json['errors']) if json['errors']
|
|
119
122
|
message += " (#{errors})" if errors
|
|
120
123
|
|
|
121
|
-
raise
|
|
124
|
+
raise UnprocessableEntityError.new(
|
|
122
125
|
message: message,
|
|
123
126
|
http_status: http_status,
|
|
124
127
|
request_id: response['x-request-id'],
|
|
128
|
+
error: json['error'],
|
|
129
|
+
errors: errors,
|
|
125
130
|
code: code,
|
|
126
131
|
)
|
|
132
|
+
when 429
|
|
133
|
+
raise RateLimitExceededError.new(
|
|
134
|
+
message: json['message'],
|
|
135
|
+
http_status: http_status,
|
|
136
|
+
request_id: response['x-request-id'],
|
|
137
|
+
retry_after: response['Retry-After'],
|
|
138
|
+
)
|
|
127
139
|
else
|
|
128
140
|
raise APIError.new(
|
|
129
141
|
message: json['message'],
|
|
@@ -132,7 +144,7 @@ module WorkOS
|
|
|
132
144
|
)
|
|
133
145
|
end
|
|
134
146
|
end
|
|
135
|
-
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize
|
|
147
|
+
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity:
|
|
136
148
|
|
|
137
149
|
private
|
|
138
150
|
|
|
@@ -15,8 +15,6 @@ module WorkOS
|
|
|
15
15
|
# Retrieve directories.
|
|
16
16
|
#
|
|
17
17
|
# @param [Hash] options An options hash
|
|
18
|
-
# @option options [String] domain The domain of the directory to be
|
|
19
|
-
# retrieved.
|
|
20
18
|
# @option options [String] search A search term for direcory names.
|
|
21
19
|
# @option options [String] limit Maximum number of records to return.
|
|
22
20
|
# @option options [String] order The order in which to paginate records
|
data/lib/workos/errors.rb
CHANGED
|
@@ -7,6 +7,10 @@ module WorkOS
|
|
|
7
7
|
attr_reader :request_id
|
|
8
8
|
attr_reader :code
|
|
9
9
|
attr_reader :errors
|
|
10
|
+
attr_reader :error
|
|
11
|
+
attr_reader :error_description
|
|
12
|
+
attr_reader :data
|
|
13
|
+
attr_reader :retry_after
|
|
10
14
|
|
|
11
15
|
# rubocop:disable Metrics/ParameterLists
|
|
12
16
|
def initialize(
|
|
@@ -16,7 +20,9 @@ module WorkOS
|
|
|
16
20
|
http_status: nil,
|
|
17
21
|
request_id: nil,
|
|
18
22
|
code: nil,
|
|
19
|
-
errors: nil
|
|
23
|
+
errors: nil,
|
|
24
|
+
data: nil,
|
|
25
|
+
retry_after: nil
|
|
20
26
|
)
|
|
21
27
|
@message = message
|
|
22
28
|
@error = error
|
|
@@ -25,6 +31,8 @@ module WorkOS
|
|
|
25
31
|
@request_id = request_id
|
|
26
32
|
@code = code
|
|
27
33
|
@errors = errors
|
|
34
|
+
@data = data
|
|
35
|
+
@retry_after = retry_after
|
|
28
36
|
end
|
|
29
37
|
# rubocop:enable Metrics/ParameterLists
|
|
30
38
|
|
|
@@ -62,4 +70,13 @@ module WorkOS
|
|
|
62
70
|
|
|
63
71
|
# TimeoutError is raised when the HTTP request to the API times out
|
|
64
72
|
class TimeoutError < WorkOSError; end
|
|
73
|
+
|
|
74
|
+
# RateLimitExceededError is raised when the rate limit for the API has been hit
|
|
75
|
+
class RateLimitExceededError < WorkOSError; end
|
|
76
|
+
|
|
77
|
+
# NotFoundError is raised when a resource is not found
|
|
78
|
+
class NotFoundError < WorkOSError; end
|
|
79
|
+
|
|
80
|
+
# UnprocessableEntityError is raised when a request is made that cannot be processed
|
|
81
|
+
class UnprocessableEntityError < WorkOSError; end
|
|
65
82
|
end
|
data/lib/workos/events.rb
CHANGED
|
@@ -603,9 +603,11 @@ module WorkOS
|
|
|
603
603
|
# @param [String] totp_issuer For totp factors. Typically your application
|
|
604
604
|
# or company name, this helps users distinguish between factors in authenticator apps.
|
|
605
605
|
# @param [String] totp_user For totp factors. Used as the account name in authenticator apps.
|
|
606
|
+
# @param [String] totp_secret For totp factors. The Base32 encdoded secret key for the
|
|
607
|
+
# factor. Generated if not provided. (Optional)
|
|
606
608
|
#
|
|
607
609
|
# @return WorkOS::AuthenticationFactorAndChallenge
|
|
608
|
-
def enroll_auth_factor(user_id:, type:, totp_issuer: nil, totp_user: nil)
|
|
610
|
+
def enroll_auth_factor(user_id:, type:, totp_issuer: nil, totp_user: nil, totp_secret: nil)
|
|
609
611
|
validate_auth_factor_type(
|
|
610
612
|
type: type,
|
|
611
613
|
)
|
|
@@ -617,6 +619,7 @@ module WorkOS
|
|
|
617
619
|
type: type,
|
|
618
620
|
totp_issuer: totp_issuer,
|
|
619
621
|
totp_user: totp_user,
|
|
622
|
+
totp_secret: totp_secret,
|
|
620
623
|
},
|
|
621
624
|
auth: true,
|
|
622
625
|
),
|
|
@@ -919,6 +922,22 @@ module WorkOS
|
|
|
919
922
|
WorkOS::Invitation.new(response.body)
|
|
920
923
|
end
|
|
921
924
|
|
|
925
|
+
# Finds an Invitation by Token
|
|
926
|
+
#
|
|
927
|
+
# @param [String] token The token of the Invitation.
|
|
928
|
+
#
|
|
929
|
+
# @return WorkOS::Invitation
|
|
930
|
+
def find_invitation_by_token(token:)
|
|
931
|
+
response = execute_request(
|
|
932
|
+
request: get_request(
|
|
933
|
+
path: "/user_management/invitations/by_token/#{token}",
|
|
934
|
+
auth: true,
|
|
935
|
+
),
|
|
936
|
+
)
|
|
937
|
+
|
|
938
|
+
WorkOS::Invitation.new(response.body)
|
|
939
|
+
end
|
|
940
|
+
|
|
922
941
|
# Retrieve a list of invitations.
|
|
923
942
|
#
|
|
924
943
|
# @param [Hash] options
|
data/lib/workos/version.rb
CHANGED
data/lib/workos.rb
CHANGED
|
@@ -87,4 +87,7 @@ module WorkOS
|
|
|
87
87
|
autoload :InvalidRequestError, 'workos/errors'
|
|
88
88
|
autoload :SignatureVerificationError, 'workos/errors'
|
|
89
89
|
autoload :TimeoutError, 'workos/errors'
|
|
90
|
+
autoload :NotFoundError, 'workos/errors'
|
|
91
|
+
autoload :UnprocessableEntityError, 'workos/errors'
|
|
92
|
+
autoload :RateLimitExceededError, 'workos/errors'
|
|
90
93
|
end
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# rubocop:disable Style/MultilineBlockChain
|
|
4
|
+
describe WorkOS::Client do
|
|
5
|
+
describe '.client' do
|
|
6
|
+
it 'returns a 400 error with appropriate fields' do
|
|
7
|
+
VCR.use_cassette('user_management/authenticate_with_code/invalid') do
|
|
8
|
+
expect do
|
|
9
|
+
WorkOS::UserManagement.authenticate_with_code(
|
|
10
|
+
code: 'invalid',
|
|
11
|
+
client_id: 'client_123',
|
|
12
|
+
ip_address: '200.240.210.16',
|
|
13
|
+
user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) Chrome/108.0.0.0 Safari/537.36',
|
|
14
|
+
)
|
|
15
|
+
end.to raise_error do |error|
|
|
16
|
+
expect(error).to be_a(WorkOS::InvalidRequestError)
|
|
17
|
+
expect(error.error).not_to be_nil
|
|
18
|
+
expect(error.error_description).not_to be_nil
|
|
19
|
+
expect(error.data).not_to be_nil
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
it 'returns a 401 error with appropriate fields' do
|
|
25
|
+
VCR.use_cassette('base/execute_request_unauthenticated') do
|
|
26
|
+
expect do
|
|
27
|
+
WorkOS::AuditLogs.create_event(
|
|
28
|
+
organization: 'org_123',
|
|
29
|
+
event: {},
|
|
30
|
+
)
|
|
31
|
+
end.to raise_error do |error|
|
|
32
|
+
expect(error).to be_a(WorkOS::AuthenticationError)
|
|
33
|
+
expect(error.message).not_to be_nil
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
it 'returns a 404 error with appropriate fields' do
|
|
39
|
+
VCR.use_cassette('user_management/get_email_verification/invalid') do
|
|
40
|
+
expect do
|
|
41
|
+
WorkOS::UserManagement.get_email_verification(
|
|
42
|
+
id: 'invalid',
|
|
43
|
+
)
|
|
44
|
+
end.to raise_error do |error|
|
|
45
|
+
expect(error).to be_a(WorkOS::NotFoundError)
|
|
46
|
+
expect(error.message).not_to be_nil
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
it 'returns a 422 error with appropriate fields' do
|
|
52
|
+
VCR.use_cassette('user_management/create_user_invalid') do
|
|
53
|
+
expect do
|
|
54
|
+
WorkOS::UserManagement.create_user(
|
|
55
|
+
email: 'invalid',
|
|
56
|
+
)
|
|
57
|
+
end.to raise_error do |error|
|
|
58
|
+
expect(error).to be_a(WorkOS::UnprocessableEntityError)
|
|
59
|
+
expect(error.message).not_to be_nil
|
|
60
|
+
expect(error.errors).not_to be_nil
|
|
61
|
+
expect(error.code).not_to be_nil
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
# rubocop:enable Style/MultilineBlockChain
|
|
@@ -20,29 +20,6 @@ describe WorkOS::DirectorySync do
|
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
context 'with domain option' do
|
|
24
|
-
it 'forms the proper request to the API' do
|
|
25
|
-
request_args = [
|
|
26
|
-
'/directories?domain=foo-corp.com&'\
|
|
27
|
-
'order=desc',
|
|
28
|
-
'Content-Type' => 'application/json'
|
|
29
|
-
]
|
|
30
|
-
|
|
31
|
-
expected_request = Net::HTTP::Get.new(*request_args)
|
|
32
|
-
|
|
33
|
-
expect(Net::HTTP::Get).to receive(:new).with(*request_args).
|
|
34
|
-
and_return(expected_request)
|
|
35
|
-
|
|
36
|
-
VCR.use_cassette 'directory_sync/list_directories/with_domain' do
|
|
37
|
-
directories = described_class.list_directories(
|
|
38
|
-
domain: 'foo-corp.com',
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
expect(directories.data.size).to eq(1)
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
|
|
46
23
|
context 'with search option' do
|
|
47
24
|
it 'forms the proper request to the API' do
|
|
48
25
|
request_args = [
|
|
@@ -171,7 +148,7 @@ describe WorkOS::DirectorySync do
|
|
|
171
148
|
expect do
|
|
172
149
|
WorkOS::DirectorySync.get_directory(id: 'invalid')
|
|
173
150
|
end.to raise_error(
|
|
174
|
-
WorkOS::
|
|
151
|
+
WorkOS::NotFoundError,
|
|
175
152
|
"Status 404, Directory not found: 'invalid'. - request ID: ",
|
|
176
153
|
)
|
|
177
154
|
end
|
|
@@ -185,7 +162,7 @@ describe WorkOS::DirectorySync do
|
|
|
185
162
|
VCR.use_cassette('directory_sync/list_groups/with_no_options') do
|
|
186
163
|
expect do
|
|
187
164
|
WorkOS::DirectorySync.list_groups
|
|
188
|
-
end.to raise_error(WorkOS::
|
|
165
|
+
end.to raise_error(WorkOS::UnprocessableEntityError)
|
|
189
166
|
end
|
|
190
167
|
end
|
|
191
168
|
end
|
|
@@ -319,7 +296,7 @@ describe WorkOS::DirectorySync do
|
|
|
319
296
|
VCR.use_cassette('directory_sync/list_users/with_no_options') do
|
|
320
297
|
expect do
|
|
321
298
|
WorkOS::DirectorySync.list_users
|
|
322
|
-
end.to raise_error(WorkOS::
|
|
299
|
+
end.to raise_error(WorkOS::UnprocessableEntityError)
|
|
323
300
|
end
|
|
324
301
|
end
|
|
325
302
|
end
|
|
@@ -471,7 +448,7 @@ describe WorkOS::DirectorySync do
|
|
|
471
448
|
VCR.use_cassette('directory_sync/get_group_with_invalid_id') do
|
|
472
449
|
expect do
|
|
473
450
|
WorkOS::DirectorySync.get_group('invalid')
|
|
474
|
-
end.to raise_error(WorkOS::
|
|
451
|
+
end.to raise_error(WorkOS:: NotFoundError)
|
|
475
452
|
end
|
|
476
453
|
end
|
|
477
454
|
end
|
|
@@ -498,7 +475,7 @@ describe WorkOS::DirectorySync do
|
|
|
498
475
|
VCR.use_cassette('directory_sync/get_user_with_invalid_id') do
|
|
499
476
|
expect do
|
|
500
477
|
WorkOS::DirectorySync.get_user('invalid')
|
|
501
|
-
end.to raise_error(WorkOS::
|
|
478
|
+
end.to raise_error(WorkOS::NotFoundError)
|
|
502
479
|
end
|
|
503
480
|
end
|
|
504
481
|
end
|
|
@@ -5,16 +5,11 @@ describe WorkOS::Events do
|
|
|
5
5
|
|
|
6
6
|
describe '.list_events' do
|
|
7
7
|
context 'with no options' do
|
|
8
|
-
it '
|
|
9
|
-
expected_metadata = {
|
|
10
|
-
'after' => nil,
|
|
11
|
-
}
|
|
12
|
-
|
|
8
|
+
it 'raises ArgumentError' do
|
|
13
9
|
VCR.use_cassette 'events/list_events_with_no_options' do
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
expect(events.list_metadata).to eq(expected_metadata)
|
|
10
|
+
expect do
|
|
11
|
+
described_class.list_events
|
|
12
|
+
end.to raise_error(ArgumentError)
|
|
18
13
|
end
|
|
19
14
|
end
|
|
20
15
|
end
|
|
@@ -44,7 +39,7 @@ describe WorkOS::Events do
|
|
|
44
39
|
context 'with the after option' do
|
|
45
40
|
it 'forms the proper request to the API' do
|
|
46
41
|
request_args = [
|
|
47
|
-
'/events?after=event_01FGCPNV312FHFRCX0BYWHVSE1',
|
|
42
|
+
'/events?after=event_01FGCPNV312FHFRCX0BYWHVSE1&events=dsync.user.created',
|
|
48
43
|
'Content-Type' => 'application/json'
|
|
49
44
|
]
|
|
50
45
|
|
|
@@ -54,7 +49,10 @@ describe WorkOS::Events do
|
|
|
54
49
|
and_return(expected_request)
|
|
55
50
|
|
|
56
51
|
VCR.use_cassette 'events/list_events_with_after' do
|
|
57
|
-
events = described_class.list_events(
|
|
52
|
+
events = described_class.list_events(
|
|
53
|
+
after: 'event_01FGCPNV312FHFRCX0BYWHVSE1',
|
|
54
|
+
events: ['dsync.user.created'],
|
|
55
|
+
)
|
|
58
56
|
|
|
59
57
|
expect(events.data.size).to eq(1)
|
|
60
58
|
end
|
|
@@ -64,7 +62,7 @@ describe WorkOS::Events do
|
|
|
64
62
|
context 'with the range_start and range_end options' do
|
|
65
63
|
it 'forms the proper request to the API' do
|
|
66
64
|
request_args = [
|
|
67
|
-
'/events?range_start=2023-01-01T00%3A00%3A00Z&range_end=2023-01-03T00%3A00%3A00Z',
|
|
65
|
+
'/events?events=dsync.user.created&range_start=2023-01-01T00%3A00%3A00Z&range_end=2023-01-03T00%3A00%3A00Z',
|
|
68
66
|
'Content-Type' => 'application/json'
|
|
69
67
|
]
|
|
70
68
|
|
|
@@ -75,6 +73,7 @@ describe WorkOS::Events do
|
|
|
75
73
|
|
|
76
74
|
VCR.use_cassette 'events/list_events_with_range' do
|
|
77
75
|
events = described_class.list_events(
|
|
76
|
+
events: ['dsync.user.created'],
|
|
78
77
|
range_start: '2023-01-01T00:00:00Z',
|
|
79
78
|
range_end: '2023-01-03T00:00:00Z',
|
|
80
79
|
)
|
|
@@ -87,7 +86,7 @@ describe WorkOS::Events do
|
|
|
87
86
|
context 'with the organization_id option' do
|
|
88
87
|
it 'forms the proper request to the API' do
|
|
89
88
|
request_args = [
|
|
90
|
-
'/events?organization_id=org_1234',
|
|
89
|
+
'/events?events=dsync.user.created&organization_id=org_1234',
|
|
91
90
|
'Content-Type' => 'application/json'
|
|
92
91
|
]
|
|
93
92
|
|
|
@@ -98,6 +97,7 @@ describe WorkOS::Events do
|
|
|
98
97
|
|
|
99
98
|
VCR.use_cassette 'events/list_events_with_organization_id' do
|
|
100
99
|
events = described_class.list_events(
|
|
100
|
+
events: ['dsync.user.created'],
|
|
101
101
|
organization_id: 'org_1234',
|
|
102
102
|
)
|
|
103
103
|
|
data/spec/lib/workos/mfa_spec.rb
CHANGED
|
@@ -188,7 +188,7 @@ describe WorkOS::MFA do
|
|
|
188
188
|
authentication_challenge_id: 'auth_challenge_01FZ4YVRBMXP5ZM0A7BP4AJ12J',
|
|
189
189
|
code: '897792',
|
|
190
190
|
)
|
|
191
|
-
end.to raise_error(WorkOS::
|
|
191
|
+
end.to raise_error(WorkOS::UnprocessableEntityError)
|
|
192
192
|
end
|
|
193
193
|
end
|
|
194
194
|
end
|
|
@@ -201,7 +201,7 @@ describe WorkOS::MFA do
|
|
|
201
201
|
authentication_challenge_id: 'auth_challenge_01FZ4YVRBMXP5ZM0A7BP4AJ12J',
|
|
202
202
|
code: '897792',
|
|
203
203
|
)
|
|
204
|
-
end.to raise_error(WorkOS::
|
|
204
|
+
end.to raise_error(WorkOS::UnprocessableEntityError)
|
|
205
205
|
end
|
|
206
206
|
end
|
|
207
207
|
end
|
|
@@ -264,7 +264,7 @@ describe WorkOS::MFA do
|
|
|
264
264
|
described_class.get_factor(
|
|
265
265
|
id: 'auth_factor_invalid',
|
|
266
266
|
)
|
|
267
|
-
end.to raise_error(WorkOS::
|
|
267
|
+
end.to raise_error(WorkOS::NotFoundError)
|
|
268
268
|
end
|
|
269
269
|
end
|
|
270
270
|
end
|
|
@@ -257,7 +257,7 @@ describe WorkOS::Organizations do
|
|
|
257
257
|
expect do
|
|
258
258
|
described_class.get_organization(id: 'invalid')
|
|
259
259
|
end.to raise_error(
|
|
260
|
-
WorkOS::
|
|
260
|
+
WorkOS::NotFoundError,
|
|
261
261
|
'Status 404, Not Found - request ID: ',
|
|
262
262
|
)
|
|
263
263
|
end
|
|
@@ -302,7 +302,7 @@ describe WorkOS::Organizations do
|
|
|
302
302
|
expect do
|
|
303
303
|
described_class.delete_organization(id: 'invalid')
|
|
304
304
|
end.to raise_error(
|
|
305
|
-
WorkOS::
|
|
305
|
+
WorkOS::NotFoundError,
|
|
306
306
|
'Status 404, Not Found - request ID: ',
|
|
307
307
|
)
|
|
308
308
|
end
|
|
@@ -32,7 +32,7 @@ describe WorkOS::Passwordless do
|
|
|
32
32
|
expect do
|
|
33
33
|
described_class.create_session(invalid_options)
|
|
34
34
|
end.to raise_error(
|
|
35
|
-
WorkOS::
|
|
35
|
+
WorkOS::UnprocessableEntityError,
|
|
36
36
|
/Status 422, Validation failed \(email: email must be a string; type: type must be a valid enum value\)/,
|
|
37
37
|
)
|
|
38
38
|
end
|
|
@@ -66,7 +66,7 @@ describe WorkOS::Passwordless do
|
|
|
66
66
|
expect do
|
|
67
67
|
described_class.send_session('session_123')
|
|
68
68
|
end.to raise_error(
|
|
69
|
-
WorkOS::
|
|
69
|
+
WorkOS::UnprocessableEntityError,
|
|
70
70
|
/Status 422, The passwordless session 'session_123' has expired or is invalid./,
|
|
71
71
|
)
|
|
72
72
|
end
|
data/spec/lib/workos/sso_spec.rb
CHANGED
|
@@ -618,7 +618,7 @@ describe WorkOS::SSO do
|
|
|
618
618
|
expect do
|
|
619
619
|
WorkOS::SSO.get_connection(id: 'invalid')
|
|
620
620
|
end.to raise_error(
|
|
621
|
-
WorkOS::
|
|
621
|
+
WorkOS::NotFoundError,
|
|
622
622
|
'Status 404, Not Found - request ID: ',
|
|
623
623
|
)
|
|
624
624
|
end
|
|
@@ -645,7 +645,7 @@ describe WorkOS::SSO do
|
|
|
645
645
|
expect do
|
|
646
646
|
WorkOS::SSO.delete_connection(id: 'invalid')
|
|
647
647
|
end.to raise_error(
|
|
648
|
-
WorkOS::
|
|
648
|
+
WorkOS::NotFoundError,
|
|
649
649
|
'Status 404, Not Found - request ID: ',
|
|
650
650
|
)
|
|
651
651
|
end
|
|
@@ -312,7 +312,7 @@ describe WorkOS::UserManagement do
|
|
|
312
312
|
expect do
|
|
313
313
|
described_class.create_user(email: '')
|
|
314
314
|
end.to raise_error(
|
|
315
|
-
WorkOS::
|
|
315
|
+
WorkOS::UnprocessableEntityError,
|
|
316
316
|
/email_string_required/,
|
|
317
317
|
)
|
|
318
318
|
end
|
|
@@ -342,7 +342,7 @@ describe WorkOS::UserManagement do
|
|
|
342
342
|
VCR.use_cassette 'user_management/update_user/invalid' do
|
|
343
343
|
expect do
|
|
344
344
|
described_class.update_user(id: 'invalid')
|
|
345
|
-
end.to raise_error(WorkOS::
|
|
345
|
+
end.to raise_error(WorkOS::NotFoundError, /User not found/)
|
|
346
346
|
end
|
|
347
347
|
end
|
|
348
348
|
end
|
|
@@ -367,7 +367,7 @@ describe WorkOS::UserManagement do
|
|
|
367
367
|
VCR.use_cassette('user_management/delete_user/invalid') do
|
|
368
368
|
expect do
|
|
369
369
|
WorkOS::UserManagement.delete_user(id: 'invalid')
|
|
370
|
-
end.to raise_error(WorkOS::
|
|
370
|
+
end.to raise_error(WorkOS::NotFoundError, /User not found/)
|
|
371
371
|
end
|
|
372
372
|
end
|
|
373
373
|
end
|
|
@@ -400,7 +400,7 @@ describe WorkOS::UserManagement do
|
|
|
400
400
|
ip_address: '200.240.210.16',
|
|
401
401
|
user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) Chrome/108.0.0.0 Safari/537.36',
|
|
402
402
|
)
|
|
403
|
-
end.to raise_error(WorkOS::
|
|
403
|
+
end.to raise_error(WorkOS::NotFoundError, /User not found/)
|
|
404
404
|
end
|
|
405
405
|
end
|
|
406
406
|
end
|
|
@@ -512,7 +512,7 @@ describe WorkOS::UserManagement do
|
|
|
512
512
|
client_id: 'client_123',
|
|
513
513
|
email: 'test@workos.com',
|
|
514
514
|
)
|
|
515
|
-
end.to raise_error(WorkOS::
|
|
515
|
+
end.to raise_error(WorkOS::NotFoundError, /User not found/)
|
|
516
516
|
end
|
|
517
517
|
end
|
|
518
518
|
end
|
|
@@ -637,7 +637,7 @@ describe WorkOS::UserManagement do
|
|
|
637
637
|
VCR.use_cassette('user_management/get_magic_auth/invalid') do
|
|
638
638
|
expect do
|
|
639
639
|
WorkOS::UserManagement.get_magic_auth(id: 'invalid')
|
|
640
|
-
end.to raise_error(WorkOS::
|
|
640
|
+
end.to raise_error(WorkOS::NotFoundError, /MagicAuth not found/)
|
|
641
641
|
end
|
|
642
642
|
end
|
|
643
643
|
end
|
|
@@ -677,6 +677,7 @@ describe WorkOS::UserManagement do
|
|
|
677
677
|
authentication_response = WorkOS::UserManagement.enroll_auth_factor(
|
|
678
678
|
user_id: 'user_01H7TVSKS45SDHN5V9XPSM6H44',
|
|
679
679
|
type: 'totp',
|
|
680
|
+
totp_secret: 'secret-test',
|
|
680
681
|
)
|
|
681
682
|
|
|
682
683
|
expect(authentication_response.authentication_factor.id).to eq('auth_factor_01H96FETXENNY99ARX0GRC804C')
|
|
@@ -755,7 +756,7 @@ describe WorkOS::UserManagement do
|
|
|
755
756
|
VCR.use_cassette('user_management/get_email_verification/invalid') do
|
|
756
757
|
expect do
|
|
757
758
|
WorkOS::UserManagement.get_email_verification(id: 'invalid')
|
|
758
|
-
end.to raise_error(WorkOS::
|
|
759
|
+
end.to raise_error(WorkOS::NotFoundError, /Email Verification not found/)
|
|
759
760
|
end
|
|
760
761
|
end
|
|
761
762
|
end
|
|
@@ -780,7 +781,7 @@ describe WorkOS::UserManagement do
|
|
|
780
781
|
described_class.send_verification_email(
|
|
781
782
|
user_id: 'bad_id',
|
|
782
783
|
)
|
|
783
|
-
end.to raise_error(WorkOS::
|
|
784
|
+
end.to raise_error(WorkOS::NotFoundError, /User not found/)
|
|
784
785
|
end
|
|
785
786
|
end
|
|
786
787
|
end
|
|
@@ -809,7 +810,7 @@ describe WorkOS::UserManagement do
|
|
|
809
810
|
code: '659770',
|
|
810
811
|
user_id: 'bad_id',
|
|
811
812
|
)
|
|
812
|
-
end.to raise_error(WorkOS::
|
|
813
|
+
end.to raise_error(WorkOS::NotFoundError, /User not found/)
|
|
813
814
|
end
|
|
814
815
|
end
|
|
815
816
|
end
|
|
@@ -848,7 +849,7 @@ describe WorkOS::UserManagement do
|
|
|
848
849
|
VCR.use_cassette('user_management/get_password_reset/invalid') do
|
|
849
850
|
expect do
|
|
850
851
|
WorkOS::UserManagement.get_password_reset(id: 'invalid')
|
|
851
|
-
end.to raise_error(WorkOS::
|
|
852
|
+
end.to raise_error(WorkOS::NotFoundError, /Password Reset not found/)
|
|
852
853
|
end
|
|
853
854
|
end
|
|
854
855
|
end
|
|
@@ -892,7 +893,7 @@ describe WorkOS::UserManagement do
|
|
|
892
893
|
password_reset_url: '',
|
|
893
894
|
)
|
|
894
895
|
end.to raise_error(
|
|
895
|
-
WorkOS::
|
|
896
|
+
WorkOS::UnprocessableEntityError,
|
|
896
897
|
/password_reset_url_string_required/,
|
|
897
898
|
)
|
|
898
899
|
end
|
|
@@ -923,7 +924,7 @@ describe WorkOS::UserManagement do
|
|
|
923
924
|
new_password: 'new_password',
|
|
924
925
|
)
|
|
925
926
|
end.to raise_error(
|
|
926
|
-
WorkOS::
|
|
927
|
+
WorkOS::NotFoundError,
|
|
927
928
|
/Could not locate user with provided token/,
|
|
928
929
|
)
|
|
929
930
|
end
|
|
@@ -1047,7 +1048,7 @@ describe WorkOS::UserManagement do
|
|
|
1047
1048
|
expect do
|
|
1048
1049
|
described_class.create_organization_membership(user_id: '', organization_id: '')
|
|
1049
1050
|
end.to raise_error(
|
|
1050
|
-
WorkOS::
|
|
1051
|
+
WorkOS::UnprocessableEntityError,
|
|
1051
1052
|
/user_id_string_required/,
|
|
1052
1053
|
)
|
|
1053
1054
|
end
|
|
@@ -1074,7 +1075,7 @@ describe WorkOS::UserManagement do
|
|
|
1074
1075
|
VCR.use_cassette('user_management/delete_organization_membership/invalid') do
|
|
1075
1076
|
expect do
|
|
1076
1077
|
WorkOS::UserManagement.delete_organization_membership(id: 'invalid')
|
|
1077
|
-
end.to raise_error(WorkOS::
|
|
1078
|
+
end.to raise_error(WorkOS::NotFoundError, /Organization Membership not found/)
|
|
1078
1079
|
end
|
|
1079
1080
|
end
|
|
1080
1081
|
end
|
|
@@ -1149,7 +1150,32 @@ describe WorkOS::UserManagement do
|
|
|
1149
1150
|
VCR.use_cassette('user_management/get_invitation/invalid') do
|
|
1150
1151
|
expect do
|
|
1151
1152
|
WorkOS::UserManagement.get_invitation(id: 'invalid')
|
|
1152
|
-
end.to raise_error(WorkOS::
|
|
1153
|
+
end.to raise_error(WorkOS::NotFoundError, /Invitation not found/)
|
|
1154
|
+
end
|
|
1155
|
+
end
|
|
1156
|
+
end
|
|
1157
|
+
end
|
|
1158
|
+
|
|
1159
|
+
describe '.find_invitation_by_token' do
|
|
1160
|
+
context 'with a valid id' do
|
|
1161
|
+
it 'returns an invitation' do
|
|
1162
|
+
VCR.use_cassette 'user_management/find_invitation_by_token/valid' do
|
|
1163
|
+
invitation = described_class.find_invitation_by_token(
|
|
1164
|
+
token: 'iUV3XbYajpJlbpw1Qt3ZKlaKx',
|
|
1165
|
+
)
|
|
1166
|
+
|
|
1167
|
+
expect(invitation.id.instance_of?(String))
|
|
1168
|
+
expect(invitation.instance_of?(WorkOS::Invitation))
|
|
1169
|
+
end
|
|
1170
|
+
end
|
|
1171
|
+
end
|
|
1172
|
+
|
|
1173
|
+
context 'with an invalid id' do
|
|
1174
|
+
it 'raises an error' do
|
|
1175
|
+
VCR.use_cassette('user_management/find_invitation_by_token/invalid') do
|
|
1176
|
+
expect do
|
|
1177
|
+
WorkOS::UserManagement.find_invitation_by_token(token: 'invalid')
|
|
1178
|
+
end.to raise_error(WorkOS::NotFoundError, /Invitation not found/)
|
|
1153
1179
|
end
|
|
1154
1180
|
end
|
|
1155
1181
|
end
|
|
@@ -1320,7 +1346,7 @@ describe WorkOS::UserManagement do
|
|
|
1320
1346
|
id: 'invalid_id',
|
|
1321
1347
|
)
|
|
1322
1348
|
end.to raise_error(
|
|
1323
|
-
WorkOS::
|
|
1349
|
+
WorkOS::NotFoundError,
|
|
1324
1350
|
/Invitation not found/,
|
|
1325
1351
|
)
|
|
1326
1352
|
end
|
|
@@ -1349,7 +1375,7 @@ describe WorkOS::UserManagement do
|
|
|
1349
1375
|
session_id: 'session_01H5JQDV7R7ATEYZDEG0W5PRYS',
|
|
1350
1376
|
)
|
|
1351
1377
|
end.to raise_error(
|
|
1352
|
-
WorkOS::
|
|
1378
|
+
WorkOS::NotFoundError,
|
|
1353
1379
|
/Session not found/,
|
|
1354
1380
|
)
|
|
1355
1381
|
end
|
|
@@ -1,66 +1,66 @@
|
|
|
1
1
|
---
|
|
2
2
|
http_interactions:
|
|
3
|
-
- request:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
3
|
+
- request:
|
|
4
|
+
method: post
|
|
5
|
+
uri: https://api.workos.com/audit_logs/events
|
|
6
|
+
body:
|
|
7
|
+
encoding: UTF-8
|
|
8
|
+
string: '{}'
|
|
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/2.6.5; x86_64-darwin19; v0.1.0
|
|
18
|
+
Authorization:
|
|
19
|
+
- 'Bearer '
|
|
20
|
+
response:
|
|
21
|
+
status:
|
|
22
|
+
code: 401
|
|
23
|
+
message: Unauthorized
|
|
24
|
+
headers:
|
|
25
|
+
Server:
|
|
26
|
+
- Cowboy
|
|
27
|
+
Connection:
|
|
28
|
+
- keep-alive
|
|
29
|
+
Access-Control-Allow-Origin:
|
|
30
|
+
- https://dashboard.workos-test.com
|
|
31
|
+
Vary:
|
|
32
|
+
- Origin, Accept-Encoding
|
|
33
|
+
Access-Control-Allow-Credentials:
|
|
34
|
+
- 'true'
|
|
35
|
+
X-Dns-Prefetch-Control:
|
|
36
|
+
- 'off'
|
|
37
|
+
X-Frame-Options:
|
|
38
|
+
- SAMEORIGIN
|
|
39
|
+
Strict-Transport-Security:
|
|
40
|
+
- max-age=15552000; includeSubDomains
|
|
41
|
+
X-Download-Options:
|
|
42
|
+
- noopen
|
|
43
|
+
X-Content-Type-Options:
|
|
44
|
+
- nosniff
|
|
45
|
+
X-Xss-Protection:
|
|
46
|
+
- 1; mode=block
|
|
47
|
+
X-Request-Id:
|
|
48
|
+
- 32a67a24-bfaf-4463-bf47-c407d54955d3
|
|
49
|
+
Request-Id:
|
|
50
|
+
- 32a67a24-bfaf-4463-bf47-c407d54955d3
|
|
51
|
+
Content-Type:
|
|
52
|
+
- application/json; charset=utf-8
|
|
53
|
+
Content-Length:
|
|
54
|
+
- '26'
|
|
55
|
+
Etag:
|
|
56
|
+
- W/"1a-pljHtlo127JYJR4E/RYOPb6ucbw"
|
|
57
|
+
Date:
|
|
58
|
+
- Sat, 11 Jan 2020 03:50:27 GMT
|
|
59
|
+
Via:
|
|
60
|
+
- 1.1 vegur
|
|
61
|
+
body:
|
|
62
|
+
encoding: UTF-8
|
|
63
|
+
string: '{"message":"Unauthorized"}'
|
|
64
|
+
http_version:
|
|
65
|
+
recorded_at: Sat, 11 Jan 2020 03:50:27 GMT
|
|
66
66
|
recorded_with: VCR 5.0.0
|
|
@@ -14,40 +14,42 @@ http_interactions:
|
|
|
14
14
|
Accept:
|
|
15
15
|
- "*/*"
|
|
16
16
|
User-Agent:
|
|
17
|
-
- WorkOS; ruby/
|
|
17
|
+
- WorkOS; ruby/3.3.0; arm64-darwin23; v4.1.0
|
|
18
18
|
Authorization:
|
|
19
19
|
- Bearer <API_KEY>
|
|
20
20
|
response:
|
|
21
21
|
status:
|
|
22
|
-
code:
|
|
23
|
-
message:
|
|
22
|
+
code: 400
|
|
23
|
+
message: Bad Request
|
|
24
24
|
headers:
|
|
25
25
|
Date:
|
|
26
|
-
- Thu,
|
|
26
|
+
- Thu, 11 Apr 2024 15:44:49 GMT
|
|
27
27
|
Content-Type:
|
|
28
28
|
- application/json; charset=utf-8
|
|
29
29
|
Content-Length:
|
|
30
|
-
- '
|
|
30
|
+
- '140'
|
|
31
31
|
Connection:
|
|
32
32
|
- keep-alive
|
|
33
|
+
Cf-Ray:
|
|
34
|
+
- 872c19a65dcb3af9-IAD
|
|
35
|
+
Cf-Cache-Status:
|
|
36
|
+
- DYNAMIC
|
|
37
|
+
Etag:
|
|
38
|
+
- W/"8c-3NPoweNh0oXUDzElVKxg5PG7PWk"
|
|
39
|
+
Strict-Transport-Security:
|
|
40
|
+
- max-age=15552000; includeSubDomains
|
|
41
|
+
Vary:
|
|
42
|
+
- Origin, Accept-Encoding
|
|
33
43
|
Access-Control-Allow-Credentials:
|
|
34
44
|
- 'true'
|
|
35
45
|
Content-Security-Policy:
|
|
36
46
|
- 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
|
|
37
47
|
https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
|
|
38
48
|
''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
|
|
39
|
-
Etag:
|
|
40
|
-
- W/"680-NPvBik348v8xg6EE7iZMYwD5UXw"
|
|
41
49
|
Expect-Ct:
|
|
42
50
|
- max-age=0
|
|
43
51
|
Referrer-Policy:
|
|
44
52
|
- no-referrer
|
|
45
|
-
Strict-Transport-Security:
|
|
46
|
-
- max-age=15552000; includeSubDomains
|
|
47
|
-
Vary:
|
|
48
|
-
- Origin, Accept-Encoding
|
|
49
|
-
Via:
|
|
50
|
-
- 1.1 spaces-router (b642bf20b975)
|
|
51
53
|
X-Content-Type-Options:
|
|
52
54
|
- nosniff
|
|
53
55
|
X-Dns-Prefetch-Control:
|
|
@@ -59,22 +61,21 @@ http_interactions:
|
|
|
59
61
|
X-Permitted-Cross-Domain-Policies:
|
|
60
62
|
- none
|
|
61
63
|
X-Request-Id:
|
|
62
|
-
-
|
|
64
|
+
- 660c0035-b70d-4939-a0d3-2b0917535e7f
|
|
63
65
|
X-Xss-Protection:
|
|
64
66
|
- '0'
|
|
65
|
-
|
|
66
|
-
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
Set-Cookie:
|
|
68
|
+
- __cf_bm=UpBr7jsatrWLaunHA8NhaflwkUco6FBxeXhgwz2bAoM-1712850289-1.0.1.1-KJCKaoohiG088DieTdV2V91AtW1fbs7ec.x7gsal9xsVzA2OPf67b0R__57KFvEsEZ97obgydtH.VEwyYhpGTw;
|
|
69
|
+
path=/; expires=Thu, 11-Apr-24 16:14:49 GMT; domain=.workos.com; HttpOnly;
|
|
70
|
+
Secure; SameSite=None
|
|
71
|
+
- __cfruid=bbad8ba60df9a023f0ba77749b5c0b92162e6ed3-1712850289; path=/; domain=.workos.com;
|
|
72
|
+
HttpOnly; Secure; SameSite=None
|
|
71
73
|
Server:
|
|
72
74
|
- cloudflare
|
|
73
|
-
Cf-Ray:
|
|
74
|
-
- 72abbbf2b93e8ca5-EWR
|
|
75
75
|
body:
|
|
76
|
-
encoding:
|
|
77
|
-
string: '{"
|
|
76
|
+
encoding: UTF-8
|
|
77
|
+
string: '{"message":"One or more event names (e.g. dsync.user.created) must
|
|
78
|
+
be provided using the events parameter.","code":"invalid_events_request"}'
|
|
78
79
|
http_version:
|
|
79
|
-
recorded_at: Thu,
|
|
80
|
+
recorded_at: Thu, 11 Apr 2024 15:44:49 GMT
|
|
80
81
|
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/events?range_end=2023-01-03T00:00:00Z&range_start=2023-01-01T00:00:00Z
|
|
5
|
+
uri: https://api.workos.com/events?events=dsync.user.created&range_end=2023-01-03T00:00:00Z&range_start=2023-01-01T00:00:00Z
|
|
6
6
|
body:
|
|
7
7
|
encoding: US-ASCII
|
|
8
8
|
string: ''
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
http_interactions:
|
|
3
|
+
- request:
|
|
4
|
+
method: get
|
|
5
|
+
uri: https://api.workos.com/user_management/invitations/by_token/invalid
|
|
6
|
+
body:
|
|
7
|
+
encoding: US-ASCII
|
|
8
|
+
string: ''
|
|
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; x86_64-darwin19; v4.7.0
|
|
18
|
+
Authorization:
|
|
19
|
+
- Bearer <API_KEY>
|
|
20
|
+
response:
|
|
21
|
+
status:
|
|
22
|
+
code: 404
|
|
23
|
+
message: Not Found
|
|
24
|
+
headers:
|
|
25
|
+
Date:
|
|
26
|
+
- Mon, 03 Jun 2024 20:16: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
|
+
- 88e25cab2e0c520c-DEN
|
|
35
|
+
Cf-Cache-Status:
|
|
36
|
+
- DYNAMIC
|
|
37
|
+
Etag:
|
|
38
|
+
- W/"5a-PPX6d4bMxLfMyXe/1aUqFNwW/Dc"
|
|
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
|
+
- 7066479f-3c65-4eb0-a5ab-fa371e8747e5
|
|
65
|
+
X-Xss-Protection:
|
|
66
|
+
- '0'
|
|
67
|
+
Set-Cookie:
|
|
68
|
+
- __cf_bm=V3RT_KMrnFyoIbj_1OgapyAtReNBXvdzeYmNZWQQt6Y-1717445797-1.0.1.1-XWQk50226uaRo4S1BTn3wou4.mFaLOC20eA_MhrSil._j0XoCx6I2Q0gmgtBp1j9.dHqkmf4ZwOw1j6RmBLSnQ;
|
|
69
|
+
path=/; expires=Mon, 03-Jun-24 20:46:37 GMT; domain=.workos.com; HttpOnly;
|
|
70
|
+
Secure; SameSite=None
|
|
71
|
+
- __cfruid=cb54bc416259840c8c11ad58469ec2c5d9f88ff3-1717445797; path=/; domain=.workos.com;
|
|
72
|
+
HttpOnly; Secure; SameSite=None
|
|
73
|
+
Server:
|
|
74
|
+
- cloudflare
|
|
75
|
+
body:
|
|
76
|
+
encoding: ASCII-8BIT
|
|
77
|
+
string: '{"message":"Invitation not found: ''invalid''.","code":"entity_not_found","entity_id":"invalid"}'
|
|
78
|
+
http_version:
|
|
79
|
+
recorded_at: Mon, 03 Jun 2024 20:16:37 GMT
|
|
80
|
+
recorded_with: VCR 5.0.0
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
http_interactions:
|
|
3
|
+
- request:
|
|
4
|
+
method: get
|
|
5
|
+
uri: https://api.workos.com/user_management/invitations/by_token/iUV3XbYajpJlbpw1Qt3ZKlaKx
|
|
6
|
+
body:
|
|
7
|
+
encoding: US-ASCII
|
|
8
|
+
string: ''
|
|
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; x86_64-darwin19; v4.7.0
|
|
18
|
+
Authorization:
|
|
19
|
+
- Bearer <API_KEY>
|
|
20
|
+
response:
|
|
21
|
+
status:
|
|
22
|
+
code: 200
|
|
23
|
+
message: OK
|
|
24
|
+
headers:
|
|
25
|
+
Date:
|
|
26
|
+
- Mon, 03 Jun 2024 20:16: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
|
+
- 88e25ca97a127b32-DEN
|
|
35
|
+
Cf-Cache-Status:
|
|
36
|
+
- DYNAMIC
|
|
37
|
+
Etag:
|
|
38
|
+
- W/"1e5-ZUKH6e1N8G9JBxE8/nulDIEawKk"
|
|
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
|
+
- 1359e287-00bc-4081-a3d9-6bfcded70273
|
|
65
|
+
X-Xss-Protection:
|
|
66
|
+
- '0'
|
|
67
|
+
Set-Cookie:
|
|
68
|
+
- __cf_bm=WToCUplL1o5i0KSz5l81mSZ5SqsRh0MGwXHPwM7C.Sg-1717445797-1.0.1.1-KXhOU0BqmCe7ZDWcpEJ7V3gLLZpioBrWPxtyB5m2sOmYxj3GWOfjhqRz5d1L0cTOpGoT9OfeqzGa5qfmD0ELZw;
|
|
69
|
+
path=/; expires=Mon, 03-Jun-24 20:46:37 GMT; domain=.workos.com; HttpOnly;
|
|
70
|
+
Secure; SameSite=None
|
|
71
|
+
- __cfruid=cb54bc416259840c8c11ad58469ec2c5d9f88ff3-1717445797; path=/; domain=.workos.com;
|
|
72
|
+
HttpOnly; Secure; SameSite=None
|
|
73
|
+
Server:
|
|
74
|
+
- cloudflare
|
|
75
|
+
body:
|
|
76
|
+
encoding: ASCII-8BIT
|
|
77
|
+
string: '{"object":"invitation","id":"invitation_01HZFVRAJ7EV7935K7H8NX2MRH","email":"blairlunceford@gmail.com","state":"pending","accepted_at":null,"revoked_at":null,"expires_at":"2024-06-10T20:13:21.862Z","organization_id":null,"inviter_user_id":null,"token":"iUV3XbYajpJlbpw1Qt3ZKlaKx","accept_invitation_url":"https://manageable-child-63-staging.authkit.app/invite/?invitation_token=iUV3XbYajpJlbpw1Qt3ZKlaKx","created_at":"2024-06-03T20:13:21.820Z","updated_at":"2024-06-03T20:13:21.820Z"}'
|
|
78
|
+
http_version:
|
|
79
|
+
recorded_at: Mon, 03 Jun 2024 20:16:37 GMT
|
|
80
|
+
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:
|
|
4
|
+
version: 5.0.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-
|
|
11
|
+
date: 2024-06-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -152,6 +152,7 @@ files:
|
|
|
152
152
|
- lib/workos/webhook.rb
|
|
153
153
|
- lib/workos/webhooks.rb
|
|
154
154
|
- spec/lib/workos/audit_logs_spec.rb
|
|
155
|
+
- spec/lib/workos/client.rb
|
|
155
156
|
- spec/lib/workos/configuration_spec.rb
|
|
156
157
|
- spec/lib/workos/directory_sync_spec.rb
|
|
157
158
|
- spec/lib/workos/directory_user_spec.rb
|
|
@@ -284,6 +285,8 @@ files:
|
|
|
284
285
|
- spec/support/fixtures/vcr_cassettes/user_management/delete_user/valid.yml
|
|
285
286
|
- spec/support/fixtures/vcr_cassettes/user_management/enroll_auth_factor/invalid.yml
|
|
286
287
|
- spec/support/fixtures/vcr_cassettes/user_management/enroll_auth_factor/valid.yml
|
|
288
|
+
- spec/support/fixtures/vcr_cassettes/user_management/find_invitation_by_token/invalid.yml
|
|
289
|
+
- spec/support/fixtures/vcr_cassettes/user_management/find_invitation_by_token/valid.yml
|
|
287
290
|
- spec/support/fixtures/vcr_cassettes/user_management/get_email_verification/invalid.yml
|
|
288
291
|
- spec/support/fixtures/vcr_cassettes/user_management/get_email_verification/valid.yml
|
|
289
292
|
- spec/support/fixtures/vcr_cassettes/user_management/get_invitation/invalid.yml
|
|
@@ -357,6 +360,7 @@ specification_version: 4
|
|
|
357
360
|
summary: API client for WorkOS
|
|
358
361
|
test_files:
|
|
359
362
|
- spec/lib/workos/audit_logs_spec.rb
|
|
363
|
+
- spec/lib/workos/client.rb
|
|
360
364
|
- spec/lib/workos/configuration_spec.rb
|
|
361
365
|
- spec/lib/workos/directory_sync_spec.rb
|
|
362
366
|
- spec/lib/workos/directory_user_spec.rb
|
|
@@ -489,6 +493,8 @@ test_files:
|
|
|
489
493
|
- spec/support/fixtures/vcr_cassettes/user_management/delete_user/valid.yml
|
|
490
494
|
- spec/support/fixtures/vcr_cassettes/user_management/enroll_auth_factor/invalid.yml
|
|
491
495
|
- spec/support/fixtures/vcr_cassettes/user_management/enroll_auth_factor/valid.yml
|
|
496
|
+
- spec/support/fixtures/vcr_cassettes/user_management/find_invitation_by_token/invalid.yml
|
|
497
|
+
- spec/support/fixtures/vcr_cassettes/user_management/find_invitation_by_token/valid.yml
|
|
492
498
|
- spec/support/fixtures/vcr_cassettes/user_management/get_email_verification/invalid.yml
|
|
493
499
|
- spec/support/fixtures/vcr_cassettes/user_management/get_email_verification/valid.yml
|
|
494
500
|
- spec/support/fixtures/vcr_cassettes/user_management/get_invitation/invalid.yml
|