workos 1.4.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/.ruby-version +1 -1
- data/.semaphore/semaphore.yml +2 -2
- data/Gemfile.lock +3 -3
- data/lib/workos/client.rb +3 -6
- data/lib/workos/connection.rb +10 -2
- data/lib/workos/directory.rb +11 -3
- data/lib/workos/directory_sync.rb +29 -0
- data/lib/workos/directory_user.rb +4 -1
- data/lib/workos/errors.rb +4 -0
- data/lib/workos/organization.rb +10 -1
- data/lib/workos/organizations.rb +18 -4
- data/lib/workos/profile.rb +7 -2
- data/lib/workos/types/connection_struct.rb +3 -1
- data/lib/workos/types/directory_struct.rb +4 -2
- data/lib/workos/types/directory_user_struct.rb +1 -0
- data/lib/workos/types/organization_struct.rb +3 -0
- data/lib/workos/types/profile_struct.rb +1 -0
- data/lib/workos/types/webhook_struct.rb +14 -0
- data/lib/workos/types.rb +1 -0
- data/lib/workos/version.rb +1 -1
- data/lib/workos/webhook.rb +47 -0
- data/lib/workos/webhooks.rb +168 -0
- data/lib/workos.rb +3 -0
- data/spec/lib/workos/audit_trail_spec.rb +2 -0
- data/spec/lib/workos/directory_sync_spec.rb +64 -29
- data/spec/lib/workos/organizations_spec.rb +13 -11
- data/spec/lib/workos/passwordless_spec.rb +2 -0
- data/spec/lib/workos/portal_spec.rb +2 -0
- data/spec/lib/workos/sso_spec.rb +16 -12
- data/spec/lib/workos/webhooks_spec.rb +190 -0
- data/spec/spec_helper.rb +3 -0
- data/spec/support/fixtures/vcr_cassettes/{organization/update_invalid.yml → directory_sync/get_directory_with_invalid_id.yml} +35 -25
- data/spec/support/fixtures/vcr_cassettes/directory_sync/get_directory_with_valid_id.yml +84 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/get_user.yml +40 -16
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_after.yml +34 -22
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_before.yml +36 -22
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_domain.yml +30 -19
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_limit.yml +31 -20
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_no_options.yml +39 -21
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_search.yml +32 -20
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_after.yml +128 -28
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_before.yml +31 -18
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_directory.yml +136 -35
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_group.yml +128 -18
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_limit.yml +131 -17
- data/spec/support/fixtures/vcr_cassettes/organization/create.yml +28 -16
- data/spec/support/fixtures/vcr_cassettes/organization/get.yml +27 -16
- data/spec/support/fixtures/vcr_cassettes/organization/list.yml +29 -14
- data/spec/support/fixtures/vcr_cassettes/organization/update.yml +27 -16
- data/spec/support/fixtures/vcr_cassettes/sso/get_connection_with_valid_id.yml +28 -16
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_after.yml +25 -15
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_before.yml +28 -15
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_connection_type.yml +31 -14
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_domain.yml +27 -13
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_limit.yml +24 -15
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_no_options.yml +30 -14
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_organization_id.yml +28 -14
- data/spec/support/fixtures/vcr_cassettes/sso/profile.yml +1 -1
- data/spec/support/profile.txt +1 -1
- data/spec/support/shared_examples/client_spec.rb +16 -0
- data/spec/support/webhook_payload.txt +1 -0
- metadata +16 -5
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# typed: false
|
|
3
|
+
|
|
4
|
+
RSpec.shared_examples 'client' do
|
|
5
|
+
subject(:client) { described_class.client }
|
|
6
|
+
|
|
7
|
+
it { is_expected.to be_kind_of(Net::HTTP) }
|
|
8
|
+
|
|
9
|
+
it 'assigns use_ssl' do
|
|
10
|
+
expect(client.use_ssl?).to be true
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
it 'returns new instance' do
|
|
14
|
+
expect(described_class.client.object_id).to_not eq described_class.client.object_id
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id": "wh_123","data":{"id":"directory_user_01FAEAJCR3ZBZ30D8BD1924TVG","state":"active","emails":[{"type":"work","value":"blair@foo-corp.com","primary":true}],"idp_id":"00u1e8mutl6wlH3lL4x7","object":"directory_user","username":"blair@foo-corp.com","last_name":"Lunceford","first_name":"Blair","directory_id":"directory_01F9M7F68PZP8QXP8G7X5QRHS7","raw_attributes":{"name":{"givenName":"Blair","familyName":"Lunceford","middleName":"Elizabeth","honorificPrefix":"Ms."},"title":"Developer Success Engineer","active":true,"emails":[{"type":"work","value":"blair@foo-corp.com","primary":true}],"groups":[],"locale":"en-US","schemas":["urn:ietf:params:scim:schemas:core:2.0:User","urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"],"userName":"blair@foo-corp.com","addresses":[{"region":"CO","primary":true,"locality":"Steamboat Springs","postalCode":"80487"}],"externalId":"00u1e8mutl6wlH3lL4x7","displayName":"Blair Lunceford","urn:ietf:params:scim:schemas:extension:enterprise:2.0:User":{"manager":{"value":"2","displayName":"Kathleen Chung"},"division":"Engineering","department":"Customer Success"}}},"event":"dsync.user.created"}
|
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: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- WorkOS
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-
|
|
11
|
+
date: 2021-11-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: sorbet-runtime
|
|
@@ -234,7 +234,10 @@ files:
|
|
|
234
234
|
- lib/workos/types/passwordless_session_struct.rb
|
|
235
235
|
- lib/workos/types/profile_struct.rb
|
|
236
236
|
- lib/workos/types/provider_enum.rb
|
|
237
|
+
- lib/workos/types/webhook_struct.rb
|
|
237
238
|
- lib/workos/version.rb
|
|
239
|
+
- lib/workos/webhook.rb
|
|
240
|
+
- lib/workos/webhooks.rb
|
|
238
241
|
- sorbet/config
|
|
239
242
|
- sorbet/rbi/gems/addressable.rbi
|
|
240
243
|
- sorbet/rbi/gems/ast.rbi
|
|
@@ -276,6 +279,7 @@ files:
|
|
|
276
279
|
- spec/lib/workos/passwordless_spec.rb
|
|
277
280
|
- spec/lib/workos/portal_spec.rb
|
|
278
281
|
- spec/lib/workos/sso_spec.rb
|
|
282
|
+
- spec/lib/workos/webhooks_spec.rb
|
|
279
283
|
- spec/spec_helper.rb
|
|
280
284
|
- spec/support/fixtures/vcr_cassettes/audit_trail/create_event.yml
|
|
281
285
|
- spec/support/fixtures/vcr_cassettes/audit_trail/create_event_custom_idempotency_key.yml
|
|
@@ -285,6 +289,8 @@ files:
|
|
|
285
289
|
- spec/support/fixtures/vcr_cassettes/audit_trail/get_events.yml
|
|
286
290
|
- spec/support/fixtures/vcr_cassettes/base/execute_request_unauthenticated.yml
|
|
287
291
|
- spec/support/fixtures/vcr_cassettes/directory_sync/delete_directory.yml
|
|
292
|
+
- spec/support/fixtures/vcr_cassettes/directory_sync/get_directory_with_invalid_id.yml
|
|
293
|
+
- spec/support/fixtures/vcr_cassettes/directory_sync/get_directory_with_valid_id.yml
|
|
288
294
|
- spec/support/fixtures/vcr_cassettes/directory_sync/get_group.yml
|
|
289
295
|
- spec/support/fixtures/vcr_cassettes/directory_sync/get_group_with_invalid_id.yml
|
|
290
296
|
- spec/support/fixtures/vcr_cassettes/directory_sync/get_user.yml
|
|
@@ -315,7 +321,6 @@ files:
|
|
|
315
321
|
- spec/support/fixtures/vcr_cassettes/organization/get_invalid.yml
|
|
316
322
|
- spec/support/fixtures/vcr_cassettes/organization/list.yml
|
|
317
323
|
- spec/support/fixtures/vcr_cassettes/organization/update.yml
|
|
318
|
-
- spec/support/fixtures/vcr_cassettes/organization/update_invalid.yml
|
|
319
324
|
- spec/support/fixtures/vcr_cassettes/passwordless/create_session.yml
|
|
320
325
|
- spec/support/fixtures/vcr_cassettes/passwordless/create_session_invalid.yml
|
|
321
326
|
- spec/support/fixtures/vcr_cassettes/passwordless/send_session.yml
|
|
@@ -336,6 +341,8 @@ files:
|
|
|
336
341
|
- spec/support/fixtures/vcr_cassettes/sso/list_connections/with_organization_id.yml
|
|
337
342
|
- spec/support/fixtures/vcr_cassettes/sso/profile.yml
|
|
338
343
|
- spec/support/profile.txt
|
|
344
|
+
- spec/support/shared_examples/client_spec.rb
|
|
345
|
+
- spec/support/webhook_payload.txt
|
|
339
346
|
- workos.gemspec
|
|
340
347
|
homepage: https://github.com/workos-inc/workos-ruby
|
|
341
348
|
licenses:
|
|
@@ -357,7 +364,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
357
364
|
- !ruby/object:Gem::Version
|
|
358
365
|
version: '0'
|
|
359
366
|
requirements: []
|
|
360
|
-
rubygems_version: 3.2.
|
|
367
|
+
rubygems_version: 3.2.31
|
|
361
368
|
signing_key:
|
|
362
369
|
specification_version: 4
|
|
363
370
|
summary: API client for WorkOS
|
|
@@ -369,6 +376,7 @@ test_files:
|
|
|
369
376
|
- spec/lib/workos/passwordless_spec.rb
|
|
370
377
|
- spec/lib/workos/portal_spec.rb
|
|
371
378
|
- spec/lib/workos/sso_spec.rb
|
|
379
|
+
- spec/lib/workos/webhooks_spec.rb
|
|
372
380
|
- spec/spec_helper.rb
|
|
373
381
|
- spec/support/fixtures/vcr_cassettes/audit_trail/create_event.yml
|
|
374
382
|
- spec/support/fixtures/vcr_cassettes/audit_trail/create_event_custom_idempotency_key.yml
|
|
@@ -378,6 +386,8 @@ test_files:
|
|
|
378
386
|
- spec/support/fixtures/vcr_cassettes/audit_trail/get_events.yml
|
|
379
387
|
- spec/support/fixtures/vcr_cassettes/base/execute_request_unauthenticated.yml
|
|
380
388
|
- spec/support/fixtures/vcr_cassettes/directory_sync/delete_directory.yml
|
|
389
|
+
- spec/support/fixtures/vcr_cassettes/directory_sync/get_directory_with_invalid_id.yml
|
|
390
|
+
- spec/support/fixtures/vcr_cassettes/directory_sync/get_directory_with_valid_id.yml
|
|
381
391
|
- spec/support/fixtures/vcr_cassettes/directory_sync/get_group.yml
|
|
382
392
|
- spec/support/fixtures/vcr_cassettes/directory_sync/get_group_with_invalid_id.yml
|
|
383
393
|
- spec/support/fixtures/vcr_cassettes/directory_sync/get_user.yml
|
|
@@ -408,7 +418,6 @@ test_files:
|
|
|
408
418
|
- spec/support/fixtures/vcr_cassettes/organization/get_invalid.yml
|
|
409
419
|
- spec/support/fixtures/vcr_cassettes/organization/list.yml
|
|
410
420
|
- spec/support/fixtures/vcr_cassettes/organization/update.yml
|
|
411
|
-
- spec/support/fixtures/vcr_cassettes/organization/update_invalid.yml
|
|
412
421
|
- spec/support/fixtures/vcr_cassettes/passwordless/create_session.yml
|
|
413
422
|
- spec/support/fixtures/vcr_cassettes/passwordless/create_session_invalid.yml
|
|
414
423
|
- spec/support/fixtures/vcr_cassettes/passwordless/send_session.yml
|
|
@@ -429,3 +438,5 @@ test_files:
|
|
|
429
438
|
- spec/support/fixtures/vcr_cassettes/sso/list_connections/with_organization_id.yml
|
|
430
439
|
- spec/support/fixtures/vcr_cassettes/sso/profile.yml
|
|
431
440
|
- spec/support/profile.txt
|
|
441
|
+
- spec/support/shared_examples/client_spec.rb
|
|
442
|
+
- spec/support/webhook_payload.txt
|