workos 1.4.0 → 1.5.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/lib/workos/connection.rb +9 -1
- data/lib/workos/directory.rb +9 -1
- data/lib/workos/directory_user.rb +4 -1
- data/lib/workos/organization.rb +7 -1
- data/lib/workos/types/connection_struct.rb +2 -0
- data/lib/workos/types/directory_struct.rb +2 -0
- data/lib/workos/types/directory_user_struct.rb +1 -0
- data/lib/workos/types/organization_struct.rb +2 -0
- data/lib/workos/version.rb +1 -1
- data/spec/lib/workos/directory_sync_spec.rb +19 -19
- data/spec/lib/workos/organizations_spec.rb +11 -11
- data/spec/lib/workos/sso_spec.rb +12 -12
- data/spec/support/fixtures/vcr_cassettes/directory_sync/get_user.yml +40 -16
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_after.yml +3 -3
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_before.yml +3 -3
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_domain.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_limit.yml +2 -2
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_no_options.yml +3 -3
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_search.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_after.yml +128 -28
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_before.yml +31 -18
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_directory.yml +136 -35
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_group.yml +128 -18
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_limit.yml +131 -17
- data/spec/support/fixtures/vcr_cassettes/organization/create.yml +28 -16
- data/spec/support/fixtures/vcr_cassettes/organization/get.yml +27 -16
- data/spec/support/fixtures/vcr_cassettes/organization/list.yml +29 -14
- data/spec/support/fixtures/vcr_cassettes/organization/update.yml +27 -16
- data/spec/support/fixtures/vcr_cassettes/sso/get_connection_with_valid_id.yml +28 -16
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_after.yml +25 -15
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_before.yml +28 -15
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_connection_type.yml +31 -14
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_domain.yml +27 -13
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_limit.yml +24 -15
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_no_options.yml +30 -14
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_organization_id.yml +28 -14
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae5493072c3719c3a6475116ed51d7955e072fb9499a9a40b231482ffd9db082
|
4
|
+
data.tar.gz: 451ba6d7ac9542bf9cda07fe9703035fb8d58d0b1e6b4beceb4b6e7273e3b3f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5a7b8b11117bf140ee16cd1f390cd4c94cb9dba75c5c1668cc558290a2619e016c6e59f47ae2a13d5483e61078d79731bee619643ca6ec9640464b0e96a3d17
|
7
|
+
data.tar.gz: 1534875a20f5410c6b9f9a9680cb9da1ad95247308765a3dc8917f3ffde2c2e1535ae56f022051207f69295d678f621a94b8b9f9ac8ea70812ec3f4108d6edef
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
workos (1.
|
4
|
+
workos (1.5.0)
|
5
5
|
sorbet-runtime (~> 0.5)
|
6
6
|
|
7
7
|
GEM
|
@@ -60,7 +60,7 @@ GEM
|
|
60
60
|
simplecov_json_formatter (0.1.2)
|
61
61
|
sorbet (0.5.6388)
|
62
62
|
sorbet-static (= 0.5.6388)
|
63
|
-
sorbet-runtime (0.5.
|
63
|
+
sorbet-runtime (0.5.9035)
|
64
64
|
sorbet-static (0.5.6388-universal-darwin-14)
|
65
65
|
sorbet-static (0.5.6388-universal-darwin-15)
|
66
66
|
sorbet-static (0.5.6388-universal-darwin-16)
|
data/lib/workos/connection.rb
CHANGED
@@ -10,8 +10,9 @@ module WorkOS
|
|
10
10
|
extend T::Sig
|
11
11
|
|
12
12
|
attr_accessor :id, :name, :connection_type, :domains, :organization_id,
|
13
|
-
:state, :status
|
13
|
+
:state, :status, :created_at, :updated_at
|
14
14
|
|
15
|
+
# rubocop:disable Metrics/AbcSize
|
15
16
|
sig { params(json: String).void }
|
16
17
|
def initialize(json)
|
17
18
|
raw = parse_json(json)
|
@@ -23,7 +24,10 @@ module WorkOS
|
|
23
24
|
@organization_id = T.let(raw.organization_id, String)
|
24
25
|
@state = T.let(raw.state, String)
|
25
26
|
@status = T.let(raw.status, String)
|
27
|
+
@created_at = T.let(raw.created_at, String)
|
28
|
+
@updated_at = T.let(raw.updated_at, String)
|
26
29
|
end
|
30
|
+
# rubocop:enable Metrics/AbcSize
|
27
31
|
|
28
32
|
def to_json(*)
|
29
33
|
{
|
@@ -34,6 +38,8 @@ module WorkOS
|
|
34
38
|
organization_id: organization_id,
|
35
39
|
state: state,
|
36
40
|
status: status,
|
41
|
+
created_at: created_at,
|
42
|
+
updated_at: updated_at,
|
37
43
|
}
|
38
44
|
end
|
39
45
|
|
@@ -51,6 +57,8 @@ module WorkOS
|
|
51
57
|
organization_id: hash[:organization_id],
|
52
58
|
state: hash[:state],
|
53
59
|
status: hash[:status],
|
60
|
+
created_at: hash[:created_at],
|
61
|
+
updated_at: hash[:updated_at],
|
54
62
|
)
|
55
63
|
end
|
56
64
|
end
|
data/lib/workos/directory.rb
CHANGED
@@ -8,8 +8,9 @@ module WorkOS
|
|
8
8
|
class Directory
|
9
9
|
extend T::Sig
|
10
10
|
|
11
|
-
attr_accessor :id, :domain, :name, :type, :state, :organization_id
|
11
|
+
attr_accessor :id, :domain, :name, :type, :state, :organization_id, :created_at, :updated_at
|
12
12
|
|
13
|
+
# rubocop:disable Metrics/AbcSize
|
13
14
|
sig { params(json: String).void }
|
14
15
|
def initialize(json)
|
15
16
|
raw = parse_json(json)
|
@@ -20,7 +21,10 @@ module WorkOS
|
|
20
21
|
@type = T.let(raw.type, String)
|
21
22
|
@state = T.let(raw.state, String)
|
22
23
|
@organization_id = T.let(raw.organization_id, String)
|
24
|
+
@created_at = T.let(raw.created_at, String)
|
25
|
+
@updated_at = T.let(raw.updated_at, String)
|
23
26
|
end
|
27
|
+
# rubocop:enable Metrics/AbcSize
|
24
28
|
|
25
29
|
def to_json(*)
|
26
30
|
{
|
@@ -30,6 +34,8 @@ module WorkOS
|
|
30
34
|
type: type,
|
31
35
|
state: state,
|
32
36
|
organization_id: organization_id,
|
37
|
+
created_at: created_at,
|
38
|
+
updated_at: updated_at,
|
33
39
|
}
|
34
40
|
end
|
35
41
|
|
@@ -50,6 +56,8 @@ module WorkOS
|
|
50
56
|
type: hash[:type],
|
51
57
|
state: hash[:state],
|
52
58
|
organization_id: hash[:organization_id],
|
59
|
+
created_at: hash[:created_at],
|
60
|
+
updated_at: hash[:updated_at],
|
53
61
|
)
|
54
62
|
end
|
55
63
|
end
|
@@ -9,7 +9,7 @@ module WorkOS
|
|
9
9
|
extend T::Sig
|
10
10
|
|
11
11
|
attr_accessor :id, :idp_id, :emails, :first_name, :last_name, :username, :state,
|
12
|
-
:groups, :raw_attributes
|
12
|
+
:groups, :custom_attributes, :raw_attributes
|
13
13
|
|
14
14
|
# rubocop:disable Metrics/AbcSize
|
15
15
|
sig { params(json: String).void }
|
@@ -24,6 +24,7 @@ module WorkOS
|
|
24
24
|
@username = raw.username
|
25
25
|
@state = raw.state
|
26
26
|
@groups = T.let(raw.groups, Array)
|
27
|
+
@custom_attributes = raw.custom_attributes
|
27
28
|
@raw_attributes = raw.raw_attributes
|
28
29
|
end
|
29
30
|
# rubocop:enable Metrics/AbcSize
|
@@ -38,6 +39,7 @@ module WorkOS
|
|
38
39
|
username: username,
|
39
40
|
state: state,
|
40
41
|
groups: groups,
|
42
|
+
custom_attributes: custom_attributes,
|
41
43
|
raw_attributes: raw_attributes,
|
42
44
|
}
|
43
45
|
end
|
@@ -61,6 +63,7 @@ module WorkOS
|
|
61
63
|
username: hash[:username],
|
62
64
|
state: hash[:state],
|
63
65
|
groups: hash[:groups],
|
66
|
+
custom_attributes: hash[:custom_attributes],
|
64
67
|
raw_attributes: hash[:raw_attributes],
|
65
68
|
)
|
66
69
|
end
|
data/lib/workos/organization.rb
CHANGED
@@ -8,7 +8,7 @@ module WorkOS
|
|
8
8
|
class Organization
|
9
9
|
extend T::Sig
|
10
10
|
|
11
|
-
attr_accessor :id, :domains, :name
|
11
|
+
attr_accessor :id, :domains, :name, :created_at, :updated_at
|
12
12
|
|
13
13
|
sig { params(json: String).void }
|
14
14
|
def initialize(json)
|
@@ -17,6 +17,8 @@ module WorkOS
|
|
17
17
|
@id = T.let(raw.id, String)
|
18
18
|
@name = T.let(raw.name, String)
|
19
19
|
@domains = T.let(raw.domains, Array)
|
20
|
+
@created_at = T.let(raw.created_at, String)
|
21
|
+
@updated_at = T.let(raw.updated_at, String)
|
20
22
|
end
|
21
23
|
|
22
24
|
def to_json(*)
|
@@ -24,6 +26,8 @@ module WorkOS
|
|
24
26
|
id: id,
|
25
27
|
name: name,
|
26
28
|
domains: domains,
|
29
|
+
created_at: created_at,
|
30
|
+
updated_at: updated_at,
|
27
31
|
}
|
28
32
|
end
|
29
33
|
|
@@ -41,6 +45,8 @@ module WorkOS
|
|
41
45
|
id: hash[:id],
|
42
46
|
name: hash[:name],
|
43
47
|
domains: hash[:domains],
|
48
|
+
created_at: hash[:created_at],
|
49
|
+
updated_at: hash[:updated_at],
|
44
50
|
)
|
45
51
|
end
|
46
52
|
end
|
data/lib/workos/version.rb
CHANGED
@@ -282,7 +282,7 @@ describe WorkOS::DirectorySync do
|
|
282
282
|
context 'with directory option' do
|
283
283
|
it 'forms the proper request to the API' do
|
284
284
|
request_args = [
|
285
|
-
'/directory_users?directory=
|
285
|
+
'/directory_users?directory=directory_01FAZYMST676QMTFN1DDJZZX87',
|
286
286
|
'Content-Type' => 'application/json'
|
287
287
|
]
|
288
288
|
|
@@ -293,10 +293,10 @@ describe WorkOS::DirectorySync do
|
|
293
293
|
|
294
294
|
VCR.use_cassette 'directory_sync/list_users/with_directory' do
|
295
295
|
users = described_class.list_users(
|
296
|
-
directory: '
|
296
|
+
directory: 'directory_01FAZYMST676QMTFN1DDJZZX87',
|
297
297
|
)
|
298
298
|
|
299
|
-
expect(users.data.size).to eq(
|
299
|
+
expect(users.data.size).to eq(4)
|
300
300
|
end
|
301
301
|
end
|
302
302
|
end
|
@@ -304,7 +304,7 @@ describe WorkOS::DirectorySync do
|
|
304
304
|
context 'with group option' do
|
305
305
|
it 'forms the proper request to the API' do
|
306
306
|
request_args = [
|
307
|
-
'/directory_users?group=
|
307
|
+
'/directory_users?group=directory_group_01FBXGP79EJAYKW0WS9JCK1V6E',
|
308
308
|
'Content-Type' => 'application/json'
|
309
309
|
]
|
310
310
|
|
@@ -315,10 +315,10 @@ describe WorkOS::DirectorySync do
|
|
315
315
|
|
316
316
|
VCR.use_cassette 'directory_sync/list_users/with_group' do
|
317
317
|
users = described_class.list_users(
|
318
|
-
group: '
|
318
|
+
group: 'directory_group_01FBXGP79EJAYKW0WS9JCK1V6E',
|
319
319
|
)
|
320
320
|
|
321
|
-
expect(users.data.size).to eq(
|
321
|
+
expect(users.data.size).to eq(1)
|
322
322
|
end
|
323
323
|
end
|
324
324
|
end
|
@@ -326,8 +326,8 @@ describe WorkOS::DirectorySync do
|
|
326
326
|
context 'with the before option' do
|
327
327
|
it 'forms the proper request to the API' do
|
328
328
|
request_args = [
|
329
|
-
'/directory_users?before=
|
330
|
-
'directory=
|
329
|
+
'/directory_users?before=directory_user_01FAZYNPC8TJBP7Y2ERT51MGDF&'\
|
330
|
+
'directory=directory_01FAZYMST676QMTFN1DDJZZX87',
|
331
331
|
'Content-Type' => 'application/json'
|
332
332
|
]
|
333
333
|
|
@@ -338,8 +338,8 @@ describe WorkOS::DirectorySync do
|
|
338
338
|
|
339
339
|
VCR.use_cassette 'directory_sync/list_users/with_before' do
|
340
340
|
users = described_class.list_users(
|
341
|
-
before: '
|
342
|
-
directory: '
|
341
|
+
before: 'directory_user_01FAZYNPC8TJBP7Y2ERT51MGDF',
|
342
|
+
directory: 'directory_01FAZYMST676QMTFN1DDJZZX87',
|
343
343
|
)
|
344
344
|
|
345
345
|
expect(users.data.size).to eq(2)
|
@@ -350,8 +350,8 @@ describe WorkOS::DirectorySync do
|
|
350
350
|
context 'with the after option' do
|
351
351
|
it 'forms the proper request to the API' do
|
352
352
|
request_args = [
|
353
|
-
'/directory_users?after=
|
354
|
-
'directory=
|
353
|
+
'/directory_users?after=directory_user_01FAZYNPC8TJBP7Y2ERT51MGDF&' \
|
354
|
+
'directory=directory_01FAZYMST676QMTFN1DDJZZX87',
|
355
355
|
'Content-Type' => 'application/json'
|
356
356
|
]
|
357
357
|
|
@@ -362,11 +362,11 @@ describe WorkOS::DirectorySync do
|
|
362
362
|
|
363
363
|
VCR.use_cassette 'directory_sync/list_users/with_after' do
|
364
364
|
users = described_class.list_users(
|
365
|
-
after: '
|
366
|
-
directory: '
|
365
|
+
after: 'directory_user_01FAZYNPC8TJBP7Y2ERT51MGDF',
|
366
|
+
directory: 'directory_01FAZYMST676QMTFN1DDJZZX87',
|
367
367
|
)
|
368
368
|
|
369
|
-
expect(users.data.size).to eq(
|
369
|
+
expect(users.data.size).to eq(1)
|
370
370
|
end
|
371
371
|
end
|
372
372
|
end
|
@@ -375,7 +375,7 @@ describe WorkOS::DirectorySync do
|
|
375
375
|
it 'forms the proper request to the API' do
|
376
376
|
request_args = [
|
377
377
|
'/directory_users?limit=2&' \
|
378
|
-
'directory=
|
378
|
+
'directory=directory_01FAZYMST676QMTFN1DDJZZX87',
|
379
379
|
'Content-Type' => 'application/json'
|
380
380
|
]
|
381
381
|
|
@@ -387,7 +387,7 @@ describe WorkOS::DirectorySync do
|
|
387
387
|
VCR.use_cassette 'directory_sync/list_users/with_limit' do
|
388
388
|
users = described_class.list_users(
|
389
389
|
limit: 2,
|
390
|
-
directory: '
|
390
|
+
directory: 'directory_01FAZYMST676QMTFN1DDJZZX87',
|
391
391
|
)
|
392
392
|
|
393
393
|
expect(users.data.size).to eq(2)
|
@@ -425,10 +425,10 @@ describe WorkOS::DirectorySync do
|
|
425
425
|
it 'returns a user' do
|
426
426
|
VCR.use_cassette('directory_sync/get_user') do
|
427
427
|
user = WorkOS::DirectorySync.get_user(
|
428
|
-
'
|
428
|
+
'directory_user_01FAZYNPC8M0HRYTKFP2GNX852',
|
429
429
|
)
|
430
430
|
|
431
|
-
expect(user['first_name']).to eq('
|
431
|
+
expect(user['first_name']).to eq('Logan')
|
432
432
|
end
|
433
433
|
end
|
434
434
|
end
|
@@ -7,13 +7,13 @@ describe WorkOS::Organizations do
|
|
7
7
|
it 'creates an organization' do
|
8
8
|
VCR.use_cassette 'organization/create' do
|
9
9
|
organization = described_class.create_organization(
|
10
|
-
domains: ['example.
|
10
|
+
domains: ['example.io'],
|
11
11
|
name: 'Test Organization',
|
12
12
|
)
|
13
13
|
|
14
|
-
expect(organization.id).to eq('
|
14
|
+
expect(organization.id).to eq('org_01FCPEJXEZR4DSBA625YMGQT9N')
|
15
15
|
expect(organization.name).to eq('Test Organization')
|
16
|
-
expect(organization.domains.first[:domain]).to eq('example.
|
16
|
+
expect(organization.domains.first[:domain]).to eq('example.io')
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -46,7 +46,7 @@ describe WorkOS::Organizations do
|
|
46
46
|
VCR.use_cassette 'organization/list' do
|
47
47
|
organizations = described_class.list_organizations
|
48
48
|
|
49
|
-
expect(organizations.data.size).to eq(
|
49
|
+
expect(organizations.data.size).to eq(6)
|
50
50
|
expect(organizations.list_metadata).to eq(expected_metadata)
|
51
51
|
end
|
52
52
|
end
|
@@ -69,7 +69,7 @@ describe WorkOS::Organizations do
|
|
69
69
|
before: 'before-id',
|
70
70
|
)
|
71
71
|
|
72
|
-
expect(organizations.data.size).to eq(
|
72
|
+
expect(organizations.data.size).to eq(6)
|
73
73
|
end
|
74
74
|
end
|
75
75
|
end
|
@@ -89,7 +89,7 @@ describe WorkOS::Organizations do
|
|
89
89
|
VCR.use_cassette 'organization/list', match_requests_on: [:path] do
|
90
90
|
organizations = described_class.list_organizations(after: 'after-id')
|
91
91
|
|
92
|
-
expect(organizations.data.size).to eq(
|
92
|
+
expect(organizations.data.size).to eq(6)
|
93
93
|
end
|
94
94
|
end
|
95
95
|
end
|
@@ -109,7 +109,7 @@ describe WorkOS::Organizations do
|
|
109
109
|
VCR.use_cassette 'organization/list', match_requests_on: [:path] do
|
110
110
|
organizations = described_class.list_organizations(limit: 10)
|
111
111
|
|
112
|
-
expect(organizations.data.size).to eq(
|
112
|
+
expect(organizations.data.size).to eq(6)
|
113
113
|
end
|
114
114
|
end
|
115
115
|
end
|
@@ -120,10 +120,10 @@ describe WorkOS::Organizations do
|
|
120
120
|
it 'gets the organization details' do
|
121
121
|
VCR.use_cassette('organization/get') do
|
122
122
|
organization = described_class.get_organization(
|
123
|
-
id: '
|
123
|
+
id: 'org_01F9293WD2PDEEV4Y625XPZVG7',
|
124
124
|
)
|
125
125
|
|
126
|
-
expect(organization.id).to eq('
|
126
|
+
expect(organization.id).to eq('org_01F9293WD2PDEEV4Y625XPZVG7')
|
127
127
|
expect(organization.name).to eq('Foo Corp')
|
128
128
|
expect(organization.domains.first[:domain]).to eq('foo-corp.com')
|
129
129
|
end
|
@@ -149,12 +149,12 @@ describe WorkOS::Organizations do
|
|
149
149
|
it 'creates an organization' do
|
150
150
|
VCR.use_cassette 'organization/update' do
|
151
151
|
organization = described_class.update_organization(
|
152
|
-
organization: '
|
152
|
+
organization: 'org_01F6Q6TFP7RD2PF6J03ANNWDKV',
|
153
153
|
domains: ['example.me'],
|
154
154
|
name: 'Test Organization',
|
155
155
|
)
|
156
156
|
|
157
|
-
expect(organization.id).to eq('
|
157
|
+
expect(organization.id).to eq('org_01F6Q6TFP7RD2PF6J03ANNWDKV')
|
158
158
|
expect(organization.name).to eq('Test Organization')
|
159
159
|
expect(organization.domains.first[:domain]).to eq('example.me')
|
160
160
|
end
|
data/spec/lib/workos/sso_spec.rb
CHANGED
@@ -303,7 +303,7 @@ describe WorkOS::SSO do
|
|
303
303
|
VCR.use_cassette 'sso/list_connections/with_no_options' do
|
304
304
|
connections = described_class.list_connections
|
305
305
|
|
306
|
-
expect(connections.data.size).to eq(
|
306
|
+
expect(connections.data.size).to eq(6)
|
307
307
|
expect(connections.list_metadata).to eq(expected_metadata)
|
308
308
|
end
|
309
309
|
end
|
@@ -326,7 +326,7 @@ describe WorkOS::SSO do
|
|
326
326
|
connection_type: 'OktaSAML',
|
327
327
|
)
|
328
328
|
|
329
|
-
expect(connections.data.size).to eq(
|
329
|
+
expect(connections.data.size).to eq(10)
|
330
330
|
expect(connections.data.first.connection_type).to eq('OktaSAML')
|
331
331
|
end
|
332
332
|
end
|
@@ -357,7 +357,7 @@ describe WorkOS::SSO do
|
|
357
357
|
context 'with organization_id option' do
|
358
358
|
it 'forms the proper request to the API' do
|
359
359
|
request_args = [
|
360
|
-
'/connections?organization_id=
|
360
|
+
'/connections?organization_id=org_01F9293WD2PDEEV4Y625XPZVG7',
|
361
361
|
'Content-Type' => 'application/json'
|
362
362
|
]
|
363
363
|
|
@@ -368,12 +368,12 @@ describe WorkOS::SSO do
|
|
368
368
|
|
369
369
|
VCR.use_cassette 'sso/list_connections/with_organization_id' do
|
370
370
|
connections = described_class.list_connections(
|
371
|
-
organization_id: '
|
371
|
+
organization_id: 'org_01F9293WD2PDEEV4Y625XPZVG7',
|
372
372
|
)
|
373
373
|
|
374
374
|
expect(connections.data.size).to eq(1)
|
375
375
|
expect(connections.data.first.organization_id).to eq(
|
376
|
-
'
|
376
|
+
'org_01F9293WD2PDEEV4Y625XPZVG7',
|
377
377
|
)
|
378
378
|
end
|
379
379
|
end
|
@@ -404,7 +404,7 @@ describe WorkOS::SSO do
|
|
404
404
|
context 'with before option' do
|
405
405
|
it 'forms the proper request to the API' do
|
406
406
|
request_args = [
|
407
|
-
'/connections?before=
|
407
|
+
'/connections?before=conn_01FA3WGCWPCCY1V2FGES2FDNP7',
|
408
408
|
'Content-Type' => 'application/json'
|
409
409
|
]
|
410
410
|
|
@@ -415,7 +415,7 @@ describe WorkOS::SSO do
|
|
415
415
|
|
416
416
|
VCR.use_cassette 'sso/list_connections/with_before' do
|
417
417
|
connections = described_class.list_connections(
|
418
|
-
before: '
|
418
|
+
before: 'conn_01FA3WGCWPCCY1V2FGES2FDNP7',
|
419
419
|
)
|
420
420
|
|
421
421
|
expect(connections.data.size).to eq(3)
|
@@ -426,7 +426,7 @@ describe WorkOS::SSO do
|
|
426
426
|
context 'with after option' do
|
427
427
|
it 'forms the proper request to the API' do
|
428
428
|
request_args = [
|
429
|
-
'/connections?after=
|
429
|
+
'/connections?after=conn_01FA3WGCWPCCY1V2FGES2FDNP7',
|
430
430
|
'Content-Type' => 'application/json'
|
431
431
|
]
|
432
432
|
|
@@ -437,10 +437,10 @@ describe WorkOS::SSO do
|
|
437
437
|
|
438
438
|
VCR.use_cassette 'sso/list_connections/with_after' do
|
439
439
|
connections = described_class.list_connections(
|
440
|
-
after: '
|
440
|
+
after: 'conn_01FA3WGCWPCCY1V2FGES2FDNP7',
|
441
441
|
)
|
442
442
|
|
443
|
-
expect(connections.data.size).to eq(
|
443
|
+
expect(connections.data.size).to eq(2)
|
444
444
|
end
|
445
445
|
end
|
446
446
|
end
|
@@ -451,10 +451,10 @@ describe WorkOS::SSO do
|
|
451
451
|
it 'gets the connection details' do
|
452
452
|
VCR.use_cassette('sso/get_connection_with_valid_id') do
|
453
453
|
connection = WorkOS::SSO.get_connection(
|
454
|
-
id: '
|
454
|
+
id: 'conn_01FA3WGCWPCCY1V2FGES2FDNP7',
|
455
455
|
)
|
456
456
|
|
457
|
-
expect(connection.id).to eq('
|
457
|
+
expect(connection.id).to eq('conn_01FA3WGCWPCCY1V2FGES2FDNP7')
|
458
458
|
expect(connection.connection_type).to eq('OktaSAML')
|
459
459
|
expect(connection.name).to eq('Foo Corp')
|
460
460
|
expect(connection.domains.first[:domain]).to eq('foo-corp.com')
|