workos 0.11.0 → 1.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 +2 -2
- data/LICENSE +1 -1
- data/README.md +13 -230
- data/lib/workos/client.rb +18 -1
- data/lib/workos/connection.rb +5 -1
- data/lib/workos/directory_user.rb +4 -1
- data/lib/workos/organizations.rb +150 -0
- data/lib/workos/passwordless.rb +4 -0
- data/lib/workos/portal.rb +0 -80
- data/lib/workos/profile_and_token.rb +28 -0
- data/lib/workos/sso.rb +8 -100
- data/lib/workos/types/connection_struct.rb +1 -0
- data/lib/workos/types/directory_user_struct.rb +1 -0
- data/lib/workos/version.rb +1 -1
- data/lib/workos.rb +2 -0
- data/spec/lib/workos/organizations_spec.rb +164 -0
- data/spec/lib/workos/portal_spec.rb +0 -113
- data/spec/lib/workos/sso_spec.rb +9 -120
- data/spec/support/fixtures/vcr_cassettes/organization/get.yml +73 -0
- data/spec/support/fixtures/vcr_cassettes/{sso/create_connection_with_invalid_source.yml → organization/get_invalid.yml} +26 -12
- data/spec/support/fixtures/vcr_cassettes/organization/update.yml +73 -0
- data/spec/support/fixtures/vcr_cassettes/organization/update_invalid.yml +73 -0
- metadata +15 -7
- data/spec/support/fixtures/vcr_cassettes/sso/create_connection_with_valid_source.yml +0 -63
data/spec/lib/workos/sso_spec.rb
CHANGED
|
@@ -147,52 +147,9 @@ describe WorkOS::SSO do
|
|
|
147
147
|
)
|
|
148
148
|
end
|
|
149
149
|
end
|
|
150
|
-
|
|
151
|
-
context 'passing the project_id' do
|
|
152
|
-
let(:args) do
|
|
153
|
-
{
|
|
154
|
-
domain: 'foo.com',
|
|
155
|
-
project_id: 'workos-proj-123',
|
|
156
|
-
redirect_uri: 'foo.com/auth/callback',
|
|
157
|
-
state: {
|
|
158
|
-
next_page: '/dashboard/edit',
|
|
159
|
-
}.to_s,
|
|
160
|
-
}
|
|
161
|
-
end
|
|
162
|
-
it 'raises a deprecation warning' do
|
|
163
|
-
expect do
|
|
164
|
-
described_class.authorization_url(**args)
|
|
165
|
-
end.to output(
|
|
166
|
-
"[DEPRECATION] `project_id` is deprecated.
|
|
167
|
-
Please use `client_id` instead.\n",
|
|
168
|
-
).to_stderr
|
|
169
|
-
end
|
|
170
|
-
|
|
171
|
-
it 'returns a valid URL' do
|
|
172
|
-
authorization_url = described_class.authorization_url(**args)
|
|
173
|
-
|
|
174
|
-
expect(URI.parse(authorization_url)).to be_a URI
|
|
175
|
-
end
|
|
176
|
-
|
|
177
|
-
it 'returns the expected hostname' do
|
|
178
|
-
authorization_url = described_class.authorization_url(**args)
|
|
179
|
-
|
|
180
|
-
expect(URI.parse(authorization_url).host).to eq(WorkOS::API_HOSTNAME)
|
|
181
|
-
end
|
|
182
|
-
|
|
183
|
-
it 'returns the expected query string' do
|
|
184
|
-
authorization_url = described_class.authorization_url(**args)
|
|
185
|
-
|
|
186
|
-
expect(URI.parse(authorization_url).query).to eq(
|
|
187
|
-
'client_id=workos-proj-123&redirect_uri=foo.com%2Fauth%2Fcallback' \
|
|
188
|
-
'&response_type=code&state=%7B%3Anext_page%3D%3E%22%2Fdashboard%2F' \
|
|
189
|
-
'edit%22%7D&domain=foo.com',
|
|
190
|
-
)
|
|
191
|
-
end
|
|
192
|
-
end
|
|
193
150
|
end
|
|
194
151
|
|
|
195
|
-
describe '.
|
|
152
|
+
describe '.profile_and_token' do
|
|
196
153
|
let(:args) do
|
|
197
154
|
{
|
|
198
155
|
code: SecureRandom.hex(10),
|
|
@@ -225,15 +182,15 @@ describe WorkOS::SSO do
|
|
|
225
182
|
end
|
|
226
183
|
|
|
227
184
|
it 'includes the SDK Version header' do
|
|
228
|
-
described_class.
|
|
185
|
+
described_class.profile_and_token(**args)
|
|
229
186
|
|
|
230
187
|
expect(a_request(:post, 'https://api.workos.com/sso/token').
|
|
231
188
|
with(headers: headers, body: request_body)).to have_been_made
|
|
232
189
|
end
|
|
233
190
|
|
|
234
|
-
it 'returns a WorkOS::
|
|
235
|
-
|
|
236
|
-
expect(
|
|
191
|
+
it 'returns a WorkOS::ProfileAndToken' do
|
|
192
|
+
profile_and_token = described_class.profile_and_token(**args)
|
|
193
|
+
expect(profile_and_token).to be_a(WorkOS::ProfileAndToken)
|
|
237
194
|
|
|
238
195
|
expectation = {
|
|
239
196
|
connection_id: 'conn_01EMH8WAK20T42N2NBMNBCYHAG',
|
|
@@ -252,7 +209,8 @@ describe WorkOS::SSO do
|
|
|
252
209
|
},
|
|
253
210
|
}
|
|
254
211
|
|
|
255
|
-
expect(
|
|
212
|
+
expect(profile_and_token.access_token).to eq('01DVX6QBS3EG6FHY2ESAA5Q65X')
|
|
213
|
+
expect(profile_and_token.profile.to_json).to eq(expectation)
|
|
256
214
|
end
|
|
257
215
|
end
|
|
258
216
|
|
|
@@ -269,7 +227,7 @@ describe WorkOS::SSO do
|
|
|
269
227
|
|
|
270
228
|
it 'raises an exception with request ID' do
|
|
271
229
|
expect do
|
|
272
|
-
described_class.
|
|
230
|
+
described_class.profile_and_token(**args)
|
|
273
231
|
end.to raise_error(
|
|
274
232
|
WorkOS::APIError,
|
|
275
233
|
'some error message - request ID: request-id',
|
|
@@ -293,7 +251,7 @@ describe WorkOS::SSO do
|
|
|
293
251
|
|
|
294
252
|
it 'raises an exception' do
|
|
295
253
|
expect do
|
|
296
|
-
described_class.
|
|
254
|
+
described_class.profile_and_token(**args)
|
|
297
255
|
end.to raise_error(
|
|
298
256
|
WorkOS::APIError,
|
|
299
257
|
"The code '01DVX3C5Z367SFHR8QNDMK7V24'" \
|
|
@@ -303,75 +261,6 @@ describe WorkOS::SSO do
|
|
|
303
261
|
end
|
|
304
262
|
end
|
|
305
263
|
|
|
306
|
-
describe '.create_connection' do
|
|
307
|
-
context 'with a valid source' do
|
|
308
|
-
it 'creates a connection' do
|
|
309
|
-
VCR.use_cassette('sso/create_connection_with_valid_source') do
|
|
310
|
-
connection = WorkOS::SSO.create_connection(
|
|
311
|
-
source: 'draft_conn_01E6PK87QP6NQ29RRX0G100YGV',
|
|
312
|
-
)
|
|
313
|
-
|
|
314
|
-
expect(connection.id).to eq('conn_01E4F9T2YWZFD218DN04KVFDSY')
|
|
315
|
-
expect(connection.connection_type).to eq('GoogleOAuth')
|
|
316
|
-
expect(connection.name).to eq('Foo Corp')
|
|
317
|
-
expect(connection.domains.first[:domain]).to eq('example.com')
|
|
318
|
-
expect(connection.organization_id).to eq('12345')
|
|
319
|
-
expect(connection.status).to eq('linked')
|
|
320
|
-
end
|
|
321
|
-
end
|
|
322
|
-
end
|
|
323
|
-
|
|
324
|
-
context 'with an invalid source' do
|
|
325
|
-
it 'raises an error' do
|
|
326
|
-
VCR.use_cassette('sso/create_connection_with_invalid_source') do
|
|
327
|
-
expect do
|
|
328
|
-
WorkOS::SSO.create_connection(source: 'invalid')
|
|
329
|
-
end.to raise_error(
|
|
330
|
-
WorkOS::APIError,
|
|
331
|
-
'Status 404, Not Found - request ID: ',
|
|
332
|
-
)
|
|
333
|
-
end
|
|
334
|
-
end
|
|
335
|
-
end
|
|
336
|
-
end
|
|
337
|
-
|
|
338
|
-
describe '.promote_draft_connection' do
|
|
339
|
-
let(:token) { 'draft_conn_id' }
|
|
340
|
-
let(:client_id) { 'proj_0239u590h' }
|
|
341
|
-
|
|
342
|
-
context 'with a valid request' do
|
|
343
|
-
before do
|
|
344
|
-
stub_request(
|
|
345
|
-
:post,
|
|
346
|
-
"https://api.workos.com/draft_connections/#{token}/activate",
|
|
347
|
-
).to_return(status: 200)
|
|
348
|
-
end
|
|
349
|
-
it 'returns true' do
|
|
350
|
-
response = described_class.promote_draft_connection(
|
|
351
|
-
token: token,
|
|
352
|
-
)
|
|
353
|
-
|
|
354
|
-
expect(response).to be(true)
|
|
355
|
-
end
|
|
356
|
-
end
|
|
357
|
-
|
|
358
|
-
context 'with an invalid request' do
|
|
359
|
-
before do
|
|
360
|
-
stub_request(
|
|
361
|
-
:post,
|
|
362
|
-
"https://api.workos.com/draft_connections/#{token}/activate",
|
|
363
|
-
).to_return(status: 403)
|
|
364
|
-
end
|
|
365
|
-
it 'returns true' do
|
|
366
|
-
response = described_class.promote_draft_connection(
|
|
367
|
-
token: token,
|
|
368
|
-
)
|
|
369
|
-
|
|
370
|
-
expect(response).to be(false)
|
|
371
|
-
end
|
|
372
|
-
end
|
|
373
|
-
end
|
|
374
|
-
|
|
375
264
|
describe '.list_connections' do
|
|
376
265
|
context 'with no options' do
|
|
377
266
|
it 'returns connections and metadata' do
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
http_interactions:
|
|
3
|
+
- request:
|
|
4
|
+
method: get
|
|
5
|
+
uri: https://api.workos.com/organizations/org_01EZDF20TZEJXKPSX2BJRN6TV6
|
|
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.1; x86_64-darwin19; v0.11.1
|
|
18
|
+
Authorization:
|
|
19
|
+
- Bearer <API_KEY>
|
|
20
|
+
response:
|
|
21
|
+
status:
|
|
22
|
+
code: 200
|
|
23
|
+
message: OK
|
|
24
|
+
headers:
|
|
25
|
+
Server:
|
|
26
|
+
- Cowboy
|
|
27
|
+
Connection:
|
|
28
|
+
- keep-alive
|
|
29
|
+
Vary:
|
|
30
|
+
- Origin, Accept-Encoding
|
|
31
|
+
Access-Control-Allow-Credentials:
|
|
32
|
+
- 'true'
|
|
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
|
+
X-Request-Id:
|
|
56
|
+
- 06e7c714-c492-4f4e-8fbf-41b0367531ff
|
|
57
|
+
Content-Type:
|
|
58
|
+
- application/json; charset=utf-8
|
|
59
|
+
Content-Length:
|
|
60
|
+
- '312'
|
|
61
|
+
Etag:
|
|
62
|
+
- W/"138-g/hQHq1azVQbQRpF7ECy/AbaJ8E"
|
|
63
|
+
Date:
|
|
64
|
+
- Mon, 10 May 2021 17:21:42 GMT
|
|
65
|
+
Via:
|
|
66
|
+
- 1.1 vegur
|
|
67
|
+
body:
|
|
68
|
+
encoding: UTF-8
|
|
69
|
+
string: '{"object":"organization","id":"org_01EZDF20TZEJXKPSX2BJRN6TV6","name":"Foo
|
|
70
|
+
Corp","domains":[{"object":"organization_domain","id":"org_domain_01EZDF20V4VAME34TF0B3DPK49","domain":"foo-corp.com"},{"object":"organization_domain","id":"org_domain_01F2PYX1XMS5ZQW1E8FZ57GPQN","domain":"blairworkos.onmicrosoft.com"}]}'
|
|
71
|
+
http_version:
|
|
72
|
+
recorded_at: Mon, 10 May 2021 17:21:42 GMT
|
|
73
|
+
recorded_with: VCR 5.0.0
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
http_interactions:
|
|
3
3
|
- request:
|
|
4
|
-
method:
|
|
5
|
-
uri: https://api.workos.com/
|
|
4
|
+
method: get
|
|
5
|
+
uri: https://api.workos.com/organizations/invalid
|
|
6
6
|
body:
|
|
7
|
-
encoding:
|
|
8
|
-
string: '
|
|
7
|
+
encoding: US-ASCII
|
|
8
|
+
string: ''
|
|
9
9
|
headers:
|
|
10
10
|
Content-Type:
|
|
11
11
|
- application/json
|
|
@@ -14,7 +14,7 @@ http_interactions:
|
|
|
14
14
|
Accept:
|
|
15
15
|
- "*/*"
|
|
16
16
|
User-Agent:
|
|
17
|
-
- WorkOS; ruby/
|
|
17
|
+
- WorkOS; ruby/3.0.1; x86_64-darwin19; v0.11.1
|
|
18
18
|
Authorization:
|
|
19
19
|
- Bearer <API_KEY>
|
|
20
20
|
response:
|
|
@@ -22,12 +22,22 @@ http_interactions:
|
|
|
22
22
|
code: 404
|
|
23
23
|
message: Not Found
|
|
24
24
|
headers:
|
|
25
|
+
Server:
|
|
26
|
+
- Cowboy
|
|
27
|
+
Connection:
|
|
28
|
+
- keep-alive
|
|
25
29
|
Vary:
|
|
26
30
|
- Origin, Accept-Encoding
|
|
27
31
|
Access-Control-Allow-Credentials:
|
|
28
32
|
- 'true'
|
|
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'
|
|
29
37
|
X-Dns-Prefetch-Control:
|
|
30
38
|
- 'off'
|
|
39
|
+
Expect-Ct:
|
|
40
|
+
- max-age=0
|
|
31
41
|
X-Frame-Options:
|
|
32
42
|
- SAMEORIGIN
|
|
33
43
|
Strict-Transport-Security:
|
|
@@ -36,10 +46,14 @@ http_interactions:
|
|
|
36
46
|
- noopen
|
|
37
47
|
X-Content-Type-Options:
|
|
38
48
|
- nosniff
|
|
49
|
+
X-Permitted-Cross-Domain-Policies:
|
|
50
|
+
- none
|
|
51
|
+
Referrer-Policy:
|
|
52
|
+
- no-referrer
|
|
39
53
|
X-Xss-Protection:
|
|
40
|
-
-
|
|
54
|
+
- '0'
|
|
41
55
|
X-Request-Id:
|
|
42
|
-
-
|
|
56
|
+
-
|
|
43
57
|
Content-Type:
|
|
44
58
|
- application/json; charset=utf-8
|
|
45
59
|
Content-Length:
|
|
@@ -47,12 +61,12 @@ http_interactions:
|
|
|
47
61
|
Etag:
|
|
48
62
|
- W/"17-SuRA/yvUWUo8rK6x7dKURLeBo+0"
|
|
49
63
|
Date:
|
|
50
|
-
-
|
|
51
|
-
|
|
52
|
-
-
|
|
64
|
+
- Mon, 10 May 2021 17:21:43 GMT
|
|
65
|
+
Via:
|
|
66
|
+
- 1.1 vegur
|
|
53
67
|
body:
|
|
54
68
|
encoding: UTF-8
|
|
55
69
|
string: '{"message":"Not Found"}'
|
|
56
|
-
http_version:
|
|
57
|
-
recorded_at:
|
|
70
|
+
http_version:
|
|
71
|
+
recorded_at: Mon, 10 May 2021 17:21:43 GMT
|
|
58
72
|
recorded_with: VCR 5.0.0
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
http_interactions:
|
|
3
|
+
- request:
|
|
4
|
+
method: put
|
|
5
|
+
uri: https://api.workos.com/organizations/org_01F29YJ068E52HGEB8ZQGC9MJG
|
|
6
|
+
body:
|
|
7
|
+
encoding: UTF-8
|
|
8
|
+
string: '{"domains":["example.me"],"name":"Test Organization"}'
|
|
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.1; x86_64-darwin19; v0.11.1
|
|
18
|
+
Authorization:
|
|
19
|
+
- Bearer <API_KEY>
|
|
20
|
+
response:
|
|
21
|
+
status:
|
|
22
|
+
code: 200
|
|
23
|
+
message: OK
|
|
24
|
+
headers:
|
|
25
|
+
Server:
|
|
26
|
+
- Cowboy
|
|
27
|
+
Connection:
|
|
28
|
+
- keep-alive
|
|
29
|
+
Vary:
|
|
30
|
+
- Origin, Accept-Encoding
|
|
31
|
+
Access-Control-Allow-Credentials:
|
|
32
|
+
- 'true'
|
|
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
|
+
X-Request-Id:
|
|
56
|
+
- 9acc2cae-063a-485f-8a36-df21816b66bf
|
|
57
|
+
Content-Type:
|
|
58
|
+
- application/json; charset=utf-8
|
|
59
|
+
Content-Length:
|
|
60
|
+
- '202'
|
|
61
|
+
Etag:
|
|
62
|
+
- W/"ca-cUBZaGl5MJlERA8SKJ9+GrSHPM0"
|
|
63
|
+
Date:
|
|
64
|
+
- Wed, 05 May 2021 22:14:09 GMT
|
|
65
|
+
Via:
|
|
66
|
+
- 1.1 vegur
|
|
67
|
+
body:
|
|
68
|
+
encoding: UTF-8
|
|
69
|
+
string: '{"object":"organization","id":"org_01F29YJ068E52HGEB8ZQGC9MJG","name":"Test
|
|
70
|
+
Organization","domains":[{"object":"organization_domain","id":"org_domain_01F4Z9GXPP2BEH019613C72E4Y","domain":"example.me"}]}'
|
|
71
|
+
http_version:
|
|
72
|
+
recorded_at: Wed, 05 May 2021 22:14:09 GMT
|
|
73
|
+
recorded_with: VCR 5.0.0
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
http_interactions:
|
|
3
|
+
- request:
|
|
4
|
+
method: put
|
|
5
|
+
uri: https://api.workos.com/organizations/org_01F29YJ068E52HGEB8ZQGC9MJG
|
|
6
|
+
body:
|
|
7
|
+
encoding: UTF-8
|
|
8
|
+
string: '{"domains":["example.com"],"name":"Test Organization 2"}'
|
|
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.1; x86_64-darwin19; v0.11.1
|
|
18
|
+
Authorization:
|
|
19
|
+
- Bearer <API_KEY>
|
|
20
|
+
response:
|
|
21
|
+
status:
|
|
22
|
+
code: 200
|
|
23
|
+
message: OK
|
|
24
|
+
headers:
|
|
25
|
+
Server:
|
|
26
|
+
- Cowboy
|
|
27
|
+
Connection:
|
|
28
|
+
- keep-alive
|
|
29
|
+
Vary:
|
|
30
|
+
- Origin, Accept-Encoding
|
|
31
|
+
Access-Control-Allow-Credentials:
|
|
32
|
+
- 'true'
|
|
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
|
+
X-Request-Id:
|
|
56
|
+
- 6ba2cbf9-76e3-4a6a-8ebe-d25edb366ed0
|
|
57
|
+
Content-Type:
|
|
58
|
+
- application/json; charset=utf-8
|
|
59
|
+
Content-Length:
|
|
60
|
+
- '205'
|
|
61
|
+
Etag:
|
|
62
|
+
- W/"cd-mlRMlyyz/LtzInRhAghs1B+BT4s"
|
|
63
|
+
Date:
|
|
64
|
+
- Wed, 05 May 2021 22:14:10 GMT
|
|
65
|
+
Via:
|
|
66
|
+
- 1.1 vegur
|
|
67
|
+
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"}]}'
|
|
71
|
+
http_version:
|
|
72
|
+
recorded_at: Wed, 05 May 2021 22:14:10 GMT
|
|
73
|
+
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: 0.
|
|
4
|
+
version: 1.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: 2021-
|
|
11
|
+
date: 2021-05-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: sorbet-runtime
|
|
@@ -217,9 +217,11 @@ files:
|
|
|
217
217
|
- lib/workos/directory_user.rb
|
|
218
218
|
- lib/workos/errors.rb
|
|
219
219
|
- lib/workos/organization.rb
|
|
220
|
+
- lib/workos/organizations.rb
|
|
220
221
|
- lib/workos/passwordless.rb
|
|
221
222
|
- lib/workos/portal.rb
|
|
222
223
|
- lib/workos/profile.rb
|
|
224
|
+
- lib/workos/profile_and_token.rb
|
|
223
225
|
- lib/workos/sso.rb
|
|
224
226
|
- lib/workos/types.rb
|
|
225
227
|
- lib/workos/types/connection_struct.rb
|
|
@@ -270,6 +272,7 @@ files:
|
|
|
270
272
|
- spec/lib/workos/audit_trail_spec.rb
|
|
271
273
|
- spec/lib/workos/base_spec.rb
|
|
272
274
|
- spec/lib/workos/directory_sync_spec.rb
|
|
275
|
+
- spec/lib/workos/organizations_spec.rb
|
|
273
276
|
- spec/lib/workos/passwordless_spec.rb
|
|
274
277
|
- spec/lib/workos/portal_spec.rb
|
|
275
278
|
- spec/lib/workos/sso_spec.rb
|
|
@@ -306,7 +309,11 @@ files:
|
|
|
306
309
|
- spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_no_options.yml
|
|
307
310
|
- spec/support/fixtures/vcr_cassettes/organization/create.yml
|
|
308
311
|
- spec/support/fixtures/vcr_cassettes/organization/create_invalid.yml
|
|
312
|
+
- spec/support/fixtures/vcr_cassettes/organization/get.yml
|
|
313
|
+
- spec/support/fixtures/vcr_cassettes/organization/get_invalid.yml
|
|
309
314
|
- spec/support/fixtures/vcr_cassettes/organization/list.yml
|
|
315
|
+
- spec/support/fixtures/vcr_cassettes/organization/update.yml
|
|
316
|
+
- spec/support/fixtures/vcr_cassettes/organization/update_invalid.yml
|
|
310
317
|
- spec/support/fixtures/vcr_cassettes/passwordless/create_session.yml
|
|
311
318
|
- spec/support/fixtures/vcr_cassettes/passwordless/create_session_invalid.yml
|
|
312
319
|
- spec/support/fixtures/vcr_cassettes/passwordless/send_session.yml
|
|
@@ -314,8 +321,6 @@ files:
|
|
|
314
321
|
- spec/support/fixtures/vcr_cassettes/portal/generate_link_dsync.yml
|
|
315
322
|
- spec/support/fixtures/vcr_cassettes/portal/generate_link_invalid.yml
|
|
316
323
|
- spec/support/fixtures/vcr_cassettes/portal/generate_link_sso.yml
|
|
317
|
-
- spec/support/fixtures/vcr_cassettes/sso/create_connection_with_invalid_source.yml
|
|
318
|
-
- spec/support/fixtures/vcr_cassettes/sso/create_connection_with_valid_source.yml
|
|
319
324
|
- spec/support/fixtures/vcr_cassettes/sso/delete_connection_with_invalid_id.yml
|
|
320
325
|
- spec/support/fixtures/vcr_cassettes/sso/delete_connection_with_valid_id.yml
|
|
321
326
|
- spec/support/fixtures/vcr_cassettes/sso/get_connection_with_invalid_id.yml
|
|
@@ -349,7 +354,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
349
354
|
- !ruby/object:Gem::Version
|
|
350
355
|
version: '0'
|
|
351
356
|
requirements: []
|
|
352
|
-
rubygems_version: 3.2.
|
|
357
|
+
rubygems_version: 3.2.17
|
|
353
358
|
signing_key:
|
|
354
359
|
specification_version: 4
|
|
355
360
|
summary: API client for WorkOS
|
|
@@ -357,6 +362,7 @@ test_files:
|
|
|
357
362
|
- spec/lib/workos/audit_trail_spec.rb
|
|
358
363
|
- spec/lib/workos/base_spec.rb
|
|
359
364
|
- spec/lib/workos/directory_sync_spec.rb
|
|
365
|
+
- spec/lib/workos/organizations_spec.rb
|
|
360
366
|
- spec/lib/workos/passwordless_spec.rb
|
|
361
367
|
- spec/lib/workos/portal_spec.rb
|
|
362
368
|
- spec/lib/workos/sso_spec.rb
|
|
@@ -393,7 +399,11 @@ test_files:
|
|
|
393
399
|
- spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_no_options.yml
|
|
394
400
|
- spec/support/fixtures/vcr_cassettes/organization/create.yml
|
|
395
401
|
- spec/support/fixtures/vcr_cassettes/organization/create_invalid.yml
|
|
402
|
+
- spec/support/fixtures/vcr_cassettes/organization/get.yml
|
|
403
|
+
- spec/support/fixtures/vcr_cassettes/organization/get_invalid.yml
|
|
396
404
|
- spec/support/fixtures/vcr_cassettes/organization/list.yml
|
|
405
|
+
- spec/support/fixtures/vcr_cassettes/organization/update.yml
|
|
406
|
+
- spec/support/fixtures/vcr_cassettes/organization/update_invalid.yml
|
|
397
407
|
- spec/support/fixtures/vcr_cassettes/passwordless/create_session.yml
|
|
398
408
|
- spec/support/fixtures/vcr_cassettes/passwordless/create_session_invalid.yml
|
|
399
409
|
- spec/support/fixtures/vcr_cassettes/passwordless/send_session.yml
|
|
@@ -401,8 +411,6 @@ test_files:
|
|
|
401
411
|
- spec/support/fixtures/vcr_cassettes/portal/generate_link_dsync.yml
|
|
402
412
|
- spec/support/fixtures/vcr_cassettes/portal/generate_link_invalid.yml
|
|
403
413
|
- spec/support/fixtures/vcr_cassettes/portal/generate_link_sso.yml
|
|
404
|
-
- spec/support/fixtures/vcr_cassettes/sso/create_connection_with_invalid_source.yml
|
|
405
|
-
- spec/support/fixtures/vcr_cassettes/sso/create_connection_with_valid_source.yml
|
|
406
414
|
- spec/support/fixtures/vcr_cassettes/sso/delete_connection_with_invalid_id.yml
|
|
407
415
|
- spec/support/fixtures/vcr_cassettes/sso/delete_connection_with_valid_id.yml
|
|
408
416
|
- spec/support/fixtures/vcr_cassettes/sso/get_connection_with_invalid_id.yml
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
http_interactions:
|
|
3
|
-
- request:
|
|
4
|
-
method: post
|
|
5
|
-
uri: https://api.workos.com/connections
|
|
6
|
-
body:
|
|
7
|
-
encoding: UTF-8
|
|
8
|
-
string: '{"source":"draft_conn_01E6PK87QP6NQ29RRX0G100YGV"}'
|
|
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.7.1; x86_64-darwin19; v0.2.2
|
|
18
|
-
Authorization:
|
|
19
|
-
- Bearer <API_KEY>
|
|
20
|
-
response:
|
|
21
|
-
status:
|
|
22
|
-
code: 201
|
|
23
|
-
message: Created
|
|
24
|
-
headers:
|
|
25
|
-
Server:
|
|
26
|
-
- Cowboy
|
|
27
|
-
Connection:
|
|
28
|
-
- keep-alive
|
|
29
|
-
Vary:
|
|
30
|
-
- Origin, Accept-Encoding
|
|
31
|
-
Access-Control-Allow-Credentials:
|
|
32
|
-
- 'true'
|
|
33
|
-
X-Dns-Prefetch-Control:
|
|
34
|
-
- 'off'
|
|
35
|
-
X-Frame-Options:
|
|
36
|
-
- SAMEORIGIN
|
|
37
|
-
Strict-Transport-Security:
|
|
38
|
-
- max-age=15552000; includeSubDomains
|
|
39
|
-
X-Download-Options:
|
|
40
|
-
- noopen
|
|
41
|
-
X-Content-Type-Options:
|
|
42
|
-
- nosniff
|
|
43
|
-
X-Xss-Protection:
|
|
44
|
-
- 1; mode=block
|
|
45
|
-
X-Request-Id:
|
|
46
|
-
- 8cd03fab-ca1a-4c0b-9953-1f918849a9de
|
|
47
|
-
Content-Type:
|
|
48
|
-
- application/json; charset=utf-8
|
|
49
|
-
Etag:
|
|
50
|
-
- W/"55a-z00MNCfGmS/7RWJwhsBrAXo09Ls"
|
|
51
|
-
Date:
|
|
52
|
-
- Fri, 24 Apr 2020 17:20:52 GMT
|
|
53
|
-
Transfer-Encoding:
|
|
54
|
-
- chunked
|
|
55
|
-
Via:
|
|
56
|
-
- 1.1 vegur
|
|
57
|
-
body:
|
|
58
|
-
encoding: ASCII-8BIT
|
|
59
|
-
string: '{"object":"connection","id":"conn_01E4F9T2YWZFD218DN04KVFDSY","status":"linked","name":"Foo Corp","connection_type":"GoogleOAuth","oauth_uid":"demo
|
|
60
|
-
client id","oauth_secret":"demo client secret","oauth_redirect_uri":"https://auth.workos.com/sso/oauth/google/gcrSPYSytyQeZKkwKs6Ye4ogM/callback","saml_entity_id":null,"saml_idp_url":null,"saml_relying_party_trust_cert":null,"saml_x509_certs":null,"organization_id":"12345","domains":[{"object":"connection_domain","id":"domain_01E6PK9N3XMD8RHWF7S66380AR","domain":"example.com"}]}'
|
|
61
|
-
http_version:
|
|
62
|
-
recorded_at: Fri, 24 Apr 2020 17:20:52 GMT
|
|
63
|
-
recorded_with: VCR 5.0.0
|