workos 0.10.1 → 0.11.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.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -1
  3. data/.ruby-version +1 -1
  4. data/.semaphore/semaphore.yml +8 -2
  5. data/Gemfile.lock +49 -36
  6. data/lib/workos/client.rb +3 -3
  7. data/lib/workos/connection.rb +8 -1
  8. data/lib/workos/directory.rb +53 -0
  9. data/lib/workos/directory_group.rb +44 -0
  10. data/lib/workos/directory_sync.rb +63 -7
  11. data/lib/workos/directory_user.rb +60 -0
  12. data/lib/workos/portal.rb +1 -1
  13. data/lib/workos/profile.rb +1 -2
  14. data/lib/workos/sso.rb +31 -6
  15. data/lib/workos/types/connection_struct.rb +2 -0
  16. data/lib/workos/types/directory_group_struct.rb +13 -0
  17. data/lib/workos/types/directory_struct.rb +16 -0
  18. data/lib/workos/types/directory_user_struct.rb +18 -0
  19. data/lib/workos/types/intent_enum.rb +1 -0
  20. data/lib/workos/types.rb +3 -0
  21. data/lib/workos/version.rb +1 -1
  22. data/lib/workos.rb +3 -0
  23. data/sorbet/rbi/gems/addressable.rbi +199 -0
  24. data/sorbet/rbi/gems/ast.rbi +49 -0
  25. data/sorbet/rbi/gems/codecov.rbi +37 -0
  26. data/sorbet/rbi/gems/crack.rbi +62 -0
  27. data/sorbet/rbi/gems/docile.rbi +36 -0
  28. data/sorbet/rbi/gems/hashdiff.rbi +66 -0
  29. data/sorbet/rbi/gems/parallel.rbi +83 -0
  30. data/sorbet/rbi/gems/parser.rbi +1429 -0
  31. data/sorbet/rbi/gems/public_suffix.rbi +104 -0
  32. data/sorbet/rbi/gems/rainbow.rbi +118 -0
  33. data/sorbet/rbi/gems/rake.rbi +644 -0
  34. data/sorbet/rbi/gems/regexp_parser.rbi +926 -0
  35. data/sorbet/rbi/gems/rexml.rbi +628 -0
  36. data/sorbet/rbi/gems/rspec-core.rbi +1898 -0
  37. data/sorbet/rbi/gems/rspec-expectations.rbi +1127 -0
  38. data/sorbet/rbi/gems/rspec-mocks.rbi +1099 -0
  39. data/sorbet/rbi/gems/rspec-support.rbi +280 -0
  40. data/sorbet/rbi/gems/rspec.rbi +15 -0
  41. data/sorbet/rbi/gems/rubocop-ast.rbi +1355 -0
  42. data/sorbet/rbi/gems/rubocop.rbi +7253 -0
  43. data/sorbet/rbi/gems/ruby-progressbar.rbi +304 -0
  44. data/sorbet/rbi/gems/simplecov-html.rbi +35 -0
  45. data/sorbet/rbi/gems/simplecov.rbi +406 -0
  46. data/sorbet/rbi/gems/unicode-display_width.rbi +17 -0
  47. data/sorbet/rbi/gems/vcr.rbi +572 -0
  48. data/sorbet/rbi/gems/webmock.rbi +556 -0
  49. data/sorbet/rbi/gems/yard.rbi +1165 -0
  50. data/sorbet/rbi/sorbet-typed/lib/rake/all/rake.rbi +645 -0
  51. data/sorbet/rbi/sorbet-typed/lib/rspec-core/all/rspec-core.rbi +1891 -0
  52. data/sorbet/rbi/sorbet-typed/lib/rubocop/~>0.85/rubocop.rbi +2072 -0
  53. data/sorbet/rbi/sorbet-typed/lib/yard/all/yard.rbi +1214 -0
  54. data/sorbet/rbi/todo.rbi +1 -3
  55. data/spec/lib/workos/audit_trail_spec.rb +0 -8
  56. data/spec/lib/workos/directory_sync_spec.rb +347 -40
  57. data/spec/lib/workos/passwordless_spec.rb +0 -8
  58. data/spec/lib/workos/portal_spec.rb +18 -11
  59. data/spec/lib/workos/sso_spec.rb +141 -76
  60. data/spec/spec_helper.rb +2 -1
  61. data/spec/support/fixtures/vcr_cassettes/directory_sync/delete_directory.yml +72 -0
  62. data/spec/support/fixtures/vcr_cassettes/{sso/list_connections.yml → directory_sync/list_directories/with_after.yml} +7 -7
  63. data/spec/support/fixtures/vcr_cassettes/{sso/list_connections_with_limit_param.yml → directory_sync/list_directories/with_before.yml} +8 -8
  64. data/spec/support/fixtures/vcr_cassettes/{sso/list_connections_with_connection_type_param.yml → directory_sync/list_directories/with_domain.yml} +11 -10
  65. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_limit.yml +74 -0
  66. data/spec/support/fixtures/vcr_cassettes/directory_sync/{list_directories.yml → list_directories/with_no_options.yml} +1 -1
  67. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_search.yml +73 -0
  68. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_after.yml +76 -0
  69. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_before.yml +74 -0
  70. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_directory.yml +78 -0
  71. data/spec/support/fixtures/vcr_cassettes/{sso/list_connections_with_before_param.yml → directory_sync/list_groups/with_limit.yml} +12 -11
  72. data/spec/support/fixtures/vcr_cassettes/directory_sync/{list_groups.yml → list_groups/with_no_options.yml} +16 -6
  73. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_user.yml +72 -0
  74. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_after.yml +86 -0
  75. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_before.yml +75 -0
  76. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_directory.yml +93 -0
  77. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_group.yml +76 -0
  78. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_limit.yml +75 -0
  79. data/spec/support/fixtures/vcr_cassettes/directory_sync/{list_users.yml → list_users/with_no_options.yml} +16 -6
  80. data/spec/support/fixtures/vcr_cassettes/portal/generate_link_dsync.yml +72 -0
  81. data/spec/support/fixtures/vcr_cassettes/portal/{generate_link.yml → generate_link_sso.yml} +1 -1
  82. data/spec/support/fixtures/vcr_cassettes/sso/create_connection_with_valid_source.yml +3 -3
  83. data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_after.yml +73 -0
  84. data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_before.yml +73 -0
  85. data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_connection_type.yml +73 -0
  86. data/spec/support/fixtures/vcr_cassettes/sso/{list_connections_with_domain_param.yml → list_connections/with_domain.yml} +6 -6
  87. data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_limit.yml +74 -0
  88. data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_no_options.yml +73 -0
  89. data/spec/support/fixtures/vcr_cassettes/sso/{list_connections_with_organization_id_param.yml → list_connections/with_organization_id.yml} +6 -6
  90. data/workos.gemspec +2 -0
  91. metadata +101 -42
  92. data/sorbet/rbi/hidden-definitions/errors.txt +0 -24896
  93. data/sorbet/rbi/hidden-definitions/hidden.rbi +0 -38411
  94. data/sorbet/rbi/sorbet-typed/lib/bundler/all/bundler.rbi +0 -8684
  95. data/sorbet/rbi/sorbet-typed/lib/ruby/all/gem.rbi +0 -4222
  96. data/sorbet/rbi/sorbet-typed/lib/ruby/all/open3.rbi +0 -111
  97. data/sorbet/rbi/sorbet-typed/lib/ruby/all/resolv.rbi +0 -543
  98. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories_with_domain_param.yml +0 -63
  99. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups_with_directory_param.yml +0 -62
  100. data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users_with_directory_param.yml +0 -62
  101. data/spec/support/fixtures/vcr_cassettes/sso/list_connections_with_after_param.yml +0 -72
@@ -73,7 +73,41 @@ describe WorkOS::SSO do
73
73
  end
74
74
  end
75
75
 
76
- context 'with neither domain or provider' do
76
+ context 'with a connection' do
77
+ let(:args) do
78
+ {
79
+ connection: 'connection_123',
80
+ client_id: 'workos-proj-123',
81
+ redirect_uri: 'foo.com/auth/callback',
82
+ state: {
83
+ next_page: '/dashboard/edit',
84
+ }.to_s,
85
+ }
86
+ end
87
+ it 'returns a valid URL' do
88
+ authorization_url = described_class.authorization_url(**args)
89
+
90
+ expect(URI.parse(authorization_url)).to be_a URI
91
+ end
92
+
93
+ it 'returns the expected hostname' do
94
+ authorization_url = described_class.authorization_url(**args)
95
+
96
+ expect(URI.parse(authorization_url).host).to eq(WorkOS::API_HOSTNAME)
97
+ end
98
+
99
+ it 'returns the expected query string' do
100
+ authorization_url = described_class.authorization_url(**args)
101
+
102
+ expect(URI.parse(authorization_url).query).to eq(
103
+ 'client_id=workos-proj-123&redirect_uri=foo.com%2Fauth%2Fcallback' \
104
+ '&response_type=code&state=%7B%3Anext_page%3D%3E%22%2Fdashboard%2F' \
105
+ 'edit%22%7D&connection=connection_123',
106
+ )
107
+ end
108
+ end
109
+
110
+ context 'with neither connection, domain, or provider' do
77
111
  let(:args) do
78
112
  {
79
113
  client_id: 'workos-proj-123',
@@ -88,7 +122,7 @@ describe WorkOS::SSO do
88
122
  described_class.authorization_url(**args)
89
123
  end.to raise_error(
90
124
  ArgumentError,
91
- 'Either domain or provider is required.',
125
+ 'Either connection, domain, or provider is required.',
92
126
  )
93
127
  end
94
128
  end
@@ -159,10 +193,6 @@ describe WorkOS::SSO do
159
193
  end
160
194
 
161
195
  describe '.profile' do
162
- before do
163
- WorkOS.key = 'api-key'
164
- end
165
-
166
196
  let(:args) do
167
197
  {
168
198
  code: SecureRandom.hex(10),
@@ -274,14 +304,6 @@ describe WorkOS::SSO do
274
304
  end
275
305
 
276
306
  describe '.create_connection' do
277
- before(:all) do
278
- WorkOS.key = 'key'
279
- end
280
-
281
- after(:all) do
282
- WorkOS.key = nil
283
- end
284
-
285
307
  context 'with a valid source' do
286
308
  it 'creates a connection' do
287
309
  VCR.use_cassette('sso/create_connection_with_valid_source') do
@@ -293,6 +315,8 @@ describe WorkOS::SSO do
293
315
  expect(connection.connection_type).to eq('GoogleOAuth')
294
316
  expect(connection.name).to eq('Foo Corp')
295
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')
296
320
  end
297
321
  end
298
322
  end
@@ -312,14 +336,6 @@ describe WorkOS::SSO do
312
336
  end
313
337
 
314
338
  describe '.promote_draft_connection' do
315
- before(:all) do
316
- WorkOS.key = 'key'
317
- end
318
-
319
- after(:all) do
320
- WorkOS.key = nil
321
- end
322
-
323
339
  let(:token) { 'draft_conn_id' }
324
340
  let(:client_id) { 'proj_0239u590h' }
325
341
 
@@ -357,54 +373,86 @@ describe WorkOS::SSO do
357
373
  end
358
374
 
359
375
  describe '.list_connections' do
360
- before(:all) do
361
- WorkOS.key = 'key'
362
- end
376
+ context 'with no options' do
377
+ it 'returns connections and metadata' do
378
+ expected_metadata = {
379
+ 'after' => nil,
380
+ 'before' => 'before_id',
381
+ }
363
382
 
364
- after(:all) do
365
- WorkOS.key = nil
366
- end
383
+ VCR.use_cassette 'sso/list_connections/with_no_options' do
384
+ connections = described_class.list_connections
367
385
 
368
- context 'with no options' do
369
- it 'returns connections' do
370
- VCR.use_cassette('sso/list_connections') do
371
- connections = WorkOS::SSO.list_connections
372
- expect(connections.size).to eq(1)
386
+ expect(connections.data.size).to eq(3)
387
+ expect(connections.list_metadata).to eq(expected_metadata)
373
388
  end
374
389
  end
375
390
  end
376
391
 
377
392
  context 'with connection_type option' do
378
- it 'returns connections' do
379
- VCR.use_cassette('sso/list_connections_with_connection_type_param') do
380
- connections = WorkOS::SSO.list_connections(
393
+ it 'forms the proper request to the API' do
394
+ request_args = [
395
+ '/connections?connection_type=OktaSAML',
396
+ 'Content-Type' => 'application/json'
397
+ ]
398
+
399
+ expected_request = Net::HTTP::Get.new(*request_args)
400
+
401
+ expect(Net::HTTP::Get).to receive(:new).with(*request_args).
402
+ and_return(expected_request)
403
+
404
+ VCR.use_cassette 'sso/list_connections/with_connection_type' do
405
+ connections = described_class.list_connections(
381
406
  connection_type: 'OktaSAML',
382
407
  )
383
- expect(connections.first['connection_type']).to eq('OktaSAML')
408
+
409
+ expect(connections.data.size).to eq(3)
410
+ expect(connections.data.first.connection_type).to eq('OktaSAML')
384
411
  end
385
412
  end
386
413
  end
387
414
 
388
415
  context 'with domain option' do
389
- it 'returns connections' do
390
- VCR.use_cassette('sso/list_connections_with_domain_param') do
391
- connections = WorkOS::SSO.list_connections(
416
+ it 'forms the proper request to the API' do
417
+ request_args = [
418
+ '/connections?domain=foo-corp.com',
419
+ 'Content-Type' => 'application/json'
420
+ ]
421
+
422
+ expected_request = Net::HTTP::Get.new(*request_args)
423
+
424
+ expect(Net::HTTP::Get).to receive(:new).with(*request_args).
425
+ and_return(expected_request)
426
+
427
+ VCR.use_cassette 'sso/list_connections/with_domain' do
428
+ connections = described_class.list_connections(
392
429
  domain: 'foo-corp.com',
393
430
  )
394
- domains = connections.first['domains']
395
- expect(domains.first['domain']).to eq('foo-corp.com')
431
+
432
+ expect(connections.data.size).to eq(1)
396
433
  end
397
434
  end
398
435
  end
399
436
 
400
437
  context 'with organization_id option' do
401
- it 'returns connections' do
402
- VCR.use_cassette('sso/list_connections_with_organization_id_param') do
403
- connections = WorkOS::SSO.list_connections(
438
+ it 'forms the proper request to the API' do
439
+ request_args = [
440
+ '/connections?organization_id=org_01EGS4P7QR31EZ4YWD1Z1XA176',
441
+ 'Content-Type' => 'application/json'
442
+ ]
443
+
444
+ expected_request = Net::HTTP::Get.new(*request_args)
445
+
446
+ expect(Net::HTTP::Get).to receive(:new).with(*request_args).
447
+ and_return(expected_request)
448
+
449
+ VCR.use_cassette 'sso/list_connections/with_organization_id' do
450
+ connections = described_class.list_connections(
404
451
  organization_id: 'org_01EGS4P7QR31EZ4YWD1Z1XA176',
405
452
  )
406
- expect(connections.size).to eq(1)
407
- expect(connections.first['organization_id']).to eq(
453
+
454
+ expect(connections.data.size).to eq(1)
455
+ expect(connections.data.first.organization_id).to eq(
408
456
  'org_01EGS4P7QR31EZ4YWD1Z1XA176',
409
457
  )
410
458
  end
@@ -412,48 +460,73 @@ describe WorkOS::SSO do
412
460
  end
413
461
 
414
462
  context 'with limit option' do
415
- it 'returns connections' do
416
- VCR.use_cassette('sso/list_connections_with_limit_param') do
417
- connections = WorkOS::SSO.list_connections(
418
- limit: 1,
463
+ it 'forms the proper request to the API' do
464
+ request_args = [
465
+ '/connections?limit=2',
466
+ 'Content-Type' => 'application/json'
467
+ ]
468
+
469
+ expected_request = Net::HTTP::Get.new(*request_args)
470
+
471
+ expect(Net::HTTP::Get).to receive(:new).with(*request_args).
472
+ and_return(expected_request)
473
+
474
+ VCR.use_cassette 'sso/list_connections/with_limit' do
475
+ connections = described_class.list_connections(
476
+ limit: 2,
419
477
  )
420
- expect(connections.size).to eq(1)
478
+
479
+ expect(connections.data.size).to eq(2)
421
480
  end
422
481
  end
423
482
  end
424
483
 
425
484
  context 'with before option' do
426
- it 'returns connections' do
427
- VCR.use_cassette('sso/list_connections_with_before_param') do
428
- connections = WorkOS::SSO.list_connections(
485
+ it 'forms the proper request to the API' do
486
+ request_args = [
487
+ '/connections?before=conn_01EQKPMQAPV02H270HKVNS4CTA',
488
+ 'Content-Type' => 'application/json'
489
+ ]
490
+
491
+ expected_request = Net::HTTP::Get.new(*request_args)
492
+
493
+ expect(Net::HTTP::Get).to receive(:new).with(*request_args).
494
+ and_return(expected_request)
495
+
496
+ VCR.use_cassette 'sso/list_connections/with_before' do
497
+ connections = described_class.list_connections(
429
498
  before: 'conn_01EQKPMQAPV02H270HKVNS4CTA',
430
499
  )
431
- expect(connections.size).to eq(1)
500
+
501
+ expect(connections.data.size).to eq(3)
432
502
  end
433
503
  end
434
504
  end
435
505
 
436
506
  context 'with after option' do
437
- it 'returns connections' do
438
- VCR.use_cassette('sso/list_connections_with_after_param') do
439
- connections = WorkOS::SSO.list_connections(
507
+ it 'forms the proper request to the API' do
508
+ request_args = [
509
+ '/connections?after=conn_01EQKPMQAPV02H270HKVNS4CTA',
510
+ 'Content-Type' => 'application/json'
511
+ ]
512
+
513
+ expected_request = Net::HTTP::Get.new(*request_args)
514
+
515
+ expect(Net::HTTP::Get).to receive(:new).with(*request_args).
516
+ and_return(expected_request)
517
+
518
+ VCR.use_cassette 'sso/list_connections/with_after' do
519
+ connections = described_class.list_connections(
440
520
  after: 'conn_01EQKPMQAPV02H270HKVNS4CTA',
441
521
  )
442
- expect(connections.size).to eq(1)
522
+
523
+ expect(connections.data.size).to eq(3)
443
524
  end
444
525
  end
445
526
  end
446
527
  end
447
528
 
448
529
  describe '.get_connection' do
449
- before(:all) do
450
- WorkOS.key = 'key'
451
- end
452
-
453
- after(:all) do
454
- WorkOS.key = nil
455
- end
456
-
457
530
  context 'with a valid id' do
458
531
  it 'gets the connection details' do
459
532
  VCR.use_cassette('sso/get_connection_with_valid_id') do
@@ -484,14 +557,6 @@ describe WorkOS::SSO do
484
557
  end
485
558
 
486
559
  describe '.delete_connection' do
487
- before(:all) do
488
- WorkOS.key = 'key'
489
- end
490
-
491
- after(:all) do
492
- WorkOS.key = nil
493
- end
494
-
495
560
  context 'with a valid id' do
496
561
  it 'returns true' do
497
562
  VCR.use_cassette('sso/delete_connection_with_valid_id') do
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- # typed: true
2
+ # typed: false
3
3
 
4
4
  require 'simplecov'
5
5
  SimpleCov.start
@@ -48,5 +48,6 @@ RSpec.configure do |config|
48
48
  end
49
49
  end)
50
50
 
51
+ config.before(:all) { WorkOS.key ||= '' }
51
52
  config.before(:each) { VCR.turn_on! }
52
53
  end
@@ -0,0 +1,72 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: delete
5
+ uri: https://api.workos.com/directories/directory_01F2T098SKN5PCTVSJ7CWP70N5
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-darwin20; v0.10.3
18
+ Authorization:
19
+ - Bearer <API_KEY>
20
+ response:
21
+ status:
22
+ code: 202
23
+ message: Accepted
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
+ - 834c3434-80dd-4e5e-bda7-95cd1412ad29
57
+ Content-Type:
58
+ - text/plain; charset=utf-8
59
+ Content-Length:
60
+ - '8'
61
+ Etag:
62
+ - W/"8-YaBXLEiT7zQxEyDYTILfiL6oPhE"
63
+ Date:
64
+ - Wed, 21 Apr 2021 22:26:51 GMT
65
+ Via:
66
+ - 1.1 vegur
67
+ body:
68
+ encoding: UTF-8
69
+ string: Accepted
70
+ http_version:
71
+ recorded_at: Wed, 21 Apr 2021 22:26:51 GMT
72
+ 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
5
+ uri: https://api.workos.com/directories?after=after-id
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/2.7.1; x86_64-darwin19; v0.10.0
17
+ - WorkOS; ruby/2.7.1; x86_64-darwin19; v0.10.3
18
18
  Authorization:
19
19
  - Bearer <API_KEY>
20
20
  response:
@@ -53,20 +53,20 @@ http_interactions:
53
53
  X-Xss-Protection:
54
54
  - '0'
55
55
  X-Request-Id:
56
- - 2ebda5f5-2266-4453-afa4-6551d5d0203f
56
+ - 1e6d2f37-ca39-4e6c-8d04-4a56fed444ce
57
57
  Content-Type:
58
58
  - application/json; charset=utf-8
59
59
  Etag:
60
- - W/"3de5-Tcj2+hXtEQVDggy9evxEiubZtig"
60
+ - W/"7dc-9PMr4siidbvsdQqw0uiJT6E94Dc"
61
61
  Date:
62
- - Wed, 27 Jan 2021 22:45:13 GMT
62
+ - Thu, 22 Apr 2021 21:33:48 GMT
63
63
  Transfer-Encoding:
64
64
  - chunked
65
65
  Via:
66
66
  - 1.1 vegur
67
67
  body:
68
68
  encoding: ASCII-8BIT
69
- string: '{"data":[{"object":"connection","id":"conn_01EWDSQJNXM1M33MTVSQ2ZR5M5","status":"unlinked","state":"draft","name":"Example","connection_type":"OktaSAML","oidc_client_id":null,"oidc_client_secret":null,"oidc_discovery_endpoint":null,"oidc_redirect_uri":null,"saml_entity_id":null,"saml_idp_url":null,"saml_relying_party_private_key":null,"saml_relying_party_public_key":null,"saml_x509_certs":null,"organization_id":"org_01EWDSPEYNG87X1KMBNA7315F7","oauth_uid":null,"oauth_secret":null,"oauth_redirect_uri":null,"domains":[{"object":"connection_domain","id":"domain_01EWDSQJP5HPMD4BQQ031WG55V","domain":"example.com"}]}],"listMetadata":{"before":"conn_01EQKNFQRVY56P08881CC8MFG1","after":null}}'
69
+ string: '{"object":"list","listMetadata":{"before":"before-id","after":null},"data":[{"object":"directory","id":"directory_edp_1","external_key":"lA3gS1kCZMCkk82E","state":"linked","type":"gsuite directory","name":"Foo Corp","bearer_token":null,"client_id":"project_XXX","domain":"foo-corp.com"}, {"object":"directory","id":"directory_edp_2","external_key":"lA3g","state":"linked","type":"okta scim v2.0","name":"Example", "bearer_token":null,"client_id":"project_XXX","domain":"example.com"}, {"object":"directory","id":"directory_edp_3","external_key":"lA3gS1kC","state":"linked","type":"bamboohr","name":"Acme","bearer_token":null,"client_id":"project_XXX","domain":"acme.com"}]}'
70
70
  http_version:
71
- recorded_at: Wed, 27 Jan 2021 22:45:13 GMT
71
+ recorded_at: Thu, 22 Apr 2021 21:33:49 GMT
72
72
  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?limit=1
5
+ uri: https://api.workos.com/directories?before=before-id
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/2.7.1; x86_64-darwin19; v0.10.0
17
+ - WorkOS; ruby/2.7.1; x86_64-darwin19; v0.10.3
18
18
  Authorization:
19
19
  - Bearer <API_KEY>
20
20
  response:
@@ -53,20 +53,20 @@ http_interactions:
53
53
  X-Xss-Protection:
54
54
  - '0'
55
55
  X-Request-Id:
56
- - 0faa24f3-189c-422b-a8d4-041ae25d58cf
56
+ - ee432766-24b5-4d6d-baa9-05b7d56ac582
57
57
  Content-Type:
58
58
  - application/json; charset=utf-8
59
59
  Content-Length:
60
- - '775'
60
+ - '71'
61
61
  Etag:
62
- - W/"307-f+XEBZyB7oLVWHDcligPou2CEgg"
62
+ - W/"47-5KOnfOsRy36pnaPjBxvaf6LRiGc"
63
63
  Date:
64
- - Wed, 27 Jan 2021 22:56:32 GMT
64
+ - Thu, 22 Apr 2021 21:33:48 GMT
65
65
  Via:
66
66
  - 1.1 vegur
67
67
  body:
68
68
  encoding: UTF-8
69
- string: '{"data":[{"object":"connection","id":"conn_01EWDSQJNXM1M33MTVSQ2ZR5M5","status":"unlinked","state":"draft","name":"IBM","connection_type":"OktaSAML","oidc_client_id":null,"oidc_client_secret":null,"oidc_discovery_endpoint":null,"oidc_redirect_uri":null,"saml_entity_id":null,"saml_idp_url":null,"saml_relying_party_private_key":null,"saml_relying_party_public_key":null,"saml_x509_certs":null,"organization_id":"org_01EWDSPEYNG87X1KMBNA7315F7","oauth_uid":null,"oauth_secret":null,"oauth_redirect_uri":null,"domains":[{"object":"connection_domain","id":"domain_01EWDSQJP5HPMD4BQQ031WG55V","domain":"ibm.jp"},{"object":"connection_domain","id":"domain_01EWDSQJP53FXQXEKRSFK1W0N9","domain":"ibm.com"}]}],"listMetadata":{"before":"conn_01EWDSQJNXM1M33MTVSQ2ZR5M5","after":null}}'
69
+ string: '{"object":"list","listMetadata":{"before":"before-id","after":null},"data":[{"object":"directory","id":"directory_edp_1","external_key":"lA3gS1kCZMCkk82E","state":"linked","type":"gsuite directory","name":"Foo Corp","bearer_token":null,"client_id":"project_XXX","domain":"foo-corp.com"}, {"object":"directory","id":"directory_edp_2","external_key":"lA3g","state":"linked","type":"okta scim v2.0","name":"Example", "bearer_token":null,"client_id":"project_XXX","domain":"example.com"}, {"object":"directory","id":"directory_edp_3","external_key":"lA3gS1kC","state":"linked","type":"bamboohr","name":"Acme","bearer_token":null,"client_id":"project_XXX","domain":"acme.com"}]}'
70
70
  http_version:
71
- recorded_at: Wed, 27 Jan 2021 22:56:32 GMT
71
+ recorded_at: Thu, 22 Apr 2021 21:33:48 GMT
72
72
  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?connection_type=OktaSAML
5
+ uri: https://api.workos.com/directories?domain=foo-corp.com
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/2.7.1; x86_64-darwin19; v0.10.0
17
+ - WorkOS; ruby/2.7.1; x86_64-darwin19; v0.10.3
18
18
  Authorization:
19
19
  - Bearer <API_KEY>
20
20
  response:
@@ -53,20 +53,21 @@ http_interactions:
53
53
  X-Xss-Protection:
54
54
  - '0'
55
55
  X-Request-Id:
56
- - cd5f506d-61c0-4004-ac32-2445b36717b1
56
+ - c2664753-7a2a-499f-a6e7-dae700ad49d7
57
57
  Content-Type:
58
58
  - application/json; charset=utf-8
59
+ Content-Length:
60
+ - '256'
59
61
  Etag:
60
- - W/"37b0-pr+AD/NOUTSrEMYMRxh0gv2bl9Y"
62
+ - W/"100-Vh8CFQGzG+aGyEkNXe2nXGxNFJ4"
61
63
  Date:
62
- - Wed, 27 Jan 2021 22:54:01 GMT
63
- Transfer-Encoding:
64
- - chunked
64
+ - Thu, 22 Apr 2021 21:33:47 GMT
65
65
  Via:
66
66
  - 1.1 vegur
67
67
  body:
68
- encoding: ASCII-8BIT
69
- string: '{"data":[{"object":"connection","id":"conn_01EWDSQJNXM1M33MTVSQ2ZR5M5","status":"unlinked","state":"draft","name":"Example","connection_type":"OktaSAML","oidc_client_id":null,"oidc_client_secret":null,"oidc_discovery_endpoint":null,"oidc_redirect_uri":null,"saml_entity_id":null,"saml_idp_url":null,"saml_relying_party_private_key":null,"saml_relying_party_public_key":null,"saml_x509_certs":null,"organization_id":"org_01EWDSPEYNG87X1KMBNA7315F7","oauth_uid":null,"oauth_secret":null,"oauth_redirect_uri":null,"domains":[{"object":"connection_domain","id":"domain_01EWDSQJP5HPMD4BQQ031WG55V","domain":"example.com"}]}],"listMetadata":{"before":"conn_01EQKNFQRVY56P08881CC8MFG1","after":null}}'
68
+ encoding: UTF-8
69
+ string: '{"object":"list","listMetadata":{"before":null,"after":null},"data":[{"object":"directory","id":"directory_01EK2YEMVTWGX27STRDR0N3MP9","name":"Foo
70
+ Corp","external_key":"SZ5TZMl7gcOAKS04","type":"gsuite directory","state":"linked","domain":"foo-corp.com"}]}'
70
71
  http_version:
71
- recorded_at: Wed, 27 Jan 2021 22:54:01 GMT
72
+ recorded_at: Thu, 22 Apr 2021 21:33:47 GMT
72
73
  recorded_with: VCR 5.0.0
@@ -0,0 +1,74 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.workos.com/directories?limit=2
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: 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
+ - 428c7b66-d05a-4055-8bad-3411cce2af98
57
+ Content-Type:
58
+ - application/json; charset=utf-8
59
+ Content-Length:
60
+ - '509'
61
+ Etag:
62
+ - W/"1fd-xSekCggfEeBaxDK/LwXVh/ANf8E"
63
+ Date:
64
+ - Thu, 22 Apr 2021 21:33:49 GMT
65
+ Via:
66
+ - 1.1 vegur
67
+ body:
68
+ encoding: UTF-8
69
+ string: '{"object":"list","listMetadata":{"before":"directory_01F3DR5PASNQN7Z41K933Q12BM","after":null},"data":[{"object":"directory","id":"directory_01F3TMHZ5786V0BW141Q3G6XWX","name":"NEW
70
+ Azure AD SCIM","external_key":"RfEhaHYmukAQgqME","type":"azure scim v2.0","state":"linked","domain":"sheldonvaughn.com"},{"object":"directory","id":"directory_01F3DR5PASNQN7Z41K933Q12BM","name":"Example
71
+ Workday Company, Inc.","external_key":"NGGpjT9hQsiSgOKc","type":"workday","state":"unlinked","domain":"domain.example.com"}]}'
72
+ http_version:
73
+ recorded_at: Thu, 22 Apr 2021 21:33:49 GMT
74
+ recorded_with: VCR 5.0.0
@@ -56,7 +56,7 @@ http_interactions:
56
56
  - 1.1 vegur
57
57
  body:
58
58
  encoding: ASCII-8BIT
59
- string: '{"object":"list","listMetadata":{"before":"directory_edp_01E44H95QPBGZ6A4D89VYZ0WX1","after":null},"data":[{"object":"directory","id":"directory_edp_01E64QQVQTCB0DECJ9CFNXEWDW","external_key":"lA3gS1kCZMCkk82E","state":"linked","type":"gsuite directory","name":"Foo Corp","bearer_token":null,"client_id":"project_01DFYCG8RCB1DB6DKFTGXF4Q9F","domain":"foo-corp.com"}]}'
59
+ string: '{"object":"list","listMetadata":{"before":"before-id","after":null},"data":[{"object":"directory","id":"directory_edp_1","external_key":"lA3gS1kCZMCkk82E","state":"linked","type":"gsuite directory","name":"Foo Corp","bearer_token":null,"client_id":"project_XXX","domain":"foo-corp.com"}, {"object":"directory","id":"directory_edp_2","external_key":"lA3g","state":"linked","type":"okta scim v2.0","name":"Example", "bearer_token":null,"client_id":"project_XXX","domain":"example.com"}, {"object":"directory","id":"directory_edp_3","external_key":"lA3gS1kC","state":"linked","type":"bamboohr","name":"Acme","bearer_token":null,"client_id":"project_XXX","domain":"acme.com"}]}'
60
60
  http_version:
61
61
  recorded_at: Thu, 30 Apr 2020 03:11:45 GMT
62
62
  recorded_with: VCR 5.0.0