workos 1.5.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -1
  3. data/.ruby-version +1 -1
  4. data/.semaphore/semaphore.yml +2 -2
  5. data/Gemfile.lock +3 -3
  6. data/lib/workos/client.rb +3 -6
  7. data/lib/workos/connection.rb +1 -1
  8. data/lib/workos/directory.rb +2 -2
  9. data/lib/workos/directory_sync.rb +29 -0
  10. data/lib/workos/errors.rb +4 -0
  11. data/lib/workos/organization.rb +4 -1
  12. data/lib/workos/organizations.rb +18 -4
  13. data/lib/workos/profile.rb +7 -2
  14. data/lib/workos/types/connection_struct.rb +1 -1
  15. data/lib/workos/types/directory_struct.rb +2 -2
  16. data/lib/workos/types/organization_struct.rb +1 -0
  17. data/lib/workos/types/profile_struct.rb +1 -0
  18. data/lib/workos/types/webhook_struct.rb +14 -0
  19. data/lib/workos/types.rb +1 -0
  20. data/lib/workos/version.rb +1 -1
  21. data/lib/workos/webhook.rb +47 -0
  22. data/lib/workos/webhooks.rb +168 -0
  23. data/lib/workos.rb +3 -0
  24. data/spec/lib/workos/audit_trail_spec.rb +2 -0
  25. data/spec/lib/workos/directory_sync_spec.rb +45 -10
  26. data/spec/lib/workos/organizations_spec.rb +2 -0
  27. data/spec/lib/workos/passwordless_spec.rb +2 -0
  28. data/spec/lib/workos/portal_spec.rb +2 -0
  29. data/spec/lib/workos/sso_spec.rb +4 -0
  30. data/spec/lib/workos/webhooks_spec.rb +190 -0
  31. data/spec/spec_helper.rb +3 -0
  32. data/spec/support/fixtures/vcr_cassettes/{organization/update_invalid.yml → directory_sync/get_directory_with_invalid_id.yml} +35 -25
  33. data/spec/support/fixtures/vcr_cassettes/directory_sync/get_directory_with_valid_id.yml +84 -0
  34. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_after.yml +34 -22
  35. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_before.yml +36 -22
  36. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_domain.yml +30 -19
  37. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_limit.yml +31 -20
  38. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_no_options.yml +39 -21
  39. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_search.yml +32 -20
  40. data/spec/support/fixtures/vcr_cassettes/organization/create.yml +1 -1
  41. data/spec/support/fixtures/vcr_cassettes/organization/get.yml +1 -1
  42. data/spec/support/fixtures/vcr_cassettes/organization/list.yml +4 -4
  43. data/spec/support/fixtures/vcr_cassettes/organization/update.yml +1 -1
  44. data/spec/support/fixtures/vcr_cassettes/sso/profile.yml +1 -1
  45. data/spec/support/profile.txt +1 -1
  46. data/spec/support/shared_examples/client_spec.rb +16 -0
  47. data/spec/support/webhook_payload.txt +1 -0
  48. metadata +16 -5
@@ -2,6 +2,8 @@
2
2
  # typed: false
3
3
 
4
4
  describe WorkOS::DirectorySync do
5
+ it_behaves_like 'client'
6
+
5
7
  describe '.list_directories' do
6
8
  context 'with no options' do
7
9
  it 'returns directories and metadata' do
@@ -13,7 +15,7 @@ describe WorkOS::DirectorySync do
13
15
  VCR.use_cassette 'directory_sync/list_directories/with_no_options' do
14
16
  directories = described_class.list_directories
15
17
 
16
- expect(directories.data.size).to eq(3)
18
+ expect(directories.data.size).to eq(10)
17
19
  expect(directories.list_metadata).to eq(expected_metadata)
18
20
  end
19
21
  end
@@ -44,7 +46,7 @@ describe WorkOS::DirectorySync do
44
46
  context 'with search option' do
45
47
  it 'forms the proper request to the API' do
46
48
  request_args = [
47
- '/directories?search=Foo',
49
+ '/directories?search=Testing',
48
50
  'Content-Type' => 'application/json'
49
51
  ]
50
52
 
@@ -55,10 +57,11 @@ describe WorkOS::DirectorySync do
55
57
 
56
58
  VCR.use_cassette 'directory_sync/list_directories/with_search' do
57
59
  directories = described_class.list_directories(
58
- search: 'Foo',
60
+ search: 'Testing',
59
61
  )
60
62
 
61
- expect(directories.data.size).to eq(1)
63
+ expect(directories.data.size).to eq(2)
64
+ expect(directories.data[0].name).to include('Testing')
62
65
  end
63
66
  end
64
67
  end
@@ -66,7 +69,7 @@ describe WorkOS::DirectorySync do
66
69
  context 'with the before option' do
67
70
  it 'forms the proper request to the API' do
68
71
  request_args = [
69
- '/directories?before=before-id',
72
+ '/directories?before=directory_01FGCPNV312FHFRCX0BYWHVSE1',
70
73
  'Content-Type' => 'application/json'
71
74
  ]
72
75
 
@@ -77,10 +80,10 @@ describe WorkOS::DirectorySync do
77
80
 
78
81
  VCR.use_cassette 'directory_sync/list_directories/with_before' do
79
82
  directories = described_class.list_directories(
80
- before: 'before-id',
83
+ before: 'directory_01FGCPNV312FHFRCX0BYWHVSE1',
81
84
  )
82
85
 
83
- expect(directories.data.size).to eq(3)
86
+ expect(directories.data.size).to eq(6)
84
87
  end
85
88
  end
86
89
  end
@@ -88,7 +91,7 @@ describe WorkOS::DirectorySync do
88
91
  context 'with the after option' do
89
92
  it 'forms the proper request to the API' do
90
93
  request_args = [
91
- '/directories?after=after-id',
94
+ '/directories?after=directory_01FGCPNV312FHFRCX0BYWHVSE1',
92
95
  'Content-Type' => 'application/json'
93
96
  ]
94
97
 
@@ -98,9 +101,9 @@ describe WorkOS::DirectorySync do
98
101
  and_return(expected_request)
99
102
 
100
103
  VCR.use_cassette 'directory_sync/list_directories/with_after' do
101
- directories = described_class.list_directories(after: 'after-id')
104
+ directories = described_class.list_directories(after: 'directory_01FGCPNV312FHFRCX0BYWHVSE1')
102
105
 
103
- expect(directories.data.size).to eq(3)
106
+ expect(directories.data.size).to eq(4)
104
107
  end
105
108
  end
106
109
  end
@@ -140,6 +143,38 @@ describe WorkOS::DirectorySync do
140
143
  end
141
144
  end
142
145
 
146
+ describe '.get_directory' do
147
+ context 'with a valid id' do
148
+ it 'gets the directory details' do
149
+ VCR.use_cassette('directory_sync/get_directory_with_valid_id') do
150
+ directory = WorkOS::DirectorySync.get_directory(
151
+ id: 'directory_01FK17DWRHH7APAFXT5B52PV0W',
152
+ )
153
+
154
+ expect(directory.id).to eq('directory_01FK17DWRHH7APAFXT5B52PV0W')
155
+ expect(directory.name).to eq('Testing Active Attribute')
156
+ expect(directory.domain).to eq('example.me')
157
+ expect(directory.type).to eq('azure scim v2.0')
158
+ expect(directory.state).to eq('linked')
159
+ expect(directory.organization_id).to eq('org_01F6Q6TFP7RD2PF6J03ANNWDKV')
160
+ end
161
+ end
162
+ end
163
+
164
+ context 'with an invalid id' do
165
+ it 'raises an error' do
166
+ VCR.use_cassette('directory_sync/get_directory_with_invalid_id') do
167
+ expect do
168
+ WorkOS::DirectorySync.get_directory(id: 'invalid')
169
+ end.to raise_error(
170
+ WorkOS::APIError,
171
+ "Status 404, Directory not found: 'invalid'. - request ID: ",
172
+ )
173
+ end
174
+ end
175
+ end
176
+ end
177
+
143
178
  describe '.list_groups' do
144
179
  context 'with no options' do
145
180
  it 'raises an error' do
@@ -2,6 +2,8 @@
2
2
  # typed: false
3
3
 
4
4
  describe WorkOS::Organizations do
5
+ it_behaves_like 'client'
6
+
5
7
  describe '.create_organization' do
6
8
  context 'with valid payload' do
7
9
  it 'creates an organization' do
@@ -2,6 +2,8 @@
2
2
  # typed: false
3
3
 
4
4
  describe WorkOS::Passwordless do
5
+ it_behaves_like 'client'
6
+
5
7
  describe '.create_session' do
6
8
  context 'with valid options payload' do
7
9
  let(:valid_options) do
@@ -2,6 +2,8 @@
2
2
  # typed: false
3
3
 
4
4
  describe WorkOS::Portal do
5
+ it_behaves_like 'client'
6
+
5
7
  describe '.generate_link' do
6
8
  let(:organization) { 'org_01EHQMYV6MBK39QC5PZXHY59C3' }
7
9
 
@@ -4,6 +4,8 @@
4
4
  require 'securerandom'
5
5
 
6
6
  describe WorkOS::SSO do
7
+ it_behaves_like 'client'
8
+
7
9
  describe '.authorization_url' do
8
10
  context 'with a domain' do
9
11
  let(:args) do
@@ -162,6 +164,7 @@ describe WorkOS::SSO do
162
164
  id: 'prof_01EEJTY9SZ1R350RB7B73SNBKF',
163
165
  idp_id: '116485463307139932699',
164
166
  last_name: 'Loblaw',
167
+ organization_id: 'org_01FG53X8636WSNW2WEKB2C31ZB',
165
168
  raw_attributes: {
166
169
  email: 'bob.loblaw@workos.com',
167
170
  family_name: 'Loblaw',
@@ -231,6 +234,7 @@ describe WorkOS::SSO do
231
234
  id: 'prof_01DRA1XNSJDZ19A31F183ECQW5',
232
235
  idp_id: '00u1klkowm8EGah2H357',
233
236
  last_name: 'Demo',
237
+ organization_id: 'org_01FG53X8636WSNW2WEKB2C31ZB',
234
238
  raw_attributes: {
235
239
  email: 'demo@workos-okta.com',
236
240
  first_name: 'WorkOS',
@@ -0,0 +1,190 @@
1
+ # frozen_string_literal: true
2
+ # typed: false
3
+
4
+ require 'json'
5
+ require 'openssl'
6
+
7
+ describe WorkOS::Webhooks do
8
+ describe '.construct_event' do
9
+ before(:each) do
10
+ @payload = File.read("#{SPEC_ROOT}/support/webhook_payload.txt")
11
+ @secret = 'secret'
12
+ @timestamp = Time.at(Time.now.to_i * 1000)
13
+ unhashed_string = "#{@timestamp.to_i}.#{@payload}"
14
+ digest = OpenSSL::Digest.new('sha256')
15
+ @signature_hash = OpenSSL::HMAC.hexdigest(digest, @secret, unhashed_string)
16
+ @expectation = {
17
+ id: 'directory_user_01FAEAJCR3ZBZ30D8BD1924TVG',
18
+ state: 'active',
19
+ emails: [{
20
+ type: 'work',
21
+ value: 'blair@foo-corp.com',
22
+ primary: true,
23
+ }],
24
+ idp_id: '00u1e8mutl6wlH3lL4x7',
25
+ object: 'directory_user',
26
+ username: 'blair@foo-corp.com',
27
+ last_name: 'Lunceford',
28
+ first_name: 'Blair',
29
+ directory_id: 'directory_01F9M7F68PZP8QXP8G7X5QRHS7',
30
+ raw_attributes: {
31
+ name: {
32
+ givenName: 'Blair',
33
+ familyName: 'Lunceford',
34
+ middleName: 'Elizabeth',
35
+ honorificPrefix: 'Ms.',
36
+ },
37
+ title: 'Developer Success Engineer',
38
+ active: true,
39
+ emails: [{
40
+ type: 'work',
41
+ value: 'blair@foo-corp.com',
42
+ primary: true,
43
+ }],
44
+ groups: [],
45
+ locale: 'en-US',
46
+ schemas: [
47
+ 'urn:ietf:params:scim:schemas:core:2.0:User',
48
+ 'urn:ietf:params:scim:schemas:extension:enterprise:2.0:User'
49
+ ],
50
+ userName: 'blair@foo-corp.com',
51
+ addresses: [{
52
+ region: 'CO',
53
+ primary: true,
54
+ locality: 'Steamboat Springs',
55
+ postalCode: '80487',
56
+ }],
57
+ externalId: '00u1e8mutl6wlH3lL4x7',
58
+ displayName: 'Blair Lunceford',
59
+ "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": {
60
+ manager: {
61
+ value: '2',
62
+ displayName: 'Kathleen Chung',
63
+ },
64
+ division: 'Engineering',
65
+ department: 'Customer Success',
66
+ },
67
+ },
68
+ }
69
+ end
70
+
71
+ context 'with the correct payload, sig_header, and secret' do
72
+ it 'returns a webhook event' do
73
+ webhook = described_class.construct_event(
74
+ payload: @payload,
75
+ sig_header: "t=#{@timestamp.to_i}, v1=#{@signature_hash}",
76
+ secret: @secret,
77
+ )
78
+
79
+ expect(webhook.data).to eq(@expectation)
80
+ expect(webhook.event).to eq('dsync.user.created')
81
+ expect(webhook.id).to eq('wh_123')
82
+ end
83
+ end
84
+
85
+ context 'with the correct payload, sig_header, secret, and tolerance' do
86
+ it 'returns a webhook event' do
87
+ webhook = described_class.construct_event(
88
+ payload: @payload,
89
+ sig_header: "t=#{@timestamp.to_i}, v1=#{@signature_hash}",
90
+ secret: @secret,
91
+ tolerance: 300,
92
+ )
93
+
94
+ expect(webhook.data).to eq(@expectation)
95
+ expect(webhook.event).to eq('dsync.user.created')
96
+ expect(webhook.id).to eq('wh_123')
97
+ end
98
+ end
99
+
100
+ context 'with an empty header' do
101
+ it 'raises an error' do
102
+ expect do
103
+ described_class.construct_event(
104
+ payload: @payload,
105
+ sig_header: '',
106
+ secret: @secret,
107
+ )
108
+ end.to raise_error(
109
+ WorkOS::SignatureVerificationError,
110
+ 'Unable to extract timestamp and signature hash from header',
111
+ )
112
+ end
113
+ end
114
+
115
+ context 'with an empty signature hash' do
116
+ it 'raises an error' do
117
+ expect do
118
+ described_class.construct_event(
119
+ payload: @payload,
120
+ sig_header: "t=#{@timestamp.to_i}, v1=",
121
+ secret: @secret,
122
+ )
123
+ end.to raise_error(
124
+ WorkOS::SignatureVerificationError,
125
+ 'No signature hash found with expected scheme v1',
126
+ )
127
+ end
128
+ end
129
+
130
+ context 'with an incorrect signature hash' do
131
+ it 'raises an error' do
132
+ expect do
133
+ described_class.construct_event(
134
+ payload: @payload,
135
+ sig_header: "t=#{@timestamp.to_i}, v1=99999",
136
+ secret: @secret,
137
+ )
138
+ end.to raise_error(
139
+ WorkOS::SignatureVerificationError,
140
+ 'Signature hash does not match the expected signature hash for payload',
141
+ )
142
+ end
143
+ end
144
+
145
+ context 'with an incorrect payload' do
146
+ it 'raises an error' do
147
+ expect do
148
+ described_class.construct_event(
149
+ payload: 'invalid',
150
+ sig_header: "t=#{@timestamp.to_i}, v1=#{@signature_hash}",
151
+ secret: @secret,
152
+ )
153
+ end.to raise_error(
154
+ WorkOS::SignatureVerificationError,
155
+ 'Signature hash does not match the expected signature hash for payload',
156
+ )
157
+ end
158
+ end
159
+
160
+ context 'with an incorrect webhook secret' do
161
+ it 'raises an error' do
162
+ expect do
163
+ described_class.construct_event(
164
+ payload: @payload,
165
+ sig_header: "t=#{@timestamp.to_i}, v1=#{@signature_hash}",
166
+ secret: 'invalid',
167
+ )
168
+ end.to raise_error(
169
+ WorkOS::SignatureVerificationError,
170
+ 'Signature hash does not match the expected signature hash for payload',
171
+ )
172
+ end
173
+ end
174
+
175
+ context 'with a timestamp outside tolerance' do
176
+ it 'raises an error' do
177
+ expect do
178
+ described_class.construct_event(
179
+ payload: @payload,
180
+ sig_header: "t=9999, v1=#{@signature_hash}",
181
+ secret: @secret,
182
+ )
183
+ end.to raise_error(
184
+ WorkOS::SignatureVerificationError,
185
+ 'Timestamp outside the tolerance zone',
186
+ )
187
+ end
188
+ end
189
+ end
190
+ end
data/spec/spec_helper.rb CHANGED
@@ -18,6 +18,9 @@ require 'webmock/rspec'
18
18
  require 'workos'
19
19
  require 'vcr'
20
20
 
21
+ # Support
22
+ Dir['./spec/support/**/*.rb'].sort.each { |f| require f }
23
+
21
24
  SPEC_ROOT = File.dirname __FILE__
22
25
 
23
26
  VCR.configure do |config|
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  http_interactions:
3
3
  - request:
4
- method: put
5
- uri: https://api.workos.com/organizations/org_01F29YJ068E52HGEB8ZQGC9MJG
4
+ method: get
5
+ uri: https://api.workos.com/directories/invalid
6
6
  body:
7
- encoding: UTF-8
8
- string: '{"domains":["example.com"],"name":"Test Organization 2"}'
7
+ encoding: US-ASCII
8
+ string: ''
9
9
  headers:
10
10
  Content-Type:
11
11
  - application/json
@@ -14,22 +14,22 @@ http_interactions:
14
14
  Accept:
15
15
  - "*/*"
16
16
  User-Agent:
17
- - WorkOS; ruby/3.0.1; x86_64-darwin19; v0.11.1
17
+ - WorkOS; ruby/3.0.2; x86_64-darwin19; v1.6.1
18
18
  Authorization:
19
19
  - Bearer <API_KEY>
20
20
  response:
21
21
  status:
22
- code: 200
23
- message: OK
22
+ code: 404
23
+ message: Not Found
24
24
  headers:
25
- Server:
26
- - Cowboy
25
+ Date:
26
+ - Sun, 07 Nov 2021 19:18:31 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
27
31
  Connection:
28
32
  - keep-alive
29
- Vary:
30
- - Origin, Accept-Encoding
31
- Access-Control-Allow-Credentials:
32
- - 'true'
33
33
  Content-Security-Policy:
34
34
  - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
35
35
  https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
@@ -52,22 +52,32 @@ http_interactions:
52
52
  - no-referrer
53
53
  X-Xss-Protection:
54
54
  - '0'
55
+ Vary:
56
+ - Origin, Accept-Encoding
57
+ Access-Control-Allow-Credentials:
58
+ - 'true'
55
59
  X-Request-Id:
56
- - 6ba2cbf9-76e3-4a6a-8ebe-d25edb366ed0
57
- Content-Type:
58
- - application/json; charset=utf-8
59
- Content-Length:
60
- - '205'
60
+ -
61
61
  Etag:
62
- - W/"cd-mlRMlyyz/LtzInRhAghs1B+BT4s"
63
- Date:
64
- - Wed, 05 May 2021 22:14:10 GMT
62
+ - W/"5d-Sx4XoCfDLxkGIc0yAjSbi2ILYww"
65
63
  Via:
66
64
  - 1.1 vegur
65
+ Cf-Cache-Status:
66
+ - DYNAMIC
67
+ Report-To:
68
+ - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=9UGS4Swz%2BHWvLOf0MGTCQbJyS0uBKnB72E77LfjybUN%2FXbJaDPBYfHnAUcgVM7JZbTefNquu4bG0Fw0edgQVoGnTK9OWPuO6fVKmo8XkF1G%2FNgibe8B715ZZje%2FZM7m3%2B9bEbNout5ArQfFyyQ%3D%3D"}],"group":"cf-nel","max_age":604800}'
69
+ Nel:
70
+ - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}'
71
+ Server:
72
+ - cloudflare
73
+ Cf-Ray:
74
+ - 6aa8e86f7b5a66bf-DFW
75
+ Alt-Svc:
76
+ - h3=":443"; ma=86400, h3-29=":443"; ma=86400, h3-28=":443"; ma=86400, h3-27=":443";
77
+ ma=86400
67
78
  body:
68
- encoding: UTF-8
69
- string: '{"object":"organization","id":"org_01F29YJ068E52HGEB8ZQGC9MJG","name":"Test
70
- Organization 2","domains":[{"object":"organization_domain","id":"org_domain_01F4Z9GY3089GV4SENXWZ9RBX1","domain":"example.com"}]}'
79
+ encoding: ASCII-8BIT
80
+ string: '{"message":"Directory not found: ''invalid''.","code":"entity_not_found","entity_id":"invalid"}'
71
81
  http_version:
72
- recorded_at: Wed, 05 May 2021 22:14:10 GMT
82
+ recorded_at: Sun, 07 Nov 2021 19:18:31 GMT
73
83
  recorded_with: VCR 5.0.0
@@ -0,0 +1,84 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.workos.com/directories/directory_01FK17DWRHH7APAFXT5B52PV0W
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; v1.6.1
18
+ Authorization:
19
+ - Bearer <API_KEY>
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Sun, 07 Nov 2021 19:18:31 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Content-Security-Policy:
34
+ - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
35
+ https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
36
+ ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
37
+ X-Dns-Prefetch-Control:
38
+ - 'off'
39
+ Expect-Ct:
40
+ - max-age=0
41
+ X-Frame-Options:
42
+ - SAMEORIGIN
43
+ Strict-Transport-Security:
44
+ - max-age=15552000; includeSubDomains
45
+ X-Download-Options:
46
+ - noopen
47
+ X-Content-Type-Options:
48
+ - nosniff
49
+ X-Permitted-Cross-Domain-Policies:
50
+ - none
51
+ Referrer-Policy:
52
+ - no-referrer
53
+ X-Xss-Protection:
54
+ - '0'
55
+ Vary:
56
+ - Origin, Accept-Encoding
57
+ Access-Control-Allow-Credentials:
58
+ - 'true'
59
+ X-Request-Id:
60
+ - c63229f4-faa3-4693-a769-f132af1d156e
61
+ Etag:
62
+ - W/"149-gnrinkKr5pyIOSLENIObBLph9N0"
63
+ Via:
64
+ - 1.1 vegur
65
+ Cf-Cache-Status:
66
+ - DYNAMIC
67
+ Report-To:
68
+ - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=8pe6lAa%2BE5FfpwjmgW1wU%2Fn%2BqfVS0xUHV0FKT%2Fvt%2FpQCa1A4nNwqR1hMyE9ytoi%2F3InXs3rP9ELYw%2FpJZ1Ow0uaNd3xoll7al5maCCPI1JWivjr%2Bxx6G1Otiw5iTIaAh3MXoP0pjUAnZVsf4bw%3D%3D"}],"group":"cf-nel","max_age":604800}'
69
+ Nel:
70
+ - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}'
71
+ Server:
72
+ - cloudflare
73
+ Cf-Ray:
74
+ - 6aa8e86daa570b76-DFW
75
+ Alt-Svc:
76
+ - h3=":443"; ma=86400, h3-29=":443"; ma=86400, h3-28=":443"; ma=86400, h3-27=":443";
77
+ ma=86400
78
+ body:
79
+ encoding: ASCII-8BIT
80
+ string: '{"object":"directory","id":"directory_01FK17DWRHH7APAFXT5B52PV0W","organization_id":"org_01F6Q6TFP7RD2PF6J03ANNWDKV","name":"Testing
81
+ Active Attribute","external_key":"QArgyQQkq4G0MquM","type":"azure scim v2.0","state":"linked","created_at":"2021-10-27T15:55:47.856Z","updated_at":"2021-10-27T16:03:43.990Z","domain":"example.me"}'
82
+ http_version:
83
+ recorded_at: Sun, 07 Nov 2021 19:18:31 GMT
84
+ 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/directories?after=after-id
5
+ uri: https://api.workos.com/directories?after=directory_01FGCPNV312FHFRCX0BYWHVSE1
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -14,7 +14,7 @@ http_interactions:
14
14
  Accept:
15
15
  - "*/*"
16
16
  User-Agent:
17
- - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.2.1
17
+ - WorkOS; ruby/3.0.2; x86_64-darwin19; v1.6.0
18
18
  Authorization:
19
19
  - Bearer <API_KEY>
20
20
  response:
@@ -22,14 +22,14 @@ http_interactions:
22
22
  code: 200
23
23
  message: OK
24
24
  headers:
25
- Server:
26
- - Cowboy
25
+ Date:
26
+ - Sun, 31 Oct 2021 23:16:20 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
27
31
  Connection:
28
32
  - keep-alive
29
- Vary:
30
- - Origin, Accept-Encoding
31
- Access-Control-Allow-Credentials:
32
- - 'true'
33
33
  Content-Security-Policy:
34
34
  - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
35
35
  https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
@@ -52,24 +52,36 @@ http_interactions:
52
52
  - no-referrer
53
53
  X-Xss-Protection:
54
54
  - '0'
55
+ Vary:
56
+ - Origin, Accept-Encoding
57
+ Access-Control-Allow-Credentials:
58
+ - 'true'
55
59
  X-Request-Id:
56
- - 167e0fa2-cee2-4834-a0aa-4f68fd0a3796
57
- Content-Type:
58
- - application/json; charset=utf-8
59
- Content-Length:
60
- - '784'
60
+ - 9b8b2fde-c533-499f-8255-ae5a38dec1c9
61
61
  Etag:
62
- - W/"310-fBrsCTIA95j4JLo4UR8X2zBThYQ"
63
- Date:
64
- - Mon, 07 Jun 2021 17:55:30 GMT
62
+ - W/"57d-b8X7nQ95z8XcpGDAg30zxtq4cyU"
65
63
  Via:
66
64
  - 1.1 vegur
65
+ Cf-Cache-Status:
66
+ - DYNAMIC
67
+ Report-To:
68
+ - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=bjisueAcX0y8T%2Bw7bzZ80xRsaJ5DYZJgfN2zGa5B24dZ%2BZPVtKMFVRMw4L9VpcpSuElvsrz9f503dDZJ46JT6sbHmUEE188lRzuHV1UC45wkzjRb%2B%2BMdPysI9473RJMX2ilURb2knzhC29H0YA%3D%3D"}],"group":"cf-nel","max_age":604800}'
69
+ Nel:
70
+ - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}'
71
+ Server:
72
+ - cloudflare
73
+ Cf-Ray:
74
+ - 6a7097287c0866e3-DFW
75
+ Alt-Svc:
76
+ - h3=":443"; ma=86400, h3-29=":443"; ma=86400, h3-28=":443"; ma=86400, h3-27=":443";
77
+ ma=86400
67
78
  body:
68
- encoding: UTF-8
69
- string: '{"object":"list","listMetadata":{"before":null,"after":null},"data":[{"object":"directory","id":"directory_01F7796W20KW0CXEQQEYENT0ZC","organization_id":"org_01EZDF20TZEJXKPSX2BJRN6TV6","name":"Bamboo
70
- Test","external_key":"rPzV4pdpbaUiKsc6","type":"bamboohr","state":"unlinked","domain":"foo-corp.com", "created_at":"2021-07-02T19:15:39.556Z","updated_at":"2021-07-02T19:31:28.499Z"},{"object":"directory","id":"directory_01F5ZY7XVQZ3DRYEZTH1EPA8BS","organization_id":"org_01EZDF20TZEJXKPSX2BJRN6TV6","name":"Foo
71
- Corp","external_key":"qV4eyK99QGUaYYa0","type":"okta scim v2.0","state":"linked","domain":"foo-corp.com", "created_at":"2021-07-02T19:15:39.556Z","updated_at":"2021-07-02T19:31:28.499Z"},{"object":"directory","id":"directory_01F5XHH1QHX6C2F0Z6WG9YPGCJ","organization_id":"org_01F29YJ068E52HGEB8ZQGC9MJG","name":"Example
72
- Azure SCIM","external_key":"YDKJvbWHKKg66cSk","type":"azure scim v2.0","state":"linked","domain":"example.com", "created_at":"2021-07-02T19:15:39.556Z","updated_at":"2021-07-02T19:31:28.499Z"}]}'
79
+ encoding: ASCII-8BIT
80
+ string: '{"object":"list","data":[{"object":"directory","id":"directory_01FK3HFFGMC2WF32RR8SKWC8KA","organization_id":"org_01FHRF60X0CDBB8F6A0YGSJJ2B","name":"Azure
81
+ Set Up Test","external_key":"Ii2mw43BMAIqiKuA","type":"azure scim v2.0","state":"linked","created_at":"2021-10-28T13:29:54.451Z","updated_at":"2021-10-28T13:32:03.737Z"},{"object":"directory","id":"directory_01FK17DWRHH7APAFXT5B52PV0W","organization_id":"org_01F6Q6TFP7RD2PF6J03ANNWDKV","name":"Testing
82
+ Active Attribute","external_key":"QArgyQQkq4G0MquM","type":"azure scim v2.0","state":"linked","created_at":"2021-10-27T15:55:47.856Z","updated_at":"2021-10-27T16:03:43.990Z","domain":"example.me"},{"object":"directory","id":"directory_01FHZKS052FGZQQCZHAX0E4AC0","organization_id":"org_01FHRF60X0CDBB8F6A0YGSJJ2B","name":"Okta
83
+ SCIM Test","external_key":"z76YkVQ9vEK0AUyy","type":"okta scim v2.0","state":"linked","created_at":"2021-10-14T14:37:24.004Z","updated_at":"2021-10-27T15:50:21.248Z"},{"object":"directory","id":"directory_01FGCQE0KD0V01GB46NJ7871F7","organization_id":"org_01FGCPJPQ35DR0WGGGBEC2V1GN","name":"Azure
84
+ Test","external_key":"S16nSw4AaAyW06ia","type":"azure scim v2.0","state":"linked","created_at":"2021-09-24T20:20:02.285Z","updated_at":"2021-10-27T15:50:21.579Z"}],"list_metadata":{"before":"directory_01FGCQE0KD0V01GB46NJ7871F7","after":null},"listMetadata":{"before":"directory_01FGCQE0KD0V01GB46NJ7871F7","after":null}}'
73
85
  http_version:
74
- recorded_at: Mon, 07 Jun 2021 17:55:30 GMT
86
+ recorded_at: Sun, 31 Oct 2021 23:16:20 GMT
75
87
  recorded_with: VCR 5.0.0