From 18c53ece426bb1a9e19505e0c1f9bcde78ec176c Mon Sep 17 00:00:00 2001 From: Blair Lunceford <74257063+blairlunceford@users.noreply.github.com> Date: Wed, 3 Nov 2021 14:59:51 -0600 Subject: [PATCH] Make directory domain nullable (#130) --- lib/workos/directory.rb | 2 +- lib/workos/types/directory_struct.rb | 2 +- spec/lib/workos/directory_sync_spec.rb | 21 +++---- .../list_directories/with_after.yml | 56 ++++++++++------- .../list_directories/with_before.yml | 58 +++++++++++------- .../list_directories/with_domain.yml | 49 +++++++++------ .../list_directories/with_limit.yml | 51 +++++++++------- .../list_directories/with_no_options.yml | 60 ++++++++++++------- .../list_directories/with_search.yml | 52 +++++++++------- 9 files changed, 215 insertions(+), 136 deletions(-) diff --git a/lib/workos/directory.rb b/lib/workos/directory.rb index 62492d30..e2765b19 100644 --- a/lib/workos/directory.rb +++ b/lib/workos/directory.rb @@ -17,7 +17,7 @@ def initialize(json) @id = T.let(raw.id, String) @name = T.let(raw.name, String) - @domain = T.let(raw.domain, String) + @domain = raw.domain @type = T.let(raw.type, String) @state = T.let(raw.state, String) @organization_id = T.let(raw.organization_id, String) diff --git a/lib/workos/types/directory_struct.rb b/lib/workos/types/directory_struct.rb index c267e954..4a6158ac 100644 --- a/lib/workos/types/directory_struct.rb +++ b/lib/workos/types/directory_struct.rb @@ -8,7 +8,7 @@ module Types class DirectoryStruct < T::Struct const :id, String const :name, String - const :domain, String + const :domain, T.nilable(String) const :type, String const :state, String const :organization_id, String diff --git a/spec/lib/workos/directory_sync_spec.rb b/spec/lib/workos/directory_sync_spec.rb index 45f90958..54768eb6 100644 --- a/spec/lib/workos/directory_sync_spec.rb +++ b/spec/lib/workos/directory_sync_spec.rb @@ -15,7 +15,7 @@ VCR.use_cassette 'directory_sync/list_directories/with_no_options' do directories = described_class.list_directories - expect(directories.data.size).to eq(3) + expect(directories.data.size).to eq(10) expect(directories.list_metadata).to eq(expected_metadata) end end @@ -46,7 +46,7 @@ context 'with search option' do it 'forms the proper request to the API' do request_args = [ - '/directories?search=Foo', + '/directories?search=Testing', 'Content-Type' => 'application/json' ] @@ -57,10 +57,11 @@ VCR.use_cassette 'directory_sync/list_directories/with_search' do directories = described_class.list_directories( - search: 'Foo', + search: 'Testing', ) - expect(directories.data.size).to eq(1) + expect(directories.data.size).to eq(2) + expect(directories.data[0].name).to include('Testing') end end end @@ -68,7 +69,7 @@ context 'with the before option' do it 'forms the proper request to the API' do request_args = [ - '/directories?before=before-id', + '/directories?before=directory_01FGCPNV312FHFRCX0BYWHVSE1', 'Content-Type' => 'application/json' ] @@ -79,10 +80,10 @@ VCR.use_cassette 'directory_sync/list_directories/with_before' do directories = described_class.list_directories( - before: 'before-id', + before: 'directory_01FGCPNV312FHFRCX0BYWHVSE1', ) - expect(directories.data.size).to eq(3) + expect(directories.data.size).to eq(6) end end end @@ -90,7 +91,7 @@ context 'with the after option' do it 'forms the proper request to the API' do request_args = [ - '/directories?after=after-id', + '/directories?after=directory_01FGCPNV312FHFRCX0BYWHVSE1', 'Content-Type' => 'application/json' ] @@ -100,9 +101,9 @@ and_return(expected_request) VCR.use_cassette 'directory_sync/list_directories/with_after' do - directories = described_class.list_directories(after: 'after-id') + directories = described_class.list_directories(after: 'directory_01FGCPNV312FHFRCX0BYWHVSE1') - expect(directories.data.size).to eq(3) + expect(directories.data.size).to eq(4) end end end diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_after.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_after.yml index 0f45bb54..bc0767fb 100644 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_after.yml +++ b/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_after.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: get - uri: https://api.workos.com/directories?after=after-id + uri: https://api.workos.com/directories?after=directory_01FGCPNV312FHFRCX0BYWHVSE1 body: encoding: US-ASCII string: '' @@ -14,7 +14,7 @@ http_interactions: Accept: - "*/*" User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.2.1 + - WorkOS; ruby/3.0.2; x86_64-darwin19; v1.6.0 Authorization: - Bearer response: @@ -22,14 +22,14 @@ http_interactions: code: 200 message: OK headers: - Server: - - Cowboy + Date: + - Sun, 31 Oct 2021 23:16:20 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked Connection: - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' Content-Security-Policy: - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src @@ -52,24 +52,36 @@ http_interactions: - no-referrer X-Xss-Protection: - '0' + Vary: + - Origin, Accept-Encoding + Access-Control-Allow-Credentials: + - 'true' X-Request-Id: - - 167e0fa2-cee2-4834-a0aa-4f68fd0a3796 - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '784' + - 9b8b2fde-c533-499f-8255-ae5a38dec1c9 Etag: - - W/"310-fBrsCTIA95j4JLo4UR8X2zBThYQ" - Date: - - Mon, 07 Jun 2021 17:55:30 GMT + - W/"57d-b8X7nQ95z8XcpGDAg30zxtq4cyU" Via: - 1.1 vegur + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=bjisueAcX0y8T%2Bw7bzZ80xRsaJ5DYZJgfN2zGa5B24dZ%2BZPVtKMFVRMw4L9VpcpSuElvsrz9f503dDZJ46JT6sbHmUEE188lRzuHV1UC45wkzjRb%2B%2BMdPysI9473RJMX2ilURb2knzhC29H0YA%3D%3D"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 6a7097287c0866e3-DFW + Alt-Svc: + - h3=":443"; ma=86400, h3-29=":443"; ma=86400, h3-28=":443"; ma=86400, h3-27=":443"; + ma=86400 body: - encoding: UTF-8 - string: '{"object":"list","listMetadata":{"before":null,"after":null},"data":[{"object":"directory","id":"directory_01F7796W20KW0CXEQQEYENT0ZC","organization_id":"org_01EZDF20TZEJXKPSX2BJRN6TV6","name":"Bamboo - Test","external_key":"rPzV4pdpbaUiKsc6","type":"bamboohr","state":"unlinked","domain":"foo-corp.com", "created_at":"2021-07-02T19:15:39.556Z","updated_at":"2021-07-02T19:31:28.499Z"},{"object":"directory","id":"directory_01F5ZY7XVQZ3DRYEZTH1EPA8BS","organization_id":"org_01EZDF20TZEJXKPSX2BJRN6TV6","name":"Foo - Corp","external_key":"qV4eyK99QGUaYYa0","type":"okta scim v2.0","state":"linked","domain":"foo-corp.com", "created_at":"2021-07-02T19:15:39.556Z","updated_at":"2021-07-02T19:31:28.499Z"},{"object":"directory","id":"directory_01F5XHH1QHX6C2F0Z6WG9YPGCJ","organization_id":"org_01F29YJ068E52HGEB8ZQGC9MJG","name":"Example - Azure SCIM","external_key":"YDKJvbWHKKg66cSk","type":"azure scim v2.0","state":"linked","domain":"example.com", "created_at":"2021-07-02T19:15:39.556Z","updated_at":"2021-07-02T19:31:28.499Z"}]}' + encoding: ASCII-8BIT + string: '{"object":"list","data":[{"object":"directory","id":"directory_01FK3HFFGMC2WF32RR8SKWC8KA","organization_id":"org_01FHRF60X0CDBB8F6A0YGSJJ2B","name":"Azure + Set Up Test","external_key":"Ii2mw43BMAIqiKuA","type":"azure scim v2.0","state":"linked","created_at":"2021-10-28T13:29:54.451Z","updated_at":"2021-10-28T13:32:03.737Z"},{"object":"directory","id":"directory_01FK17DWRHH7APAFXT5B52PV0W","organization_id":"org_01F6Q6TFP7RD2PF6J03ANNWDKV","name":"Testing + Active Attribute","external_key":"QArgyQQkq4G0MquM","type":"azure scim v2.0","state":"linked","created_at":"2021-10-27T15:55:47.856Z","updated_at":"2021-10-27T16:03:43.990Z","domain":"example.me"},{"object":"directory","id":"directory_01FHZKS052FGZQQCZHAX0E4AC0","organization_id":"org_01FHRF60X0CDBB8F6A0YGSJJ2B","name":"Okta + SCIM Test","external_key":"z76YkVQ9vEK0AUyy","type":"okta scim v2.0","state":"linked","created_at":"2021-10-14T14:37:24.004Z","updated_at":"2021-10-27T15:50:21.248Z"},{"object":"directory","id":"directory_01FGCQE0KD0V01GB46NJ7871F7","organization_id":"org_01FGCPJPQ35DR0WGGGBEC2V1GN","name":"Azure + Test","external_key":"S16nSw4AaAyW06ia","type":"azure scim v2.0","state":"linked","created_at":"2021-09-24T20:20:02.285Z","updated_at":"2021-10-27T15:50:21.579Z"}],"list_metadata":{"before":"directory_01FGCQE0KD0V01GB46NJ7871F7","after":null},"listMetadata":{"before":"directory_01FGCQE0KD0V01GB46NJ7871F7","after":null}}' http_version: - recorded_at: Mon, 07 Jun 2021 17:55:30 GMT + recorded_at: Sun, 31 Oct 2021 23:16:20 GMT recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_before.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_before.yml index 913cb413..9defc590 100644 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_before.yml +++ b/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_before.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: get - uri: https://api.workos.com/directories?before=before-id + uri: https://api.workos.com/directories?before=directory_01FGCPNV312FHFRCX0BYWHVSE1 body: encoding: US-ASCII string: '' @@ -14,7 +14,7 @@ http_interactions: Accept: - "*/*" User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.2.1 + - WorkOS; ruby/3.0.2; x86_64-darwin19; v1.6.0 Authorization: - Bearer response: @@ -22,14 +22,14 @@ http_interactions: code: 200 message: OK headers: - Server: - - Cowboy + Date: + - Sun, 31 Oct 2021 23:16:19 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked Connection: - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' Content-Security-Policy: - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src @@ -52,24 +52,38 @@ http_interactions: - no-referrer X-Xss-Protection: - '0' + Vary: + - Origin, Accept-Encoding + Access-Control-Allow-Credentials: + - 'true' X-Request-Id: - - d5e27591-7a56-468c-bffe-3a035f3bf26c - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '71' + - f6691c56-0bec-4224-b82c-ca59bab86bfc Etag: - - W/"47-5KOnfOsRy36pnaPjBxvaf6LRiGc" - Date: - - Mon, 07 Jun 2021 17:55:30 GMT + - W/"7fd-djK1P4BOpjA1geoLytAYBJmPVUE" Via: - 1.1 vegur + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=QqBEPSIOhswfJhIT0bQZkAmYAUYn4aciBJ0IqnBShioQo9rrCjEqe7v0ZLpVdPgxr7acbaWOaHuUZZM3gdx1ad7S5TDNP5sMWZJCRhwBG9qxX2A678OHDThvHQQqHSFjUq7CKfKt%2F3h%2FAOKRZA%3D%3D"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 6a709726ea2966dd-DFW + Alt-Svc: + - h3=":443"; ma=86400, h3-29=":443"; ma=86400, h3-28=":443"; ma=86400, h3-27=":443"; + ma=86400 body: - encoding: UTF-8 - string: '{"object":"list","listMetadata":{"before":null,"after":null},"data":[{"object":"directory","id":"directory_01F7796W20KW0CXEQQEYENT0ZC","organization_id":"org_01EZDF20TZEJXKPSX2BJRN6TV6","name":"Bamboo - Test","external_key":"rPzV4pdpbaUiKsc6","type":"bamboohr","state":"unlinked","domain":"foo-corp.com", "created_at":"2021-07-02T19:15:39.556Z","updated_at":"2021-07-02T19:31:28.499Z"},{"object":"directory","id":"directory_01F5ZY7XVQZ3DRYEZTH1EPA8BS","organization_id":"org_01EZDF20TZEJXKPSX2BJRN6TV6","name":"Foo - Corp","external_key":"qV4eyK99QGUaYYa0","type":"okta scim v2.0","state":"linked","domain":"foo-corp.com", "created_at":"2021-07-02T19:15:39.556Z","updated_at":"2021-07-02T19:31:28.499Z"},{"object":"directory","id":"directory_01F5XHH1QHX6C2F0Z6WG9YPGCJ","organization_id":"org_01F29YJ068E52HGEB8ZQGC9MJG","name":"Example - Azure SCIM","external_key":"YDKJvbWHKKg66cSk","type":"azure scim v2.0","state":"linked","domain":"example.com", "created_at":"2021-07-02T19:15:39.556Z","updated_at":"2021-07-02T19:31:28.499Z"}]}' + encoding: ASCII-8BIT + string: '{"object":"list","data":[{"object":"directory","id":"directory_01FG7FERZ204FKVG0YJA2CKFNG","organization_id":"org_01FG52B571GYMYNX3JNY5X3QAK","name":"Azure + Test","external_key":"UtCjmfF8gmEiOU0O","type":"azure scim v2.0","state":"linked","created_at":"2021-09-22T19:24:26.462Z","updated_at":"2021-10-27T15:50:20.636Z","domain":"example.com"},{"object":"directory","id":"directory_01FG226GXGR369PTWYGFNDWR9D","organization_id":"org_01FCPEJXEZR4DSBA625YMGQT9N","name":"JumpCloud + Test","external_key":"NRgx1V0pe8m4ai6u","type":"generic scim v2.0","state":"linked","created_at":"2021-09-20T16:56:32.434Z","updated_at":"2021-10-27T15:50:20.888Z","domain":"example.io"},{"object":"directory","id":"directory_01FFR1120F90Z4YJC29JT37VK0","organization_id":"org_01F8873JSZWN1MJCDN537FEK1H","name":"Azure","external_key":"rAaT6GNCDuyyYkKq","type":"azure + scim v2.0","state":"linked","created_at":"2021-09-16T19:23:40.419Z","updated_at":"2021-10-27T15:50:19.998Z"},{"object":"directory","id":"directory_01FE1VTQYEQF7S3T2G0R2MFHN9","organization_id":"org_01FCPEJXEZR4DSBA625YMGQT9N","name":"Okta + SCIM test","external_key":"JCik62hLK6CA804q","type":"okta scim v2.0","state":"linked","created_at":"2021-08-26T18:33:51.309Z","updated_at":"2021-10-27T15:50:19.921Z","domain":"example.io"},{"object":"directory","id":"directory_01FCV1FRW3D93X8VBZBCAQWEVS","organization_id":"org_01F9293WD2PDEEV4Y625XPZVG7","name":"Testing","external_key":"p2TZ3heuEoyU2kWk","type":"azure + scim v2.0","state":"linked","created_at":"2021-08-11T16:42:20.416Z","updated_at":"2021-10-27T15:50:19.430Z","domain":"foo-corp.com"},{"object":"directory","id":"directory_01F9M7F68PZP8QXP8G7X5QRHS7","organization_id":"org_01F8873JSZWN1MJCDN537FEK1H","name":"Example + Directory","external_key":"houUTobogoaaI0A0","type":"okta scim v2.0","state":"linked","created_at":"2021-07-02T18:25:06.343Z","updated_at":"2021-10-27T15:50:14.624Z"}],"list_metadata":{"before":null,"after":"directory_01FG7FERZ204FKVG0YJA2CKFNG"},"listMetadata":{"before":null,"after":"directory_01FG7FERZ204FKVG0YJA2CKFNG"}}' http_version: - recorded_at: Mon, 07 Jun 2021 17:55:30 GMT + recorded_at: Sun, 31 Oct 2021 23:16:19 GMT recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_domain.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_domain.yml index a5923d3a..29effe63 100644 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_domain.yml +++ b/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_domain.yml @@ -14,7 +14,7 @@ http_interactions: Accept: - "*/*" User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.2.1 + - WorkOS; ruby/3.0.2; x86_64-darwin19; v1.6.0 Authorization: - Bearer response: @@ -22,14 +22,14 @@ http_interactions: code: 200 message: OK headers: - Server: - - Cowboy + Date: + - Sun, 31 Oct 2021 23:03:01 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked Connection: - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' Content-Security-Policy: - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src @@ -52,22 +52,33 @@ http_interactions: - no-referrer X-Xss-Protection: - '0' + Vary: + - Origin, Accept-Encoding + Access-Control-Allow-Credentials: + - 'true' X-Request-Id: - - d3cd212f-5dc1-4e08-ab1f-69e33bebd9ca - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '539' + - 6d450b69-226e-43b9-85e2-a9af8acc3587 Etag: - - W/"21b-d3KisYEu0vvI9FJFreAktGIgT+c" - Date: - - Mon, 07 Jun 2021 17:55:29 GMT + - W/"1ae-fFF8nGLOuVotMa13kni7myHqhLI" Via: - 1.1 vegur + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=8ezv4P5avuKkdxcUh1hzoLa%2B%2BqrY3KNgK6vvzH8%2F57%2B3ByY9kRBf%2By1wrM7Q84StvoG4mBzl9qAmmpOPIVCiMiZjpY2rB3WJwY5ZcJ7Mc0qAHhwH5oE88orepnesd5BIZUO0hViBpvfcyJ8lfA%3D%3D"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 6a7083ab7fa8ecaf-DFW + Alt-Svc: + - h3=":443"; ma=86400, h3-29=":443"; ma=86400, h3-28=":443"; ma=86400, h3-27=":443"; + ma=86400 body: - encoding: UTF-8 - string: '{"object":"list","listMetadata":{"before":null,"after":null},"data":[{"object":"directory","id":"directory_01F5ZY7XVQZ3DRYEZTH1EPA8BS","organization_id":"org_01EZDF20TZEJXKPSX2BJRN6TV6","name":"Foo - Corp","external_key":"qV4eyK99QGUaYYa0","type":"okta scim v2.0","state":"linked","domain":"foo-corp.com", "created_at":"2021-07-02T19:15:39.556Z","updated_at":"2021-07-02T19:31:28.499Z"}]}' + encoding: ASCII-8BIT + string: '{"object":"list","data":[{"object":"directory","id":"directory_01FCV1FRW3D93X8VBZBCAQWEVS","organization_id":"org_01F9293WD2PDEEV4Y625XPZVG7","name":"Testing","external_key":"p2TZ3heuEoyU2kWk","type":"azure + scim v2.0","state":"linked","created_at":"2021-08-11T16:42:20.416Z","updated_at":"2021-10-27T15:50:19.430Z","domain":"foo-corp.com"}],"list_metadata":{"before":null,"after":null},"listMetadata":{"before":null,"after":null}}' http_version: - recorded_at: Mon, 07 Jun 2021 17:55:29 GMT + recorded_at: Sun, 31 Oct 2021 23:03:01 GMT recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_limit.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_limit.yml index d1ec5ebe..6daaf611 100644 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_limit.yml +++ b/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_limit.yml @@ -14,7 +14,7 @@ http_interactions: Accept: - "*/*" User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.2.1 + - WorkOS; ruby/3.0.2; x86_64-darwin19; v1.6.0 Authorization: - Bearer response: @@ -22,14 +22,14 @@ http_interactions: code: 200 message: OK headers: - Server: - - Cowboy + Date: + - Sun, 31 Oct 2021 23:03:02 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked Connection: - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' Content-Security-Policy: - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src @@ -52,23 +52,34 @@ http_interactions: - no-referrer X-Xss-Protection: - '0' + Vary: + - Origin, Accept-Encoding + Access-Control-Allow-Credentials: + - 'true' X-Request-Id: - - 64e81466-93f3-4496-a218-53982dbf6614 - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '573' + - 5ce37d38-1376-429a-9052-f8b3a20b7a1f Etag: - - W/"23d-dw0vE9mpthzl0ajnZ3YLimmU4ZU" - Date: - - Mon, 07 Jun 2021 17:55:31 GMT + - W/"32e-Omiowe6KK7MTqS3mgnIBMR53RMc" Via: - 1.1 vegur + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=FokV%2F1WK8Sg4dLf6m6Id%2F8wfHWKcdGsLenHbJdpxkh6Pc8TLsRsSD68RDAeDY%2FwavJ%2Bf1TjFwDsuIF%2FV2bPMJFMAqZ6uinTANK2iNXp8FGA9pM98aa9v8bekYflxceYXqDzkW8VhWtv6Wiv%2BsQ%3D%3D"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 6a7083b1f8086799-DFW + Alt-Svc: + - h3=":443"; ma=86400, h3-29=":443"; ma=86400, h3-28=":443"; ma=86400, h3-27=":443"; + ma=86400 body: - encoding: UTF-8 - string: '{"object":"list","listMetadata":{"before":"directory_01F5ZY7XVQZ3DRYEZTH1EPA8BS","after":null},"data":[{"object":"directory","id":"directory_01F7796W20KW0CXEQQEYENT0ZC","organization_id":"org_01EZDF20TZEJXKPSX2BJRN6TV6","name":"Bamboo - Test","external_key":"rPzV4pdpbaUiKsc6","type":"bamboohr","state":"unlinked","domain":"foo-corp.com", "created_at":"2021-07-02T19:15:39.556Z","updated_at":"2021-07-02T19:31:28.499Z"},{"object":"directory","id":"directory_01F5ZY7XVQZ3DRYEZTH1EPA8BS","organization_id":"org_01EZDF20TZEJXKPSX2BJRN6TV6","name":"Foo - Corp","external_key":"qV4eyK99QGUaYYa0","type":"okta scim v2.0","state":"linked","domain":"foo-corp.com", "created_at":"2021-07-02T19:15:39.556Z","updated_at":"2021-07-02T19:31:28.499Z"}]}' + encoding: ASCII-8BIT + string: '{"object":"list","data":[{"object":"directory","id":"directory_01FK3HFFGMC2WF32RR8SKWC8KA","organization_id":"org_01FHRF60X0CDBB8F6A0YGSJJ2B","name":"Azure + Set Up Test","external_key":"Ii2mw43BMAIqiKuA","type":"azure scim v2.0","state":"linked","created_at":"2021-10-28T13:29:54.451Z","updated_at":"2021-10-28T13:32:03.737Z"},{"object":"directory","id":"directory_01FK17DWRHH7APAFXT5B52PV0W","organization_id":"org_01F6Q6TFP7RD2PF6J03ANNWDKV","name":"Testing + Active Attribute","external_key":"QArgyQQkq4G0MquM","type":"azure scim v2.0","state":"linked","created_at":"2021-10-27T15:55:47.856Z","updated_at":"2021-10-27T16:03:43.990Z","domain":"example.me"}],"list_metadata":{"before":"directory_01FK17DWRHH7APAFXT5B52PV0W","after":null},"listMetadata":{"before":"directory_01FK17DWRHH7APAFXT5B52PV0W","after":null}}' http_version: - recorded_at: Mon, 07 Jun 2021 17:55:31 GMT + recorded_at: Sun, 31 Oct 2021 23:03:02 GMT recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_no_options.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_no_options.yml index 6583749d..85c689e2 100644 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_no_options.yml +++ b/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_no_options.yml @@ -14,7 +14,7 @@ http_interactions: Accept: - "*/*" User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.2.1 + - WorkOS; ruby/3.0.2; x86_64-darwin19; v1.6.0 Authorization: - Bearer response: @@ -22,14 +22,14 @@ http_interactions: code: 200 message: OK headers: - Server: - - Cowboy + Date: + - Sun, 31 Oct 2021 23:03:01 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked Connection: - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' Content-Security-Policy: - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src @@ -52,24 +52,42 @@ http_interactions: - no-referrer X-Xss-Protection: - '0' + Vary: + - Origin, Accept-Encoding + Access-Control-Allow-Credentials: + - 'true' X-Request-Id: - - 0f6aa030-02d6-456e-960b-60682ab134d0 - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '784' + - 6009e44d-df2c-40f3-86ad-929ea9362079 Etag: - - W/"310-fBrsCTIA95j4JLo4UR8X2zBThYQ" - Date: - - Mon, 07 Jun 2021 17:55:29 GMT + - W/"cc4-a76uP4WPcu7cTLA79G0DPZmGW9Q" Via: - 1.1 vegur + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=O7wQC%2B7g1ppMHWz9lao8DR2my83z8XtBX68EnYTeP8X1d4tSho2n8jpWq%2FT4xaKExSPn%2BnvlIotIUwtrZ5pkoULZQQvn1vHxHBE3eRKYZi7W0TO86ct3jtxDne%2B3FLOzLjCmkwYVgEEjkeb5Jg%3D%3D"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 6a7083a96c520bef-DFW + Alt-Svc: + - h3=":443"; ma=86400, h3-29=":443"; ma=86400, h3-28=":443"; ma=86400, h3-27=":443"; + ma=86400 body: - encoding: UTF-8 - string: '{"object":"list","listMetadata":{"before":"before-id","after":null},"data":[{"object":"directory","id":"directory_01F7796W20KW0CXEQQEYENT0ZC","organization_id":"org_01EZDF20TZEJXKPSX2BJRN6TV6","name":"Bamboo - Test","external_key":"rPzV4pdpbaUiKsc6","type":"bamboohr","state":"unlinked","domain":"foo-corp.com", "created_at":"2021-07-02T19:15:39.556Z","updated_at":"2021-07-02T19:31:28.499Z"},{"object":"directory","id":"directory_01F5ZY7XVQZ3DRYEZTH1EPA8BS","organization_id":"org_01EZDF20TZEJXKPSX2BJRN6TV6","name":"Foo - Corp","external_key":"qV4eyK99QGUaYYa0","type":"okta scim v2.0","state":"linked","domain":"foo-corp.com", "created_at":"2021-07-02T19:15:39.556Z","updated_at":"2021-07-02T19:31:28.499Z"},{"object":"directory","id":"directory_01F5XHH1QHX6C2F0Z6WG9YPGCJ","organization_id":"org_01F29YJ068E52HGEB8ZQGC9MJG","name":"Example - Azure SCIM","external_key":"YDKJvbWHKKg66cSk","type":"azure scim v2.0","state":"linked","domain":"example.com", "created_at":"2021-07-02T19:15:39.556Z","updated_at":"2021-07-02T19:31:28.499Z"}]}' + encoding: ASCII-8BIT + string: '{"object":"list","data":[{"object":"directory","id":"directory_01FK3HFFGMC2WF32RR8SKWC8KA","organization_id":"org_01FHRF60X0CDBB8F6A0YGSJJ2B","name":"Azure + Set Up Test","external_key":"Ii2mw43BMAIqiKuA","type":"azure scim v2.0","state":"linked","created_at":"2021-10-28T13:29:54.451Z","updated_at":"2021-10-28T13:32:03.737Z"},{"object":"directory","id":"directory_01FK17DWRHH7APAFXT5B52PV0W","organization_id":"org_01F6Q6TFP7RD2PF6J03ANNWDKV","name":"Testing + Active Attribute","external_key":"QArgyQQkq4G0MquM","type":"azure scim v2.0","state":"linked","created_at":"2021-10-27T15:55:47.856Z","updated_at":"2021-10-27T16:03:43.990Z","domain":"example.me"},{"object":"directory","id":"directory_01FHZKS052FGZQQCZHAX0E4AC0","organization_id":"org_01FHRF60X0CDBB8F6A0YGSJJ2B","name":"Okta + SCIM Test","external_key":"z76YkVQ9vEK0AUyy","type":"okta scim v2.0","state":"linked","created_at":"2021-10-14T14:37:24.004Z","updated_at":"2021-10-27T15:50:21.248Z"},{"object":"directory","id":"directory_01FGCQE0KD0V01GB46NJ7871F7","organization_id":"org_01FGCPJPQ35DR0WGGGBEC2V1GN","name":"Azure + Test","external_key":"S16nSw4AaAyW06ia","type":"azure scim v2.0","state":"linked","created_at":"2021-09-24T20:20:02.285Z","updated_at":"2021-10-27T15:50:21.579Z"},{"object":"directory","id":"directory_01FGCPNV312FHFRCX0BYWHVSE1","organization_id":"org_01FGCPJPQ35DR0WGGGBEC2V1GN","name":"Jump + Cloud Test","external_key":"amuPHnduKW0WQWmc","type":"generic scim v2.0","state":"linked","created_at":"2021-09-24T20:06:50.208Z","updated_at":"2021-10-27T15:50:21.493Z"},{"object":"directory","id":"directory_01FG7FERZ204FKVG0YJA2CKFNG","organization_id":"org_01FG52B571GYMYNX3JNY5X3QAK","name":"Azure + Test","external_key":"UtCjmfF8gmEiOU0O","type":"azure scim v2.0","state":"linked","created_at":"2021-09-22T19:24:26.462Z","updated_at":"2021-10-27T15:50:20.636Z","domain":"example.com"},{"object":"directory","id":"directory_01FG226GXGR369PTWYGFNDWR9D","organization_id":"org_01FCPEJXEZR4DSBA625YMGQT9N","name":"JumpCloud + Test","external_key":"NRgx1V0pe8m4ai6u","type":"generic scim v2.0","state":"linked","created_at":"2021-09-20T16:56:32.434Z","updated_at":"2021-10-27T15:50:20.888Z","domain":"example.io"},{"object":"directory","id":"directory_01FFR1120F90Z4YJC29JT37VK0","organization_id":"org_01F8873JSZWN1MJCDN537FEK1H","name":"Azure","external_key":"rAaT6GNCDuyyYkKq","type":"azure + scim v2.0","state":"linked","created_at":"2021-09-16T19:23:40.419Z","updated_at":"2021-10-27T15:50:19.998Z"},{"object":"directory","id":"directory_01FE1VTQYEQF7S3T2G0R2MFHN9","organization_id":"org_01FCPEJXEZR4DSBA625YMGQT9N","name":"Okta + SCIM test","external_key":"JCik62hLK6CA804q","type":"okta scim v2.0","state":"linked","created_at":"2021-08-26T18:33:51.309Z","updated_at":"2021-10-27T15:50:19.921Z","domain":"example.io"},{"object":"directory","id":"directory_01FCV1FRW3D93X8VBZBCAQWEVS","organization_id":"org_01F9293WD2PDEEV4Y625XPZVG7","name":"Testing","external_key":"p2TZ3heuEoyU2kWk","type":"azure + scim v2.0","state":"linked","created_at":"2021-08-11T16:42:20.416Z","updated_at":"2021-10-27T15:50:19.430Z","domain":"foo-corp.com"}],"list_metadata":{"before":"before-id","after":null},"listMetadata":{"before":"before-id","after":null}}' http_version: - recorded_at: Mon, 07 Jun 2021 17:55:29 GMT + recorded_at: Sun, 31 Oct 2021 23:03:01 GMT recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_search.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_search.yml index ea495a77..a6f68abe 100644 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_search.yml +++ b/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_search.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: get - uri: https://api.workos.com/directories?search=Foo + uri: https://api.workos.com/directories?search=Testing body: encoding: US-ASCII string: '' @@ -14,7 +14,7 @@ http_interactions: Accept: - "*/*" User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.2.1 + - WorkOS; ruby/3.0.2; x86_64-darwin19; v1.6.0 Authorization: - Bearer response: @@ -22,14 +22,14 @@ http_interactions: code: 200 message: OK headers: - Server: - - Cowboy + Date: + - Sun, 31 Oct 2021 23:16:19 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked Connection: - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' Content-Security-Policy: - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src @@ -52,22 +52,34 @@ http_interactions: - no-referrer X-Xss-Protection: - '0' + Vary: + - Origin, Accept-Encoding + Access-Control-Allow-Credentials: + - 'true' X-Request-Id: - - 5e0ab2f6-9af6-467d-a5a0-352425d8be64 - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '305' + - 11c4f81a-6849-4809-8c57-a3d1b56612eb Etag: - - W/"131-TOcWi8K5/vWBSqHH1IZu5atd73o" - Date: - - Mon, 07 Jun 2021 17:55:30 GMT + - W/"2f8-aWsjddKqVKL34/+wL752xfuiH2Q" Via: - 1.1 vegur + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=t8d6LCrGu92dvmMmTECbvhqH82TcvvWNxTw%2Bz6jGMz8S0Y7mg91uXsTylK4KEs9uMr5gnnYAi%2FHAq1FwNpt5MoYMFTqfR1wDpE3UIsNusj%2F1TxwAUwx2J3BclqJl0riP44WITzFLdv66r3kd1g%3D%3D"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 6a7097250eb40baf-DFW + Alt-Svc: + - h3=":443"; ma=86400, h3-29=":443"; ma=86400, h3-28=":443"; ma=86400, h3-27=":443"; + ma=86400 body: - encoding: UTF-8 - string: '{"object":"list","listMetadata":{"before":null,"after":null},"data":[{"object":"directory","id":"directory_01F5ZY7XVQZ3DRYEZTH1EPA8BS","organization_id":"org_01EZDF20TZEJXKPSX2BJRN6TV6","name":"Foo - Corp","external_key":"qV4eyK99QGUaYYa0","type":"okta scim v2.0","state":"linked","domain":"foo-corp.com", "created_at":"2021-07-02T19:15:39.556Z","updated_at":"2021-07-02T19:31:28.499Z"}]}' + encoding: ASCII-8BIT + string: '{"object":"list","data":[{"object":"directory","id":"directory_01FK17DWRHH7APAFXT5B52PV0W","organization_id":"org_01F6Q6TFP7RD2PF6J03ANNWDKV","name":"Testing + Active Attribute","external_key":"QArgyQQkq4G0MquM","type":"azure scim v2.0","state":"linked","created_at":"2021-10-27T15:55:47.856Z","updated_at":"2021-10-27T16:03:43.990Z","domain":"example.me"},{"object":"directory","id":"directory_01FCV1FRW3D93X8VBZBCAQWEVS","organization_id":"org_01F9293WD2PDEEV4Y625XPZVG7","name":"Testing","external_key":"p2TZ3heuEoyU2kWk","type":"azure + scim v2.0","state":"linked","created_at":"2021-08-11T16:42:20.416Z","updated_at":"2021-10-27T15:50:19.430Z","domain":"foo-corp.com"}],"list_metadata":{"before":null,"after":null},"listMetadata":{"before":null,"after":null}}' http_version: - recorded_at: Mon, 07 Jun 2021 17:55:30 GMT + recorded_at: Sun, 31 Oct 2021 23:16:19 GMT recorded_with: VCR 5.0.0