workos 2.3.0 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/workos/directory_group.rb +5 -1
- data/lib/workos/directory_user.rb +7 -1
- data/lib/workos/types/directory_group_struct.rb +1 -0
- data/lib/workos/types/directory_user_struct.rb +2 -0
- data/lib/workos/version.rb +1 -1
- data/spec/lib/workos/directory_sync_spec.rb +4 -1
- data/spec/support/fixtures/vcr_cassettes/directory_sync/get_group.yml +10 -12
- data/spec/support/fixtures/vcr_cassettes/directory_sync/get_user.yml +28 -31
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b8ce6f7bddb9f3bbee9713d7ec1674c487f1c9f963e7e57ee8e6b99b26e183a
|
4
|
+
data.tar.gz: de86e65fad32c780bc23ba9a2e2e7e611af89c2025f768d96ca51a59b5c23218
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82b37f71d2b099ccfde1f6d47f5a43392f275e093d130156796079be0f2ada5f8e787143991aa9b2d65878c5cd4ab052b5c81f60fe43e46e59619714c17b08c4
|
7
|
+
data.tar.gz: f02fbd38fedce2ac51834fb10196b6c79a1ed29013afb7f681ec9329df0e571035330f2a6f52bdb0c963bb0be5ade92b389962609f2d87cba8fd83bbca471a60
|
data/Gemfile.lock
CHANGED
@@ -9,7 +9,8 @@ module WorkOS
|
|
9
9
|
include HashProvider
|
10
10
|
extend T::Sig
|
11
11
|
|
12
|
-
attr_accessor :id, :directory_id, :idp_id, :name, :created_at, :updated_at,
|
12
|
+
attr_accessor :id, :directory_id, :idp_id, :name, :created_at, :updated_at,
|
13
|
+
:raw_attributes, :organization_id
|
13
14
|
|
14
15
|
# rubocop:disable Metrics/AbcSize
|
15
16
|
sig { params(json: String).void }
|
@@ -18,6 +19,7 @@ module WorkOS
|
|
18
19
|
|
19
20
|
@id = T.let(raw.id, String)
|
20
21
|
@directory_id = T.let(raw.directory_id, String)
|
22
|
+
@organization_id = raw.organization_id
|
21
23
|
@idp_id = T.let(raw.idp_id, String)
|
22
24
|
@name = T.let(raw.name, String)
|
23
25
|
@created_at = T.let(raw.created_at, String)
|
@@ -32,6 +34,7 @@ module WorkOS
|
|
32
34
|
{
|
33
35
|
id: id,
|
34
36
|
directory_id: directory_id,
|
37
|
+
organization_id: organization_id,
|
35
38
|
idp_id: idp_id,
|
36
39
|
name: name,
|
37
40
|
created_at: created_at,
|
@@ -53,6 +56,7 @@ module WorkOS
|
|
53
56
|
WorkOS::Types::DirectoryGroupStruct.new(
|
54
57
|
id: hash[:id],
|
55
58
|
directory_id: hash[:directory_id],
|
59
|
+
organization_id: hash[:organization_id],
|
56
60
|
idp_id: hash[:idp_id],
|
57
61
|
name: hash[:name],
|
58
62
|
created_at: hash[:created_at],
|
@@ -10,7 +10,7 @@ module WorkOS
|
|
10
10
|
extend T::Sig
|
11
11
|
|
12
12
|
attr_accessor :id, :idp_id, :emails, :first_name, :last_name, :username, :state,
|
13
|
-
:groups, :custom_attributes, :raw_attributes
|
13
|
+
:groups, :custom_attributes, :raw_attributes, :directory_id, :organization_id
|
14
14
|
|
15
15
|
# rubocop:disable Metrics/AbcSize
|
16
16
|
sig { params(json: String).void }
|
@@ -18,6 +18,8 @@ module WorkOS
|
|
18
18
|
raw = parse_json(json)
|
19
19
|
|
20
20
|
@id = T.let(raw.id, String)
|
21
|
+
@directory_id = T.let(raw.directory_id, String)
|
22
|
+
@organization_id = raw.organization_id
|
21
23
|
@idp_id = T.let(raw.idp_id, String)
|
22
24
|
@emails = T.let(raw.emails, Array)
|
23
25
|
@first_name = raw.first_name
|
@@ -35,6 +37,8 @@ module WorkOS
|
|
35
37
|
def to_json(*)
|
36
38
|
{
|
37
39
|
id: id,
|
40
|
+
directory_id: directory_id,
|
41
|
+
organization_id: organization_id,
|
38
42
|
idp_id: idp_id,
|
39
43
|
emails: emails,
|
40
44
|
first_name: first_name,
|
@@ -64,6 +68,8 @@ module WorkOS
|
|
64
68
|
|
65
69
|
WorkOS::Types::DirectoryUserStruct.new(
|
66
70
|
id: hash[:id],
|
71
|
+
directory_id: hash[:directory_id],
|
72
|
+
organization_id: hash[:organization_id],
|
67
73
|
idp_id: hash[:idp_id],
|
68
74
|
emails: hash[:emails],
|
69
75
|
first_name: hash[:first_name],
|
@@ -7,6 +7,8 @@ module WorkOS
|
|
7
7
|
# for the DirectoryUser class
|
8
8
|
class DirectoryUserStruct < T::Struct
|
9
9
|
const :id, String
|
10
|
+
const :directory_id, String
|
11
|
+
const :organization_id, T.nilable(String)
|
10
12
|
const :idp_id, String
|
11
13
|
const :emails, T::Array[T.untyped]
|
12
14
|
const :first_name, T.nilable(String)
|
data/lib/workos/version.rb
CHANGED
@@ -442,11 +442,12 @@ describe WorkOS::DirectorySync do
|
|
442
442
|
)
|
443
443
|
|
444
444
|
expect(group['directory_id']).to eq('directory_01G2Z8ADK5NPMVTWF48MVVE4HT')
|
445
|
+
expect(group['organization_id']).to eq('org_01EGS4P7QR31EZ4YWD1Z1XA176')
|
445
446
|
expect(group['idp_id']).to eq('01jlao4614two3d')
|
446
447
|
expect(group['name']).to eq('Sales')
|
447
448
|
expect(group.name).to eq('Sales')
|
448
449
|
expect(group['created_at']).to eq('2022-05-13T17:45:31.732Z')
|
449
|
-
expect(group['updated_at']).to eq('2022-
|
450
|
+
expect(group['updated_at']).to eq('2022-07-13T17:45:42.618Z')
|
450
451
|
end
|
451
452
|
end
|
452
453
|
end
|
@@ -471,6 +472,8 @@ describe WorkOS::DirectorySync do
|
|
471
472
|
)
|
472
473
|
|
473
474
|
expect(user['first_name']).to eq('Logan')
|
475
|
+
expect(user.directory_id).to eq('directory_01FAZYMST676QMTFN1DDJZZX87')
|
476
|
+
expect(user.organization_id).to eq('org_01FAZWCWR03DVWA83NCJYKKD54')
|
474
477
|
expect(user.first_name).to eq('Logan')
|
475
478
|
end
|
476
479
|
end
|
@@ -14,7 +14,7 @@ http_interactions:
|
|
14
14
|
Accept:
|
15
15
|
- "*/*"
|
16
16
|
User-Agent:
|
17
|
-
- WorkOS; ruby/
|
17
|
+
- WorkOS; ruby/2.7.2; arm64-darwin21; v2.3.0
|
18
18
|
Authorization:
|
19
19
|
- Bearer <API_KEY>
|
20
20
|
response:
|
@@ -23,7 +23,7 @@ http_interactions:
|
|
23
23
|
message: OK
|
24
24
|
headers:
|
25
25
|
Date:
|
26
|
-
-
|
26
|
+
- Thu, 14 Jul 2022 16:49:09 GMT
|
27
27
|
Content-Type:
|
28
28
|
- application/json; charset=utf-8
|
29
29
|
Transfer-Encoding:
|
@@ -37,7 +37,7 @@ http_interactions:
|
|
37
37
|
https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
|
38
38
|
''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
|
39
39
|
Etag:
|
40
|
-
- W/"
|
40
|
+
- W/"277-8j8DgAIILf/mCF7LCmvrqcqdwK4"
|
41
41
|
Expect-Ct:
|
42
42
|
- max-age=0
|
43
43
|
Referrer-Policy:
|
@@ -47,7 +47,7 @@ http_interactions:
|
|
47
47
|
Vary:
|
48
48
|
- Origin, Accept-Encoding
|
49
49
|
Via:
|
50
|
-
- 1.1 spaces-router (
|
50
|
+
- 1.1 spaces-router (b642bf20b975)
|
51
51
|
X-Content-Type-Options:
|
52
52
|
- nosniff
|
53
53
|
X-Dns-Prefetch-Control:
|
@@ -59,24 +59,22 @@ http_interactions:
|
|
59
59
|
X-Permitted-Cross-Domain-Policies:
|
60
60
|
- none
|
61
61
|
X-Request-Id:
|
62
|
-
-
|
62
|
+
- 0f21c2f3-e24a-e3a2-85d3-41ee9e45b3e2
|
63
63
|
X-Xss-Protection:
|
64
64
|
- '0'
|
65
65
|
Cf-Cache-Status:
|
66
66
|
- DYNAMIC
|
67
67
|
Report-To:
|
68
|
-
- '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=
|
68
|
+
- '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=Hnm%2BEiBTG2ROFxqX2mdwcp0HvQ173SgQlQDCmTmBQEbLv9w2dkcl2qMqYh44OSHRABBCkRfuJ2MtnHuqb6sQ5RjHRMKSCfRqklsOrgd%2FHo0PEE6mW0u%2BlZqBMIlN1BEp"}],"group":"cf-nel","max_age":604800}'
|
69
69
|
Nel:
|
70
70
|
- '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}'
|
71
71
|
Server:
|
72
72
|
- cloudflare
|
73
73
|
Cf-Ray:
|
74
|
-
-
|
75
|
-
Alt-Svc:
|
76
|
-
- h3=":443"; ma=86400, h3-29=":443"; ma=86400
|
74
|
+
- 72abc002fbd9f039-EWR
|
77
75
|
body:
|
78
76
|
encoding: ASCII-8BIT
|
79
|
-
string: '{"object":"directory_group","id":"directory_group_01G2Z8D4ZR8RJ03Y1W7P9K8NMG","idp_id":"01jlao4614two3d","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Sales","created_at":"2022-05-13T17:45:31.732Z","updated_at":"2022-
|
80
|
-
http_version:
|
81
|
-
recorded_at:
|
77
|
+
string: '{"object":"directory_group","id":"directory_group_01G2Z8D4ZR8RJ03Y1W7P9K8NMG","idp_id":"01jlao4614two3d","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","organization_id":"org_01EGS4P7QR31EZ4YWD1Z1XA176","name":"Sales","created_at":"2022-05-13T17:45:31.732Z","updated_at":"2022-07-13T17:45:42.618Z","raw_attributes":{"id":"01jlao4614two3d","etag":"\"SEQQBYC70u6XQ2UUjmjNYw6b0a5EzY0mTMShjiZga8A/uLYJ0Hrx1gXXVg9z-zGLBZET2Wo\"","kind":"admin#directory#group","name":"Sales","email":"sales@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"1","nonEditableAliases":["sales@foo-corp.com.test-google-a.com"]}}'
|
78
|
+
http_version:
|
79
|
+
recorded_at: Thu, 14 Jul 2022 16:49:09 GMT
|
82
80
|
recorded_with: VCR 5.0.0
|
@@ -14,7 +14,7 @@ http_interactions:
|
|
14
14
|
Accept:
|
15
15
|
- "*/*"
|
16
16
|
User-Agent:
|
17
|
-
- WorkOS; ruby/
|
17
|
+
- WorkOS; ruby/2.7.2; arm64-darwin21; v2.3.0
|
18
18
|
Authorization:
|
19
19
|
- Bearer <API_KEY>
|
20
20
|
response:
|
@@ -23,64 +23,61 @@ http_interactions:
|
|
23
23
|
message: OK
|
24
24
|
headers:
|
25
25
|
Date:
|
26
|
-
-
|
26
|
+
- Thu, 14 Jul 2022 16:46:23 GMT
|
27
27
|
Content-Type:
|
28
28
|
- application/json; charset=utf-8
|
29
|
-
|
30
|
-
-
|
29
|
+
Content-Length:
|
30
|
+
- '616'
|
31
31
|
Connection:
|
32
32
|
- keep-alive
|
33
|
-
Vary:
|
34
|
-
- Origin, Accept-Encoding
|
35
33
|
Access-Control-Allow-Credentials:
|
36
34
|
- 'true'
|
37
35
|
Content-Security-Policy:
|
38
36
|
- 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
|
39
37
|
https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
|
40
38
|
''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
|
41
|
-
|
42
|
-
-
|
39
|
+
Etag:
|
40
|
+
- W/"680-NPvBik348v8xg6EE7iZMYwD5UXw"
|
43
41
|
Expect-Ct:
|
44
42
|
- max-age=0
|
45
|
-
|
46
|
-
-
|
43
|
+
Referrer-Policy:
|
44
|
+
- no-referrer
|
47
45
|
Strict-Transport-Security:
|
48
46
|
- max-age=15552000; includeSubDomains
|
49
|
-
|
50
|
-
-
|
47
|
+
Vary:
|
48
|
+
- Origin, Accept-Encoding
|
49
|
+
Via:
|
50
|
+
- 1.1 spaces-router (b642bf20b975)
|
51
51
|
X-Content-Type-Options:
|
52
52
|
- nosniff
|
53
|
+
X-Dns-Prefetch-Control:
|
54
|
+
- 'off'
|
55
|
+
X-Download-Options:
|
56
|
+
- noopen
|
57
|
+
X-Frame-Options:
|
58
|
+
- SAMEORIGIN
|
53
59
|
X-Permitted-Cross-Domain-Policies:
|
54
60
|
- none
|
55
|
-
|
56
|
-
-
|
61
|
+
X-Request-Id:
|
62
|
+
- 51a82273-b413-cead-b968-c07ba4d6fd08
|
57
63
|
X-Xss-Protection:
|
58
64
|
- '0'
|
59
|
-
X-Request-Id:
|
60
|
-
- 59862449-73e5-4dfd-93ab-3764b1917801
|
61
|
-
Etag:
|
62
|
-
- W/"4c3-Ikxt2N0fUuSxCjv+RdYvW8W9Xwo"
|
63
|
-
Via:
|
64
|
-
- 1.1 vegur
|
65
65
|
Cf-Cache-Status:
|
66
66
|
- DYNAMIC
|
67
67
|
Report-To:
|
68
|
-
- '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=
|
68
|
+
- '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=OS7ELJ3A8tkzMafvaIThD%2B5JlYmul1puZlAXTxEKYBLlq%2B6DCtqDqAi4dtr4yRP3khNmg6MwPiuLqtdOXRmPOtag9Ti%2FGK8ra%2BJOlpwkFjD965CNBfzao4EJtExDkbS3"}],"group":"cf-nel","max_age":604800}'
|
69
69
|
Nel:
|
70
70
|
- '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}'
|
71
71
|
Server:
|
72
72
|
- cloudflare
|
73
73
|
Cf-Ray:
|
74
|
-
-
|
75
|
-
Alt-Svc:
|
76
|
-
- h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443";
|
77
|
-
ma=86400
|
74
|
+
- 72abbbf2b93e8ca5-EWR
|
78
75
|
body:
|
79
76
|
encoding: ASCII-8BIT
|
80
|
-
string: '{"object":"directory_user","id":"directory_user_01FAZYNPC8M0HRYTKFP2GNX852","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"6092c280a3f1e19ef6d8cef8","username":"logan@workos.com","emails":[{"primary":true,"value":"logan@workos.com"}],"first_name":"Logan","last_name":"Gingerich","state":"active","raw_attributes":{"id":"6092c280a3f1e19ef6d8cef8","name":"Logan
|
81
|
-
Paul Gingerich","teams":["5f696c8e9a63a60e965aaca8"],"spokeId":null,"lastName":"Gingerich","createdAt":"2021-05-05T16:06:24+0000","firstName":"Logan","updatedAt":"2021-
|
82
|
-
-
|
83
|
-
-
|
84
|
-
http_version:
|
85
|
-
recorded_at:
|
77
|
+
string: '{"object":"directory_user","id":"directory_user_01FAZYNPC8M0HRYTKFP2GNX852","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","organization_id":"org_01FAZWCWR03DVWA83NCJYKKD54","idp_id":"6092c280a3f1e19ef6d8cef8","username":"logan@workos.com","emails":[{"primary":true,"value":"logan@workos.com"}],"first_name":"Logan","last_name":"Gingerich","state":"active","raw_attributes":{"id":"6092c280a3f1e19ef6d8cef8","name":"Logan
|
78
|
+
Paul Gingerich","teams":["5f696c8e9a63a60e965aaca8"],"spokeId":null,"lastName":"Gingerich","createdAt":"2021-05-05T16:06:24+0000","firstName":"Logan","updatedAt":"2021-11-11T05:08:14+0000","workEmail":"logan@workos.com","department":"Infra","departmentId":"5f27ada9a5e9bc0001a0ae4a"},"custom_attributes":{},"created_at":"2021-07-19T17:57:57.268Z","updated_at":"2022-01-24T11:23:01.614Z","groups":[{"object":"directory_group","id":"directory_group_01FAZYNNQ4HQ6EBF29MPTH7VKB","idp_id":"5f696c8e9a63a60e965aaca8","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","organization_id":"org_01FAZWCWR03DVWA83NCJYKKD54","name":"Team
|
79
|
+
- Platform","created_at":"2021-07-19T17:57:56.580Z","updated_at":"2022-01-24T11:23:01.333Z","raw_attributes":{"id":"5f696c8e9a63a60e965aaca8","name":"Platform","parent":null}},{"object":"directory_group","id":"directory_group_01FAZYNN1NZWMBRAXXDSTB5NFH","idp_id":"5f27ada9a5e9bc0001a0ae4a","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","organization_id":"org_01FAZWCWR03DVWA83NCJYKKD54","name":"Department
|
80
|
+
- Infra","created_at":"2021-07-19T17:57:55.893Z","updated_at":"2022-01-24T11:23:01.333Z","raw_attributes":{"id":"5f27ada9a5e9bc0001a0ae4a","name":"Infra","parent":"5f27ada9a5e9bc0001a0ae48"}}]}'
|
81
|
+
http_version:
|
82
|
+
recorded_at: Thu, 14 Jul 2022 16:46:23 GMT
|
86
83
|
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: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- WorkOS
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sorbet-runtime
|
@@ -388,7 +388,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
388
388
|
- !ruby/object:Gem::Version
|
389
389
|
version: '0'
|
390
390
|
requirements: []
|
391
|
-
rubygems_version: 3.3.
|
391
|
+
rubygems_version: 3.3.18
|
392
392
|
signing_key:
|
393
393
|
specification_version: 4
|
394
394
|
summary: API client for WorkOS
|