workos 1.3.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/Gemfile.lock +3 -3
- data/lib/workos/client.rb +3 -6
- data/lib/workos/connection.rb +9 -1
- data/lib/workos/directory.rb +9 -1
- data/lib/workos/directory_user.rb +4 -1
- data/lib/workos/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 +2 -0
- data/lib/workos/types/directory_struct.rb +2 -0
- data/lib/workos/types/directory_user_struct.rb +1 -0
- data/lib/workos/types/organization_struct.rb +3 -0
- data/lib/workos/types/profile_struct.rb +1 -0
- data/lib/workos/types/provider_enum.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 +21 -19
- 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 +17 -13
- data/spec/lib/workos/webhooks_spec.rb +190 -0
- data/spec/spec_helper.rb +3 -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 +3 -3
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_before.yml +3 -3
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_domain.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_limit.yml +2 -2
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_no_options.yml +3 -3
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_search.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_after.yml +128 -28
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_before.yml +31 -18
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_directory.yml +136 -35
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_group.yml +128 -18
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_limit.yml +131 -17
- data/spec/support/fixtures/vcr_cassettes/organization/create.yml +28 -16
- data/spec/support/fixtures/vcr_cassettes/organization/get.yml +27 -16
- data/spec/support/fixtures/vcr_cassettes/organization/list.yml +29 -14
- data/spec/support/fixtures/vcr_cassettes/organization/update.yml +27 -16
- data/spec/support/fixtures/vcr_cassettes/sso/get_connection_with_valid_id.yml +28 -16
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_after.yml +25 -15
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_before.yml +28 -15
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_connection_type.yml +31 -14
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_domain.yml +27 -13
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_limit.yml +24 -15
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_no_options.yml +30 -14
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_organization_id.yml +28 -14
- 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 +12 -5
- data/spec/support/fixtures/vcr_cassettes/organization/update_invalid.yml +0 -73
@@ -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: 1.
|
4
|
+
version: 1.6.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-09-23 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
|
@@ -315,7 +319,6 @@ files:
|
|
315
319
|
- spec/support/fixtures/vcr_cassettes/organization/get_invalid.yml
|
316
320
|
- spec/support/fixtures/vcr_cassettes/organization/list.yml
|
317
321
|
- spec/support/fixtures/vcr_cassettes/organization/update.yml
|
318
|
-
- spec/support/fixtures/vcr_cassettes/organization/update_invalid.yml
|
319
322
|
- spec/support/fixtures/vcr_cassettes/passwordless/create_session.yml
|
320
323
|
- spec/support/fixtures/vcr_cassettes/passwordless/create_session_invalid.yml
|
321
324
|
- spec/support/fixtures/vcr_cassettes/passwordless/send_session.yml
|
@@ -336,6 +339,8 @@ files:
|
|
336
339
|
- spec/support/fixtures/vcr_cassettes/sso/list_connections/with_organization_id.yml
|
337
340
|
- spec/support/fixtures/vcr_cassettes/sso/profile.yml
|
338
341
|
- spec/support/profile.txt
|
342
|
+
- spec/support/shared_examples/client_spec.rb
|
343
|
+
- spec/support/webhook_payload.txt
|
339
344
|
- workos.gemspec
|
340
345
|
homepage: https://github.com/workos-inc/workos-ruby
|
341
346
|
licenses:
|
@@ -357,7 +362,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
357
362
|
- !ruby/object:Gem::Version
|
358
363
|
version: '0'
|
359
364
|
requirements: []
|
360
|
-
rubygems_version: 3.2.
|
365
|
+
rubygems_version: 3.2.27
|
361
366
|
signing_key:
|
362
367
|
specification_version: 4
|
363
368
|
summary: API client for WorkOS
|
@@ -369,6 +374,7 @@ test_files:
|
|
369
374
|
- spec/lib/workos/passwordless_spec.rb
|
370
375
|
- spec/lib/workos/portal_spec.rb
|
371
376
|
- spec/lib/workos/sso_spec.rb
|
377
|
+
- spec/lib/workos/webhooks_spec.rb
|
372
378
|
- spec/spec_helper.rb
|
373
379
|
- spec/support/fixtures/vcr_cassettes/audit_trail/create_event.yml
|
374
380
|
- spec/support/fixtures/vcr_cassettes/audit_trail/create_event_custom_idempotency_key.yml
|
@@ -408,7 +414,6 @@ test_files:
|
|
408
414
|
- spec/support/fixtures/vcr_cassettes/organization/get_invalid.yml
|
409
415
|
- spec/support/fixtures/vcr_cassettes/organization/list.yml
|
410
416
|
- spec/support/fixtures/vcr_cassettes/organization/update.yml
|
411
|
-
- spec/support/fixtures/vcr_cassettes/organization/update_invalid.yml
|
412
417
|
- spec/support/fixtures/vcr_cassettes/passwordless/create_session.yml
|
413
418
|
- spec/support/fixtures/vcr_cassettes/passwordless/create_session_invalid.yml
|
414
419
|
- spec/support/fixtures/vcr_cassettes/passwordless/send_session.yml
|
@@ -429,3 +434,5 @@ test_files:
|
|
429
434
|
- spec/support/fixtures/vcr_cassettes/sso/list_connections/with_organization_id.yml
|
430
435
|
- spec/support/fixtures/vcr_cassettes/sso/profile.yml
|
431
436
|
- spec/support/profile.txt
|
437
|
+
- spec/support/shared_examples/client_spec.rb
|
438
|
+
- spec/support/webhook_payload.txt
|
@@ -1,73 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: put
|
5
|
-
uri: https://api.workos.com/organizations/org_01F29YJ068E52HGEB8ZQGC9MJG
|
6
|
-
body:
|
7
|
-
encoding: UTF-8
|
8
|
-
string: '{"domains":["example.com"],"name":"Test Organization 2"}'
|
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/3.0.1; x86_64-darwin19; v0.11.1
|
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
|
-
- 6ba2cbf9-76e3-4a6a-8ebe-d25edb366ed0
|
57
|
-
Content-Type:
|
58
|
-
- application/json; charset=utf-8
|
59
|
-
Content-Length:
|
60
|
-
- '205'
|
61
|
-
Etag:
|
62
|
-
- W/"cd-mlRMlyyz/LtzInRhAghs1B+BT4s"
|
63
|
-
Date:
|
64
|
-
- Wed, 05 May 2021 22:14:10 GMT
|
65
|
-
Via:
|
66
|
-
- 1.1 vegur
|
67
|
-
body:
|
68
|
-
encoding: UTF-8
|
69
|
-
string: '{"object":"organization","id":"org_01F29YJ068E52HGEB8ZQGC9MJG","name":"Test
|
70
|
-
Organization 2","domains":[{"object":"organization_domain","id":"org_domain_01F4Z9GY3089GV4SENXWZ9RBX1","domain":"example.com"}]}'
|
71
|
-
http_version:
|
72
|
-
recorded_at: Wed, 05 May 2021 22:14:10 GMT
|
73
|
-
recorded_with: VCR 5.0.0
|