workos 3.1.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.semaphore/semaphore.yml +1 -1
- data/Gemfile.lock +1 -1
- data/lib/workos/directory_sync.rb +3 -0
- data/lib/workos/organization_membership.rb +4 -1
- data/lib/workos/organizations.rb +1 -0
- data/lib/workos/sso.rb +1 -0
- data/lib/workos/types/organization_membership_struct.rb +2 -1
- data/lib/workos/user_management.rb +3 -0
- data/lib/workos/version.rb +1 -1
- data/spec/lib/workos/directory_sync_spec.rb +30 -15
- data/spec/lib/workos/organizations_spec.rb +6 -3
- data/spec/lib/workos/sso_spec.rb +12 -6
- data/spec/lib/workos/user_management_spec.rb +13 -6
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_after.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_before.yml +1 -1
- 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 +1 -1
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_no_options.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_search.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_after.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_before.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_directory.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_limit.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_no_options.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_user.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_after.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_before.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_directory.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_group.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_limit.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_no_options.yml +72 -71
- data/spec/support/fixtures/vcr_cassettes/organization/list.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_after.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_before.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_connection_type.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_domain.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_limit.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_no_options.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_organization_id.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/valid.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/user_management/get_organization_membership.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_after.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_before.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_limit.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_no_options.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_organization_id.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/user_management/list_organization_memberships/no_options.yml +2 -2
- data/spec/support/fixtures/vcr_cassettes/user_management/list_organization_memberships/with_options.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/user_management/list_users/no_options.yml +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 301b7f9d339c1ec1bf85dfc43a4d1ba85de8b6234323c8982fa2f2cf76bed6dd
|
4
|
+
data.tar.gz: 91ed96c899e42ccaed1955304fd98a7da7ca7e946be803df4e7c27f4cb3db5fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b96feaf7d73165f33b979f3cd396adcf91aa4457161647b57423bf204bd89de42e6badeba37f06faf562bd58f5148fe9bd329850721c1efe5f0d0d18e0459bf6
|
7
|
+
data.tar.gz: 9417023f79e961c063fcb17c4ca60035e292fe2c321710778d99610165bea2b5c564e7dfad24a7b2effdb51b0d5355fe0c4155de45c7ef5d0d073ddfbbb1f1c6
|
data/.semaphore/semaphore.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -35,6 +35,7 @@ module WorkOS
|
|
35
35
|
).returns(WorkOS::Types::ListStruct)
|
36
36
|
end
|
37
37
|
def list_directories(options = {})
|
38
|
+
options[:order] ||= 'desc'
|
38
39
|
response = execute_request(
|
39
40
|
request: get_request(
|
40
41
|
path: '/directories',
|
@@ -104,6 +105,7 @@ module WorkOS
|
|
104
105
|
).returns(WorkOS::Types::ListStruct)
|
105
106
|
end
|
106
107
|
def list_groups(options = {})
|
108
|
+
options[:order] ||= 'desc'
|
107
109
|
response = execute_request(
|
108
110
|
request: get_request(
|
109
111
|
path: '/directory_groups',
|
@@ -144,6 +146,7 @@ module WorkOS
|
|
144
146
|
).returns(WorkOS::Types::ListStruct)
|
145
147
|
end
|
146
148
|
def list_users(options = {})
|
149
|
+
options[:order] ||= 'desc'
|
147
150
|
response = execute_request(
|
148
151
|
request: get_request(
|
149
152
|
path: '/directory_users',
|
@@ -9,7 +9,7 @@ module WorkOS
|
|
9
9
|
include HashProvider
|
10
10
|
extend T::Sig
|
11
11
|
|
12
|
-
attr_accessor :id, :user_id, :organization_id, :created_at, :updated_at
|
12
|
+
attr_accessor :id, :user_id, :organization_id, :status, :created_at, :updated_at
|
13
13
|
|
14
14
|
sig { params(json: String).void }
|
15
15
|
def initialize(json)
|
@@ -18,6 +18,7 @@ module WorkOS
|
|
18
18
|
@id = T.let(raw.id, String)
|
19
19
|
@user_id = T.let(raw.user_id, String)
|
20
20
|
@organization_id = raw.organization_id
|
21
|
+
@status = T.let(raw.status, String)
|
21
22
|
@created_at = T.let(raw.created_at, String)
|
22
23
|
@updated_at = T.let(raw.updated_at, String)
|
23
24
|
end
|
@@ -27,6 +28,7 @@ module WorkOS
|
|
27
28
|
id: id,
|
28
29
|
user_id: user_id,
|
29
30
|
organization_id: organization_id,
|
31
|
+
status: status,
|
30
32
|
created_at: created_at,
|
31
33
|
updated_at: updated_at,
|
32
34
|
}
|
@@ -42,6 +44,7 @@ module WorkOS
|
|
42
44
|
id: hash[:id],
|
43
45
|
user_id: hash[:user_id],
|
44
46
|
organization_id: hash[:organization_id],
|
47
|
+
status: hash[:status],
|
45
48
|
created_at: hash[:created_at],
|
46
49
|
updated_at: hash[:updated_at],
|
47
50
|
)
|
data/lib/workos/organizations.rb
CHANGED
data/lib/workos/sso.rb
CHANGED
@@ -7,7 +7,8 @@ module WorkOS
|
|
7
7
|
class OrganizationMembershipStruct < T::Struct
|
8
8
|
const :id, String
|
9
9
|
const :user_id, String
|
10
|
-
const :organization_id, String
|
10
|
+
const :organization_id, T.nilable(String)
|
11
|
+
const :status, String
|
11
12
|
const :created_at, String
|
12
13
|
const :updated_at, String
|
13
14
|
end
|
@@ -157,6 +157,7 @@ module WorkOS
|
|
157
157
|
).returns(WorkOS::Types::ListStruct)
|
158
158
|
end
|
159
159
|
def list_users(options = {})
|
160
|
+
options[:order] ||= 'desc'
|
160
161
|
response = execute_request(
|
161
162
|
request: get_request(
|
162
163
|
path: '/user_management/users',
|
@@ -783,6 +784,7 @@ module WorkOS
|
|
783
784
|
).returns(WorkOS::Types::ListStruct)
|
784
785
|
end
|
785
786
|
def list_organization_memberships(options = {})
|
787
|
+
options[:order] ||= 'desc'
|
786
788
|
response = execute_request(
|
787
789
|
request: get_request(
|
788
790
|
path: '/user_management/organization_memberships',
|
@@ -889,6 +891,7 @@ module WorkOS
|
|
889
891
|
).returns(WorkOS::Types::ListStruct)
|
890
892
|
end
|
891
893
|
def list_invitations(options = {})
|
894
|
+
options[:order] ||= 'desc'
|
892
895
|
response = execute_request(
|
893
896
|
request: get_request(
|
894
897
|
path: '/user_management/invitations',
|
data/lib/workos/version.rb
CHANGED
@@ -24,7 +24,8 @@ describe WorkOS::DirectorySync do
|
|
24
24
|
context 'with domain option' do
|
25
25
|
it 'forms the proper request to the API' do
|
26
26
|
request_args = [
|
27
|
-
'/directories?domain=foo-corp.com'
|
27
|
+
'/directories?domain=foo-corp.com&'\
|
28
|
+
'order=desc',
|
28
29
|
'Content-Type' => 'application/json'
|
29
30
|
]
|
30
31
|
|
@@ -46,7 +47,8 @@ describe WorkOS::DirectorySync do
|
|
46
47
|
context 'with search option' do
|
47
48
|
it 'forms the proper request to the API' do
|
48
49
|
request_args = [
|
49
|
-
'/directories?search=Testing'
|
50
|
+
'/directories?search=Testing&'\
|
51
|
+
'order=desc',
|
50
52
|
'Content-Type' => 'application/json'
|
51
53
|
]
|
52
54
|
|
@@ -69,7 +71,8 @@ describe WorkOS::DirectorySync do
|
|
69
71
|
context 'with the before option' do
|
70
72
|
it 'forms the proper request to the API' do
|
71
73
|
request_args = [
|
72
|
-
'/directories?before=directory_01FGCPNV312FHFRCX0BYWHVSE1'
|
74
|
+
'/directories?before=directory_01FGCPNV312FHFRCX0BYWHVSE1&'\
|
75
|
+
'order=desc',
|
73
76
|
'Content-Type' => 'application/json'
|
74
77
|
]
|
75
78
|
|
@@ -91,7 +94,8 @@ describe WorkOS::DirectorySync do
|
|
91
94
|
context 'with the after option' do
|
92
95
|
it 'forms the proper request to the API' do
|
93
96
|
request_args = [
|
94
|
-
'/directories?after=directory_01FGCPNV312FHFRCX0BYWHVSE1'
|
97
|
+
'/directories?after=directory_01FGCPNV312FHFRCX0BYWHVSE1&'\
|
98
|
+
'order=desc',
|
95
99
|
'Content-Type' => 'application/json'
|
96
100
|
]
|
97
101
|
|
@@ -111,7 +115,8 @@ describe WorkOS::DirectorySync do
|
|
111
115
|
context 'with the limit option' do
|
112
116
|
it 'forms the proper request to the API' do
|
113
117
|
request_args = [
|
114
|
-
'/directories?limit=2'
|
118
|
+
'/directories?limit=2&'\
|
119
|
+
'order=desc',
|
115
120
|
'Content-Type' => 'application/json'
|
116
121
|
]
|
117
122
|
|
@@ -189,7 +194,8 @@ describe WorkOS::DirectorySync do
|
|
189
194
|
context 'with directory option' do
|
190
195
|
it 'forms the proper request to the API' do
|
191
196
|
request_args = [
|
192
|
-
'/directory_groups?directory=directory_01G2Z8ADK5NPMVTWF48MVVE4HT'
|
197
|
+
'/directory_groups?directory=directory_01G2Z8ADK5NPMVTWF48MVVE4HT&'\
|
198
|
+
'order=desc',
|
193
199
|
'Content-Type' => 'application/json'
|
194
200
|
]
|
195
201
|
|
@@ -212,7 +218,8 @@ describe WorkOS::DirectorySync do
|
|
212
218
|
context 'with user option' do
|
213
219
|
it 'forms the proper request to the API' do
|
214
220
|
request_args = [
|
215
|
-
'/directory_groups?user=directory_user_01G2Z8D4FDB28ZNSRRBVCF2E0P'
|
221
|
+
'/directory_groups?user=directory_user_01G2Z8D4FDB28ZNSRRBVCF2E0P&'\
|
222
|
+
'order=desc',
|
216
223
|
'Content-Type' => 'application/json'
|
217
224
|
]
|
218
225
|
|
@@ -235,7 +242,8 @@ describe WorkOS::DirectorySync do
|
|
235
242
|
it 'forms the proper request to the API' do
|
236
243
|
request_args = [
|
237
244
|
'/directory_groups?before=directory_group_01G2Z8D4ZR8RJ03Y1W7P9K8NMG&' \
|
238
|
-
'directory=directory_01G2Z8ADK5NPMVTWF48MVVE4HT'
|
245
|
+
'directory=directory_01G2Z8ADK5NPMVTWF48MVVE4HT&'\
|
246
|
+
'order=desc',
|
239
247
|
'Content-Type' => 'application/json'
|
240
248
|
]
|
241
249
|
|
@@ -259,7 +267,8 @@ describe WorkOS::DirectorySync do
|
|
259
267
|
it 'forms the proper request to the API' do
|
260
268
|
request_args = [
|
261
269
|
'/directory_groups?after=directory_group_01G2Z8D4ZR8RJ03Y1W7P9K8NMG&' \
|
262
|
-
'directory=directory_01G2Z8ADK5NPMVTWF48MVVE4HT'
|
270
|
+
'directory=directory_01G2Z8ADK5NPMVTWF48MVVE4HT&'\
|
271
|
+
'order=desc',
|
263
272
|
'Content-Type' => 'application/json'
|
264
273
|
]
|
265
274
|
|
@@ -283,7 +292,8 @@ describe WorkOS::DirectorySync do
|
|
283
292
|
it 'forms the proper request to the API' do
|
284
293
|
request_args = [
|
285
294
|
'/directory_groups?limit=2&' \
|
286
|
-
'directory=directory_01G2Z8ADK5NPMVTWF48MVVE4HT'
|
295
|
+
'directory=directory_01G2Z8ADK5NPMVTWF48MVVE4HT&'\
|
296
|
+
'order=desc',
|
287
297
|
'Content-Type' => 'application/json'
|
288
298
|
]
|
289
299
|
|
@@ -318,7 +328,8 @@ describe WorkOS::DirectorySync do
|
|
318
328
|
context 'with directory option' do
|
319
329
|
it 'forms the proper request to the API' do
|
320
330
|
request_args = [
|
321
|
-
'/directory_users?directory=directory_01FAZYMST676QMTFN1DDJZZX87'
|
331
|
+
'/directory_users?directory=directory_01FAZYMST676QMTFN1DDJZZX87&'\
|
332
|
+
'order=desc',
|
322
333
|
'Content-Type' => 'application/json'
|
323
334
|
]
|
324
335
|
|
@@ -341,7 +352,8 @@ describe WorkOS::DirectorySync do
|
|
341
352
|
context 'with group option' do
|
342
353
|
it 'forms the proper request to the API' do
|
343
354
|
request_args = [
|
344
|
-
'/directory_users?group=directory_group_01FBXGP79EJAYKW0WS9JCK1V6E'
|
355
|
+
'/directory_users?group=directory_group_01FBXGP79EJAYKW0WS9JCK1V6E&'\
|
356
|
+
'order=desc',
|
345
357
|
'Content-Type' => 'application/json'
|
346
358
|
]
|
347
359
|
|
@@ -364,7 +376,8 @@ describe WorkOS::DirectorySync do
|
|
364
376
|
it 'forms the proper request to the API' do
|
365
377
|
request_args = [
|
366
378
|
'/directory_users?before=directory_user_01FAZYNPC8TJBP7Y2ERT51MGDF&'\
|
367
|
-
'directory=directory_01FAZYMST676QMTFN1DDJZZX87'
|
379
|
+
'directory=directory_01FAZYMST676QMTFN1DDJZZX87&'\
|
380
|
+
'order=desc',
|
368
381
|
'Content-Type' => 'application/json'
|
369
382
|
]
|
370
383
|
|
@@ -388,7 +401,8 @@ describe WorkOS::DirectorySync do
|
|
388
401
|
it 'forms the proper request to the API' do
|
389
402
|
request_args = [
|
390
403
|
'/directory_users?after=directory_user_01FAZYNPC8TJBP7Y2ERT51MGDF&' \
|
391
|
-
'directory=directory_01FAZYMST676QMTFN1DDJZZX87'
|
404
|
+
'directory=directory_01FAZYMST676QMTFN1DDJZZX87&'\
|
405
|
+
'order=desc',
|
392
406
|
'Content-Type' => 'application/json'
|
393
407
|
]
|
394
408
|
|
@@ -412,7 +426,8 @@ describe WorkOS::DirectorySync do
|
|
412
426
|
it 'forms the proper request to the API' do
|
413
427
|
request_args = [
|
414
428
|
'/directory_users?limit=2&' \
|
415
|
-
'directory=directory_01FAZYMST676QMTFN1DDJZZX87'
|
429
|
+
'directory=directory_01FAZYMST676QMTFN1DDJZZX87&'\
|
430
|
+
'order=desc',
|
416
431
|
'Content-Type' => 'application/json'
|
417
432
|
]
|
418
433
|
|
@@ -121,7 +121,8 @@ describe WorkOS::Organizations do
|
|
121
121
|
context 'with the before option' do
|
122
122
|
it 'forms the proper request to the API' do
|
123
123
|
request_args = [
|
124
|
-
'/organizations?before=before-id'
|
124
|
+
'/organizations?before=before-id&'\
|
125
|
+
'order=desc',
|
125
126
|
'Content-Type' => 'application/json'
|
126
127
|
]
|
127
128
|
|
@@ -143,7 +144,8 @@ describe WorkOS::Organizations do
|
|
143
144
|
context 'with the after option' do
|
144
145
|
it 'forms the proper request to the API' do
|
145
146
|
request_args = [
|
146
|
-
'/organizations?after=after-id'
|
147
|
+
'/organizations?after=after-id&'\
|
148
|
+
'order=desc',
|
147
149
|
'Content-Type' => 'application/json'
|
148
150
|
]
|
149
151
|
|
@@ -163,7 +165,8 @@ describe WorkOS::Organizations do
|
|
163
165
|
context 'with the limit option' do
|
164
166
|
it 'forms the proper request to the API' do
|
165
167
|
request_args = [
|
166
|
-
'/organizations?limit=10'
|
168
|
+
'/organizations?limit=10&'\
|
169
|
+
'order=desc',
|
167
170
|
'Content-Type' => 'application/json'
|
168
171
|
]
|
169
172
|
|
data/spec/lib/workos/sso_spec.rb
CHANGED
@@ -457,7 +457,8 @@ describe WorkOS::SSO do
|
|
457
457
|
context 'with connection_type option' do
|
458
458
|
it 'forms the proper request to the API' do
|
459
459
|
request_args = [
|
460
|
-
'/connections?connection_type=OktaSAML'
|
460
|
+
'/connections?connection_type=OktaSAML&'\
|
461
|
+
'order=desc',
|
461
462
|
'Content-Type' => 'application/json'
|
462
463
|
]
|
463
464
|
|
@@ -480,7 +481,8 @@ describe WorkOS::SSO do
|
|
480
481
|
context 'with domain option' do
|
481
482
|
it 'forms the proper request to the API' do
|
482
483
|
request_args = [
|
483
|
-
'/connections?domain=foo-corp.com'
|
484
|
+
'/connections?domain=foo-corp.com&'\
|
485
|
+
'order=desc',
|
484
486
|
'Content-Type' => 'application/json'
|
485
487
|
]
|
486
488
|
|
@@ -502,7 +504,8 @@ describe WorkOS::SSO do
|
|
502
504
|
context 'with organization_id option' do
|
503
505
|
it 'forms the proper request to the API' do
|
504
506
|
request_args = [
|
505
|
-
'/connections?organization_id=org_01F9293WD2PDEEV4Y625XPZVG7'
|
507
|
+
'/connections?organization_id=org_01F9293WD2PDEEV4Y625XPZVG7&'\
|
508
|
+
'order=desc',
|
506
509
|
'Content-Type' => 'application/json'
|
507
510
|
]
|
508
511
|
|
@@ -527,7 +530,8 @@ describe WorkOS::SSO do
|
|
527
530
|
context 'with limit option' do
|
528
531
|
it 'forms the proper request to the API' do
|
529
532
|
request_args = [
|
530
|
-
'/connections?limit=2'
|
533
|
+
'/connections?limit=2&'\
|
534
|
+
'order=desc',
|
531
535
|
'Content-Type' => 'application/json'
|
532
536
|
]
|
533
537
|
|
@@ -549,7 +553,8 @@ describe WorkOS::SSO do
|
|
549
553
|
context 'with before option' do
|
550
554
|
it 'forms the proper request to the API' do
|
551
555
|
request_args = [
|
552
|
-
'/connections?before=conn_01FA3WGCWPCCY1V2FGES2FDNP7'
|
556
|
+
'/connections?before=conn_01FA3WGCWPCCY1V2FGES2FDNP7&'\
|
557
|
+
'order=desc',
|
553
558
|
'Content-Type' => 'application/json'
|
554
559
|
]
|
555
560
|
|
@@ -571,7 +576,8 @@ describe WorkOS::SSO do
|
|
571
576
|
context 'with after option' do
|
572
577
|
it 'forms the proper request to the API' do
|
573
578
|
request_args = [
|
574
|
-
'/connections?after=conn_01FA3WGCWPCCY1V2FGES2FDNP7'
|
579
|
+
'/connections?after=conn_01FA3WGCWPCCY1V2FGES2FDNP7&'\
|
580
|
+
'order=desc',
|
575
581
|
'Content-Type' => 'application/json'
|
576
582
|
]
|
577
583
|
|
@@ -265,7 +265,9 @@ describe WorkOS::UserManagement do
|
|
265
265
|
context 'with options' do
|
266
266
|
it 'returns a list of matching users' do
|
267
267
|
request_args = [
|
268
|
-
'/user_management/users?email=lucy.lawless%40example.com&
|
268
|
+
'/user_management/users?email=lucy.lawless%40example.com&'\
|
269
|
+
'order=desc&'\
|
270
|
+
'limit=5',
|
269
271
|
'Content-Type' => 'application/json'
|
270
272
|
]
|
271
273
|
|
@@ -820,7 +822,8 @@ describe WorkOS::UserManagement do
|
|
820
822
|
context 'with options' do
|
821
823
|
it 'returns a list of matching users' do
|
822
824
|
request_args = [
|
823
|
-
'/user_management/organization_memberships?user_id=user_01H5JQDV7R7ATEYZDEG0W5PRYS&
|
825
|
+
'/user_management/organization_memberships?user_id=user_01H5JQDV7R7ATEYZDEG0W5PRYS&'\
|
826
|
+
'order=desc&limit=5',
|
824
827
|
'Content-Type' => 'application/json'
|
825
828
|
]
|
826
829
|
|
@@ -941,7 +944,8 @@ describe WorkOS::UserManagement do
|
|
941
944
|
context 'with organization_id option' do
|
942
945
|
it 'forms the proper request to the API' do
|
943
946
|
request_args = [
|
944
|
-
'/user_management/invitations?organization_id=org_01H5JQDV7R7ATEYZDEG0W5PRYS'
|
947
|
+
'/user_management/invitations?organization_id=org_01H5JQDV7R7ATEYZDEG0W5PRYS&'\
|
948
|
+
'order=desc',
|
945
949
|
'Content-Type' => 'application/json'
|
946
950
|
]
|
947
951
|
|
@@ -966,7 +970,8 @@ describe WorkOS::UserManagement do
|
|
966
970
|
context 'with limit option' do
|
967
971
|
it 'forms the proper request to the API' do
|
968
972
|
request_args = [
|
969
|
-
'/user_management/invitations?limit=2'
|
973
|
+
'/user_management/invitations?limit=2&'\
|
974
|
+
'order=desc',
|
970
975
|
'Content-Type' => 'application/json'
|
971
976
|
]
|
972
977
|
|
@@ -988,7 +993,8 @@ describe WorkOS::UserManagement do
|
|
988
993
|
context 'with before option' do
|
989
994
|
it 'forms the proper request to the API' do
|
990
995
|
request_args = [
|
991
|
-
'/user_management/invitations?before=invitation_01H5JQDV7R7ATEYZDEG0W5PRYS'
|
996
|
+
'/user_management/invitations?before=invitation_01H5JQDV7R7ATEYZDEG0W5PRYS&'\
|
997
|
+
'order=desc',
|
992
998
|
'Content-Type' => 'application/json'
|
993
999
|
]
|
994
1000
|
|
@@ -1010,7 +1016,8 @@ describe WorkOS::UserManagement do
|
|
1010
1016
|
context 'with after option' do
|
1011
1017
|
it 'forms the proper request to the API' do
|
1012
1018
|
request_args = [
|
1013
|
-
'/user_management/invitations?after=invitation_01H5JQDV7R7ATEYZDEG0W5PRYS'
|
1019
|
+
'/user_management/invitations?after=invitation_01H5JQDV7R7ATEYZDEG0W5PRYS&'\
|
1020
|
+
'order=desc',
|
1014
1021
|
'Content-Type' => 'application/json'
|
1015
1022
|
]
|
1016
1023
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://api.workos.com/directories?after=directory_01FGCPNV312FHFRCX0BYWHVSE1
|
5
|
+
uri: https://api.workos.com/directories?after=directory_01FGCPNV312FHFRCX0BYWHVSE1&order=desc
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://api.workos.com/directories?before=directory_01FGCPNV312FHFRCX0BYWHVSE1
|
5
|
+
uri: https://api.workos.com/directories?before=directory_01FGCPNV312FHFRCX0BYWHVSE1&order=desc
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://api.workos.com/directory_groups?after=directory_group_01G2Z8D4ZR8RJ03Y1W7P9K8NMG&directory=directory_01G2Z8ADK5NPMVTWF48MVVE4HT
|
5
|
+
uri: https://api.workos.com/directory_groups?after=directory_group_01G2Z8D4ZR8RJ03Y1W7P9K8NMG&directory=directory_01G2Z8ADK5NPMVTWF48MVVE4HT&order=desc
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://api.workos.com/directory_groups?before=directory_group_01G2Z8D4ZR8RJ03Y1W7P9K8NMG&directory=directory_01G2Z8ADK5NPMVTWF48MVVE4HT
|
5
|
+
uri: https://api.workos.com/directory_groups?before=directory_group_01G2Z8D4ZR8RJ03Y1W7P9K8NMG&directory=directory_01G2Z8ADK5NPMVTWF48MVVE4HT&order=desc
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://api.workos.com/directory_groups?directory=directory_01G2Z8ADK5NPMVTWF48MVVE4HT
|
5
|
+
uri: https://api.workos.com/directory_groups?directory=directory_01G2Z8ADK5NPMVTWF48MVVE4HT&order=desc
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://api.workos.com/directory_groups?directory=directory_01G2Z8ADK5NPMVTWF48MVVE4HT&limit=2
|
5
|
+
uri: https://api.workos.com/directory_groups?directory=directory_01G2Z8ADK5NPMVTWF48MVVE4HT&limit=2&order=desc
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://api.workos.com/directory_groups?user=directory_user_01G2Z8D4FDB28ZNSRRBVCF2E0P
|
5
|
+
uri: https://api.workos.com/directory_groups?order=desc&user=directory_user_01G2Z8D4FDB28ZNSRRBVCF2E0P
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://api.workos.com/directory_users?after=directory_user_01FAZYNPC8TJBP7Y2ERT51MGDF&directory=directory_01FAZYMST676QMTFN1DDJZZX87
|
5
|
+
uri: https://api.workos.com/directory_users?after=directory_user_01FAZYNPC8TJBP7Y2ERT51MGDF&directory=directory_01FAZYMST676QMTFN1DDJZZX87&order=desc
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://api.workos.com/directory_users?before=directory_user_01FAZYNPC8TJBP7Y2ERT51MGDF&directory=directory_01FAZYMST676QMTFN1DDJZZX87
|
5
|
+
uri: https://api.workos.com/directory_users?before=directory_user_01FAZYNPC8TJBP7Y2ERT51MGDF&directory=directory_01FAZYMST676QMTFN1DDJZZX87&order=desc
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://api.workos.com/directory_users?directory=directory_01FAZYMST676QMTFN1DDJZZX87
|
5
|
+
uri: https://api.workos.com/directory_users?directory=directory_01FAZYMST676QMTFN1DDJZZX87&order=desc
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://api.workos.com/directory_users?group=directory_group_01FBXGP79EJAYKW0WS9JCK1V6E
|
5
|
+
uri: https://api.workos.com/directory_users?group=directory_group_01FBXGP79EJAYKW0WS9JCK1V6E&order=desc
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://api.workos.com/directory_users?directory=directory_01FAZYMST676QMTFN1DDJZZX87&limit=2
|
5
|
+
uri: https://api.workos.com/directory_users?directory=directory_01FAZYMST676QMTFN1DDJZZX87&limit=2&order=desc
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -1,74 +1,75 @@
|
|
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
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.workos.com/directory_users?order=desc
|
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/2.7.1; x86_64-darwin19; v0.10.3
|
18
|
+
Authorization:
|
19
|
+
- Bearer <API_KEY>
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 422
|
23
|
+
message: Unprocessable Entity
|
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
|
+
- 7ec78e21-576f-44a4-895f-bd911a3f4b04
|
57
|
+
Content-Type:
|
58
|
+
- application/json; charset=utf-8
|
59
|
+
Content-Length:
|
60
|
+
- "222"
|
61
|
+
Etag:
|
62
|
+
- W/"de-33B+CY27z2HlOGKZPu4nzUVQpuI"
|
63
|
+
Date:
|
64
|
+
- Thu, 22 Apr 2021 21:58:34 GMT
|
65
|
+
Via:
|
66
|
+
- 1.1 vegur
|
67
|
+
body:
|
68
|
+
encoding: UTF-8
|
69
|
+
string:
|
70
|
+
'{"message":"Validation failed","errors":[{"field":"directory","code":"Please
|
71
|
+
provide either \"directory\" or \"group\" parameters."},{"field":"group","code":"Please
|
72
|
+
provide either \"directory\" or \"group\" parameters."}]}'
|
73
|
+
http_version:
|
74
|
+
recorded_at: Thu, 22 Apr 2021 21:58:34 GMT
|
74
75
|
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/connections?organization_id=org_01F9293WD2PDEEV4Y625XPZVG7
|
5
|
+
uri: https://api.workos.com/connections?order=desc&organization_id=org_01F9293WD2PDEEV4Y625XPZVG7
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
data/spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/valid.yml
CHANGED
@@ -76,7 +76,7 @@ http_interactions:
|
|
76
76
|
- cloudflare
|
77
77
|
body:
|
78
78
|
encoding: UTF-8
|
79
|
-
string: '{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}'
|
79
|
+
string: '{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status":"active","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}'
|
80
80
|
http_version:
|
81
81
|
recorded_at: Thu, 17 Aug 2023 14:20:07 GMT
|
82
82
|
recorded_with: VCR 5.0.0
|
@@ -76,7 +76,7 @@ http_interactions:
|
|
76
76
|
- cloudflare
|
77
77
|
body:
|
78
78
|
encoding: ASCII-8BIT
|
79
|
-
string: '{"object": "organization_membership", "id": "om_01H5JQDV7R7ATEYZDEG0W5PRYS", "user_id": "user_01H5JQDV7R7ATEYZDEG0W5PRYS", "organization_id": "organization_01H5JQDV7R7ATEYZDEG0W5PRYS", "created_at": "2023-07-18T02:07:19.911Z", "updated_at": "2023-07-18T02:07:19.911Z"}'
|
79
|
+
string: '{"object": "organization_membership", "id": "om_01H5JQDV7R7ATEYZDEG0W5PRYS", "user_id": "user_01H5JQDV7R7ATEYZDEG0W5PRYS", "organization_id": "organization_01H5JQDV7R7ATEYZDEG0W5PRYS", "status": "active", "created_at": "2023-07-18T02:07:19.911Z", "updated_at": "2023-07-18T02:07:19.911Z"}'
|
80
80
|
http_version:
|
81
81
|
recorded_at: Mon, 14 Aug 2023 21:42:04 GMT
|
82
82
|
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/user_management/invitations?after=invitation_01H5JQDV7R7ATEYZDEG0W5PRYS
|
5
|
+
uri: https://api.workos.com/user_management/invitations?after=invitation_01H5JQDV7R7ATEYZDEG0W5PRYS&order=desc
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://api.workos.com/user_management/invitations?before=invitation_01H5JQDV7R7ATEYZDEG0W5PRYS
|
5
|
+
uri: https://api.workos.com/user_management/invitations?before=invitation_01H5JQDV7R7ATEYZDEG0W5PRYS&order=desc
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
data/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_organization_id.yml
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://api.workos.com/user_management/invitations?organization_id=org_01H5JQDV7R7ATEYZDEG0W5PRYS
|
5
|
+
uri: https://api.workos.com/user_management/invitations?order=desc&organization_id=org_01H5JQDV7R7ATEYZDEG0W5PRYS
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://api.workos.com/user_management/organization_memberships
|
5
|
+
uri: https://api.workos.com/user_management/organization_memberships?order=desc
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ""
|
@@ -76,7 +76,7 @@ http_interactions:
|
|
76
76
|
- cloudflare
|
77
77
|
body:
|
78
78
|
encoding: ASCII-8BIT
|
79
|
-
string: '{"object":"list","data":[{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}, {"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":"before-id","after":null}}'
|
79
|
+
string: '{"object":"list","data":[{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status": "active","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}, {"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status": "active","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":"before-id","after":null}}'
|
80
80
|
http_version:
|
81
81
|
recorded_at: Tue, 15 Aug 2023 14:12:43 GMT
|
82
82
|
recorded_with: VCR 5.0.0
|
@@ -76,7 +76,7 @@ http_interactions:
|
|
76
76
|
- cloudflare
|
77
77
|
body:
|
78
78
|
encoding: ASCII-8BIT
|
79
|
-
string: '{"object":"list","data":[{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":null,"after":null}}'
|
79
|
+
string: '{"object":"list","data":[{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status": "active","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":null,"after":null}}'
|
80
80
|
http_version:
|
81
81
|
recorded_at: Tue, 15 Aug 2023 16:37:20 GMT
|
82
82
|
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: 4.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-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sorbet-runtime
|