workos 5.1.0 → 5.2.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_user.rb +3 -1
- data/lib/workos/organization_membership.rb +3 -1
- data/lib/workos/user_management.rb +24 -1
- data/lib/workos/version.rb +1 -1
- data/spec/lib/workos/directory_sync_spec.rb +2 -2
- data/spec/lib/workos/directory_user_spec.rb +22 -6
- data/spec/lib/workos/user_management_spec.rb +27 -10
- data/spec/support/fixtures/vcr_cassettes/directory_sync/get_user.yml +3 -3
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_before.yml +2 -2
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_directory.yml +2 -2
- data/spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/valid.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/user_management/get_organization_membership.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/user_management/list_organization_memberships/no_options.yml +1 -1
- data/spec/support/fixtures/vcr_cassettes/user_management/list_organization_memberships/with_options.yml +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d353d6eb40443ec91c1b121bef107dc2ff2cf075bf9bf0bda21785992954e193
|
4
|
+
data.tar.gz: 5b24c924e1b10ec2f1b09e2ee267d6e12654912c1dc93dbaa1e407b6d56cae3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b9c7b2640f55ba71fc4907e2cb2a04d48564cb0a1bf5320cfdcaf822ff6aaf1e2a2fa09610036f9852ee06a86e4fed953e4f1bb4203ee728153a2c20cbc6aa9
|
7
|
+
data.tar.gz: 658e867cdfd96575e748f03c05a25d62773393e47b7c980a20af8a63e4d318bd456e4d371f23bce663436ff0d0c2fe7cc0125b83a807c5c87370dd915805ed18
|
data/Gemfile.lock
CHANGED
@@ -8,7 +8,7 @@ module WorkOS
|
|
8
8
|
include HashProvider
|
9
9
|
|
10
10
|
attr_accessor :id, :idp_id, :emails, :first_name, :last_name, :job_title, :username, :state,
|
11
|
-
:groups, :custom_attributes, :raw_attributes, :directory_id, :organization_id,
|
11
|
+
:groups, :role, :custom_attributes, :raw_attributes, :directory_id, :organization_id,
|
12
12
|
:created_at, :updated_at
|
13
13
|
|
14
14
|
# rubocop:disable Metrics/AbcSize
|
@@ -26,6 +26,7 @@ module WorkOS
|
|
26
26
|
@username = hash[:username]
|
27
27
|
@state = hash[:state]
|
28
28
|
@groups = hash[:groups]
|
29
|
+
@role = hash[:role]
|
29
30
|
@custom_attributes = hash[:custom_attributes]
|
30
31
|
@raw_attributes = hash[:raw_attributes]
|
31
32
|
@created_at = hash[:created_at]
|
@@ -48,6 +49,7 @@ module WorkOS
|
|
48
49
|
username: username,
|
49
50
|
state: state,
|
50
51
|
groups: groups,
|
52
|
+
role: role,
|
51
53
|
custom_attributes: custom_attributes,
|
52
54
|
raw_attributes: raw_attributes,
|
53
55
|
created_at: created_at,
|
@@ -7,7 +7,7 @@ module WorkOS
|
|
7
7
|
class OrganizationMembership
|
8
8
|
include HashProvider
|
9
9
|
|
10
|
-
attr_accessor :id, :user_id, :organization_id, :status, :created_at, :updated_at
|
10
|
+
attr_accessor :id, :user_id, :organization_id, :status, :role, :created_at, :updated_at
|
11
11
|
|
12
12
|
def initialize(json)
|
13
13
|
hash = JSON.parse(json, symbolize_names: true)
|
@@ -16,6 +16,7 @@ module WorkOS
|
|
16
16
|
@user_id = hash[:user_id]
|
17
17
|
@organization_id = hash[:organization_id]
|
18
18
|
@status = hash[:status]
|
19
|
+
@role = hash[:role]
|
19
20
|
@created_at = hash[:created_at]
|
20
21
|
@updated_at = hash[:updated_at]
|
21
22
|
end
|
@@ -26,6 +27,7 @@ module WorkOS
|
|
26
27
|
user_id: user_id,
|
27
28
|
organization_id: organization_id,
|
28
29
|
status: status,
|
30
|
+
role: role,
|
29
31
|
created_at: created_at,
|
30
32
|
updated_at: updated_at,
|
31
33
|
}
|
@@ -841,14 +841,37 @@ module WorkOS
|
|
841
841
|
#
|
842
842
|
# @param [String] user_id The ID of the User.
|
843
843
|
# @param [String] organization_id The ID of the Organization to which the user belongs to.
|
844
|
+
# @param [String] role_slug The slug of the role to grant to this membership. (Optional)
|
844
845
|
#
|
845
846
|
# @return [WorkOS::OrganizationMembership]
|
846
|
-
def create_organization_membership(user_id:, organization_id:)
|
847
|
+
def create_organization_membership(user_id:, organization_id:, role_slug: nil)
|
847
848
|
request = post_request(
|
848
849
|
path: '/user_management/organization_memberships',
|
849
850
|
body: {
|
850
851
|
user_id: user_id,
|
851
852
|
organization_id: organization_id,
|
853
|
+
role_slug: role_slug,
|
854
|
+
},
|
855
|
+
auth: true,
|
856
|
+
)
|
857
|
+
|
858
|
+
response = execute_request(request: request)
|
859
|
+
|
860
|
+
WorkOS::OrganizationMembership.new(response.body)
|
861
|
+
end
|
862
|
+
|
863
|
+
# Update an Organization Membership
|
864
|
+
#
|
865
|
+
# @param [String] organization_membership_id The ID of the Organization Membership.
|
866
|
+
# @param [String] role_slug The slug of the role to grant to this membership.
|
867
|
+
#
|
868
|
+
# @return [WorkOS::OrganizationMembership]
|
869
|
+
def update_organization_membership(organization_membership_id:, role_slug:)
|
870
|
+
request = put_request(
|
871
|
+
path: "/user_management/organization_memberships/#{id}",
|
872
|
+
body: {
|
873
|
+
organization_membership_id: organization_membership_id,
|
874
|
+
role_slug: role_slug,
|
852
875
|
},
|
853
876
|
auth: true,
|
854
877
|
)
|
data/lib/workos/version.rb
CHANGED
@@ -462,10 +462,10 @@ describe WorkOS::DirectorySync do
|
|
462
462
|
'directory_user_01FAZYNPC8M0HRYTKFP2GNX852',
|
463
463
|
)
|
464
464
|
|
465
|
-
expect(user['first_name']).to eq('
|
465
|
+
expect(user['first_name']).to eq('Bob')
|
466
466
|
expect(user.directory_id).to eq('directory_01FAZYMST676QMTFN1DDJZZX87')
|
467
467
|
expect(user.organization_id).to eq('org_01FAZWCWR03DVWA83NCJYKKD54')
|
468
|
-
expect(user.first_name).to eq('
|
468
|
+
expect(user.first_name).to eq('Bob')
|
469
469
|
end
|
470
470
|
end
|
471
471
|
end
|
@@ -5,31 +5,47 @@ describe WorkOS::DirectoryUser do
|
|
5
5
|
describe '.get_primary_email' do
|
6
6
|
context 'with one primary email' do
|
7
7
|
it 'returns the primary email' do
|
8
|
-
user = WorkOS::DirectoryUser.new('{"object":"directory_user","id":"directory_user_01FAZYNPC8M0HRYTKFP2GNX852","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"6092c280a3f1e19ef6d8cef8","username":"
|
9
|
-
expect(user.primary_email).to eq('
|
8
|
+
user = WorkOS::DirectoryUser.new('{"object":"directory_user","id":"directory_user_01FAZYNPC8M0HRYTKFP2GNX852","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"6092c280a3f1e19ef6d8cef8","username":"bob.fakename@workos.com","emails":[{"primary":true,"value":"bob.fakename@workos.com"}, {"primary":false,"value":"Bob@gmail.com"}],"first_name":"Bob","last_name":"Fakename","job_title":"Developer Success Engineer","state":"active","raw_attributes":{},"custom_attributes":{},"groups":[],"created_at":"2022-05-13T17:45:31.732Z", "updated_at":"2022-07-13T17:45:42.618Z"}')
|
9
|
+
expect(user.primary_email).to eq('bob.fakename@workos.com')
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
13
|
context 'with multiple primary emails' do
|
14
14
|
it 'returns the first email marked as primary' do
|
15
|
-
user = WorkOS::DirectoryUser.new('{"object":"directory_user","id":"directory_user_01FAZYNPC8M0HRYTKFP2GNX852","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"6092c280a3f1e19ef6d8cef8","username":"
|
16
|
-
expect(user.primary_email).to eq('
|
15
|
+
user = WorkOS::DirectoryUser.new('{"object":"directory_user","id":"directory_user_01FAZYNPC8M0HRYTKFP2GNX852","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"6092c280a3f1e19ef6d8cef8","username":"bob.fakename@workos.com","emails":[{"primary":true,"value":"bob.fakename@workos.com"}, {"primary":true,"value":"Bob@gmail.com"}],"first_name":"Bob","last_name":"Fakename","job_title":"Developer Success Engineer","state":"active","raw_attributes":{},"custom_attributes":{},"groups":[],"created_at":"2022-05-13T17:45:31.732Z", "updated_at":"2022-07-13T17:45:42.618Z"}')
|
16
|
+
expect(user.primary_email).to eq('bob.fakename@workos.com')
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
context 'with no primary emails' do
|
21
21
|
it 'returns nil' do
|
22
|
-
user = WorkOS::DirectoryUser.new('{"object":"directory_user","id":"directory_user_01FAZYNPC8M0HRYTKFP2GNX852","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"6092c280a3f1e19ef6d8cef8","username":"
|
22
|
+
user = WorkOS::DirectoryUser.new('{"object":"directory_user","id":"directory_user_01FAZYNPC8M0HRYTKFP2GNX852","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"6092c280a3f1e19ef6d8cef8","username":"bob.fakename@workos.com","emails":[{"primary":false,"value":"Bob@gmail.com"}],"first_name":"Bob","last_name":"Fakename","job_title":"Developer Success Engineer","state":"active","raw_attributes":{},"custom_attributes":{},"groups":[],"created_at":"2022-05-13T17:45:31.732Z","updated_at":"2022-07-13T17:45:42.618Z"}')
|
23
23
|
expect(user.primary_email).to eq(nil)
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
27
|
context 'with an empty email array' do
|
28
28
|
it 'returns nil' do
|
29
|
-
user = WorkOS::DirectoryUser.new('{"object":"directory_user","id":"directory_user_01FAZYNPC8M0HRYTKFP2GNX852","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"6092c280a3f1e19ef6d8cef8","username":"
|
29
|
+
user = WorkOS::DirectoryUser.new('{"object":"directory_user","id":"directory_user_01FAZYNPC8M0HRYTKFP2GNX852","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"6092c280a3f1e19ef6d8cef8","username":"bob.fakename@workos.com","emails":[],"first_name":"Bob","last_name":"Fakename","job_title":"Developer Success Engineer","state":"active","raw_attributes":{},"custom_attributes":{},"groups":[],"created_at":"2022-05-13T17:45:31.732Z","updated_at":"2022-07-13T17:45:42.618Z"}')
|
30
30
|
expect(user.primary_email).to eq(nil)
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
34
|
+
|
35
|
+
describe '.get_role' do
|
36
|
+
context 'with no role' do
|
37
|
+
it 'returns no role' do
|
38
|
+
user = WorkOS::DirectoryUser.new('{"object":"directory_user","id":"directory_user_01FAZYNPC8M0HRYTKFP2GNX852","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"6092c280a3f1e19ef6d8cef8","username":"bob.fakename@workos.com","emails":[{"primary":true,"value":"bob.fakename@workos.com"}, {"primary":false,"value":"bob.fakename@gmail.com"}],"first_name":"Bob","last_name":"Gingerich","job_title":"Developer Success Engineer","state":"active","raw_attributes":{},"custom_attributes":{},"groups":[],"created_at":"2022-05-13T17:45:31.732Z", "updated_at":"2022-07-13T17:45:42.618Z"}')
|
39
|
+
expect(user.role).to eq(nil)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
context 'with a role' do
|
44
|
+
it 'returns the role slug' do
|
45
|
+
user = WorkOS::DirectoryUser.new('{"object":"directory_user","id":"directory_user_01FAZYNPC8M0HRYTKFP2GNX852","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"6092c280a3f1e19ef6d8cef8","username":"bob.fakename@workos.com","emails":[{"primary":true,"value":"bob.fakename@workos.com"}, {"primary":false,"value":"bob.fakename@gmail.com"}],"first_name":"Bob","last_name":"Gingerich","job_title":"Developer Success Engineer","state":"active","raw_attributes":{},"custom_attributes":{},"groups":[],"role":{"slug":"member"},"created_at":"2022-05-13T17:45:31.732Z", "updated_at":"2022-07-13T17:45:42.618Z"}')
|
46
|
+
expect(user.role).to eq({ slug: 'member' })
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
34
50
|
# rubocop:enable Layout/LineLength
|
35
51
|
end
|
@@ -1039,19 +1039,36 @@ describe WorkOS::UserManagement do
|
|
1039
1039
|
|
1040
1040
|
expect(organization_membership.organization_id).to eq('organization_01H5JQDV7R7ATEYZDEG0W5PRYS')
|
1041
1041
|
expect(organization_membership.user_id).to eq('user_01H5JQDV7R7ATEYZDEG0W5PRYS')
|
1042
|
+
expect(organization_membership.role).to eq({ slug: 'member' })
|
1042
1043
|
end
|
1043
1044
|
end
|
1045
|
+
end
|
1044
1046
|
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1047
|
+
context 'with an invalid payload' do
|
1048
|
+
it 'returns an error' do
|
1049
|
+
VCR.use_cassette 'user_management/create_organization_membership/invalid' do
|
1050
|
+
expect do
|
1051
|
+
described_class.create_organization_membership(user_id: '', organization_id: '')
|
1052
|
+
end.to raise_error(
|
1053
|
+
WorkOS::UnprocessableEntityError,
|
1054
|
+
/user_id_string_required/,
|
1055
|
+
)
|
1056
|
+
end
|
1057
|
+
end
|
1058
|
+
end
|
1059
|
+
|
1060
|
+
context 'with a role slug' do
|
1061
|
+
it 'creates an organization with the given role slug ' do
|
1062
|
+
VCR.use_cassette 'user_management/create_organization_membership/valid' do
|
1063
|
+
organization_membership = described_class.create_organization_membership(
|
1064
|
+
user_id: 'user_01H5JQDV7R7ATEYZDEG0W5PRYS',
|
1065
|
+
organization_id: 'org_01H5JQDV7R7ATEYZDEG0W5PRYS',
|
1066
|
+
role_slug: 'member',
|
1067
|
+
)
|
1068
|
+
|
1069
|
+
expect(organization_membership.organization_id).to eq('organization_01H5JQDV7R7ATEYZDEG0W5PRYS')
|
1070
|
+
expect(organization_membership.user_id).to eq('user_01H5JQDV7R7ATEYZDEG0W5PRYS')
|
1071
|
+
expect(organization_membership.role).to eq({ slug: 'member' })
|
1055
1072
|
end
|
1056
1073
|
end
|
1057
1074
|
end
|
@@ -74,10 +74,10 @@ http_interactions:
|
|
74
74
|
- 72abbbf2b93e8ca5-EWR
|
75
75
|
body:
|
76
76
|
encoding: ASCII-8BIT
|
77
|
-
string: '{"object":"directory_user","id":"directory_user_01FAZYNPC8M0HRYTKFP2GNX852","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","organization_id":"org_01FAZWCWR03DVWA83NCJYKKD54","idp_id":"6092c280a3f1e19ef6d8cef8","username":"
|
78
|
-
|
77
|
+
string: '{"object":"directory_user","id":"directory_user_01FAZYNPC8M0HRYTKFP2GNX852","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","organization_id":"org_01FAZWCWR03DVWA83NCJYKKD54","idp_id":"6092c280a3f1e19ef6d8cef8","username":"bob.fakename@workos.com","emails":[{"primary":true,"value":"bob.fakename@workos.com"}],"first_name":"Bob","last_name":"Fakename","job_title":"Developer Success Engineer","state":"active","raw_attributes":{"id":"6092c280a3f1e19ef6d8cef8","name":"Bob
|
78
|
+
Bob Fakename","teams":["5f696c8e9a63a60e965aaca8"],"spokeId":null,"lastName":"Fakename","created_at":"2021-05-05T16:06:24+0000","firstName":"Bob","updated_at":"2021-11-11T05:08:14+0000","workEmail":"bob.fakename@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
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"}}]}'
|
80
|
+
- Infra","role":{"slug":"member"},"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
81
|
http_version:
|
82
82
|
recorded_at: Thu, 14 Jul 2022 16:46:23 GMT
|
83
83
|
recorded_with: VCR 5.0.0
|
@@ -77,8 +77,8 @@ http_interactions:
|
|
77
77
|
ma=86400
|
78
78
|
body:
|
79
79
|
encoding: ASCII-8BIT
|
80
|
-
string: '{"object":"list","listMetadata":{"before":null,"after":"directory_user_01FAZYNPC8M0HRYTKFP2GNX852"},"data":[{"object":"directory_user","id":"directory_user_01FAZYNPC8M0HRYTKFP2GNX852","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"6092c280a3f1e19ef6d8cef8","username":"
|
81
|
-
|
80
|
+
string: '{"object":"list","listMetadata":{"before":null,"after":"directory_user_01FAZYNPC8M0HRYTKFP2GNX852"},"data":[{"object":"directory_user","id":"directory_user_01FAZYNPC8M0HRYTKFP2GNX852","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"6092c280a3f1e19ef6d8cef8","username":"bob.fakename@workos.com","emails":[{"primary":true,"value":"bob.fakename@workos.com"}],"first_name":"Bob","last_name":"Fakename","job_title":"Developer Success Engineer","state":"active","created_at":"2021-05-05T16:06:24+0000","updated_at":"2021-07-19T19:17:52+0000","raw_attributes":{"id":"6092c280a3f1e19ef6d8cef8","name":"Bob
|
81
|
+
Bob Fakename","teams":["5f696c8e9a63a60e965aaca8"],"spokeId":null,"lastName":"Fakename","firstName":"Bob","workEmail":"bob.fakename@workos.com","department":"Infra","departmentId":"5f27ada9a5e9bc0001a0ae4a"},"custom_attributes":{"department":"Infra"},"groups":[{"object":"directory_group","id":"directory_group_01FAZYNN1NZWMBRAXXDSTB5NFH","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Department
|
82
82
|
- Infra","raw_attributes":{"id":"5f27ada9a5e9bc0001a0ae4a","name":"Infra","parent":"5f27ada9a5e9bc0001a0ae48"}},{"object":"directory_group","id":"directory_group_01FAZYNNQ4HQ6EBF29MPTH7VKB","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Team
|
83
83
|
- Platform","raw_attributes":{"id":"5f696c8e9a63a60e965aaca8","name":"Platform","parent":null}}]},{"object":"directory_user","id":"directory_user_01FAZYNPC8DYPEWZ0BSHBA21RM","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"5f27ada8a5e9bc0001a0adcf","username":"workos@test.com","emails":[{"primary":true,"value":"workos@test.com"}],"first_name":"Michael","last_name":"Grinich","job_title":"CEO","state":"active","created_at":"2020-08-03T06:24:40+0000","updated_at":"2021-07-07T08:50:53+0000","raw_attributes":{"id":"5f27ada8a5e9bc0001a0adcf","name":"Michael
|
84
84
|
Grinich","teams":[],"spokeId":null,"lastName":"Grinich","firstName":"Michael","workEmail":"workos@test.com","department":"Marketing","departmentId":"5f27ada9a5e9bc0001a0ae4e"},"custom_attributes":{"department":"Marketing"},"groups":[{"object":"directory_group","id":"directory_group_01FAZYNMWS67E66CD01E7A1PC4","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Department
|
@@ -183,8 +183,8 @@ http_interactions:
|
|
183
183
|
- Engineering","raw_attributes":{"id":"5f27ada9a5e9bc0001a0ae48","name":"Engineering","parent":null}}]},{"object":"directory_user","id":"directory_user_01FAZYNPC8TJBP7Y2ERT51MGDF","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"5f6e1d0d67a73900a6c29e15","username":"henry@workos.com","emails":[{"primary":true,"value":"henry@workos.com"}],"first_name":"Henry","last_name":"Chan","job_title":"Software Engineer","state":"active","created_at":"2020-09-25T16:38:37+0000","updated_at":"2021-07-07T08:46:02+0000","raw_attributes":{"id":"5f6e1d0d67a73900a6c29e15","name":"Henry
|
184
184
|
Chan","teams":["5f696c8e9a63a60e965aaca8"],"spokeId":null,"lastName":"Chan","firstName":"Henry","workEmail":"henry@workos.com","department":"Engineering","departmentId":"5f27ada9a5e9bc0001a0ae48"},"custom_attributes":{"department":"Engineering"},"groups":[{"object":"directory_group","id":"directory_group_01FAZYNNQ4HQ6EBF29MPTH7VKB","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Team
|
185
185
|
- Platform","raw_attributes":{"id":"5f696c8e9a63a60e965aaca8","name":"Platform","parent":null}},{"object":"directory_group","id":"directory_group_01FAZYNMV2TDE78FEAH724YGMP","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Department
|
186
|
-
- Engineering","raw_attributes":{"id":"5f27ada9a5e9bc0001a0ae48","name":"Engineering","parent":null}}]},{"object":"directory_user","id":"directory_user_01FAZYNPC8M0HRYTKFP2GNX852","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"6092c280a3f1e19ef6d8cef8","username":"
|
187
|
-
|
186
|
+
- Engineering","raw_attributes":{"id":"5f27ada9a5e9bc0001a0ae48","name":"Engineering","parent":null}}]},{"object":"directory_user","id":"directory_user_01FAZYNPC8M0HRYTKFP2GNX852","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"6092c280a3f1e19ef6d8cef8","username":"bob.fakename@workos.com","emails":[{"primary":true,"value":"bob.fakename@workos.com"}],"first_name":"Bob","last_name":"Fakename","job_title":"Developer Success Engineer","state":"active","created_at":"2021-05-05T16:06:24+0000","updated_at":"2021-07-19T19:17:52+0000","raw_attributes":{"id":"6092c280a3f1e19ef6d8cef8","name":"Bob
|
187
|
+
Bob Fakename","teams":["5f696c8e9a63a60e965aaca8"],"spokeId":null,"lastName":"Fakename","firstName":"Bob","workEmail":"bob.fakename@workos.com","department":"Infra","departmentId":"5f27ada9a5e9bc0001a0ae4a"},"custom_attributes":{"department":"Infra"},"groups":[{"object":"directory_group","id":"directory_group_01FAZYNN1NZWMBRAXXDSTB5NFH","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Department
|
188
188
|
- Infra","raw_attributes":{"id":"5f27ada9a5e9bc0001a0ae4a","name":"Infra","parent":"5f27ada9a5e9bc0001a0ae48"}},{"object":"directory_group","id":"directory_group_01FAZYNNQ4HQ6EBF29MPTH7VKB","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Team
|
189
189
|
- Platform","raw_attributes":{"id":"5f696c8e9a63a60e965aaca8","name":"Platform","parent":null}}]},{"object":"directory_user","id":"directory_user_01FAZYNPC8DYPEWZ0BSHBA21RM","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"5f27ada8a5e9bc0001a0adcf","username":"workos@test.com","emails":[{"primary":true,"value":"workos@test.com"}],"first_name":"Michael","last_name":"Grinich","job_title":"CEO","state":"active","created_at":"2020-08-03T06:24:40+0000","updated_at":"2021-07-07T08:50:53+0000","raw_attributes":{"id":"5f27ada8a5e9bc0001a0adcf","name":"Michael
|
190
190
|
Grinich","teams":[],"spokeId":null,"lastName":"Grinich","firstName":"Michael","workEmail":"workos@test.com","department":"Marketing","departmentId":"5f27ada9a5e9bc0001a0ae4e"},"custom_attributes":{"department":"Marketing"},"groups":[{"object":"directory_group","id":"directory_group_01FAZYNMWS67E66CD01E7A1PC4","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Department
|
data/spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/valid.yml
CHANGED
@@ -76,7 +76,7 @@ http_interactions:
|
|
76
76
|
- cloudflare
|
77
77
|
body:
|
78
78
|
encoding: UTF-8
|
79
|
-
string: '{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status":"active","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}'
|
79
|
+
string: '{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status":"active","role":{"slug":"member"},"created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}'
|
80
80
|
http_version:
|
81
81
|
recorded_at: Thu, 17 Aug 2023 14:20:07 GMT
|
82
82
|
recorded_with: VCR 5.0.0
|
@@ -76,7 +76,7 @@ http_interactions:
|
|
76
76
|
- cloudflare
|
77
77
|
body:
|
78
78
|
encoding: ASCII-8BIT
|
79
|
-
string: '{"object": "organization_membership", "id": "om_01H5JQDV7R7ATEYZDEG0W5PRYS", "user_id": "user_01H5JQDV7R7ATEYZDEG0W5PRYS", "organization_id": "organization_01H5JQDV7R7ATEYZDEG0W5PRYS", "status": "active", "created_at": "2023-07-18T02:07:19.911Z", "updated_at": "2023-07-18T02:07:19.911Z"}'
|
79
|
+
string: '{"object": "organization_membership", "id": "om_01H5JQDV7R7ATEYZDEG0W5PRYS", "user_id": "user_01H5JQDV7R7ATEYZDEG0W5PRYS", "organization_id": "organization_01H5JQDV7R7ATEYZDEG0W5PRYS", "status": "active", "role": {"slug": "member"}, "created_at": "2023-07-18T02:07:19.911Z", "updated_at": "2023-07-18T02:07:19.911Z"}'
|
80
80
|
http_version:
|
81
81
|
recorded_at: Mon, 14 Aug 2023 21:42:04 GMT
|
82
82
|
recorded_with: VCR 5.0.0
|
@@ -76,7 +76,7 @@ http_interactions:
|
|
76
76
|
- cloudflare
|
77
77
|
body:
|
78
78
|
encoding: ASCII-8BIT
|
79
|
-
string: '{"object":"list","data":[{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status": "active","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}, {"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status": "active","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":"before-id","after":null}}'
|
79
|
+
string: '{"object":"list","data":[{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status": "active","role":{"slug":"member"},"created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}, {"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status": "active","role":{"slug":"member"},"created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":"before-id","after":null}}'
|
80
80
|
http_version:
|
81
81
|
recorded_at: Tue, 15 Aug 2023 14:12:43 GMT
|
82
82
|
recorded_with: VCR 5.0.0
|
@@ -76,7 +76,7 @@ http_interactions:
|
|
76
76
|
- cloudflare
|
77
77
|
body:
|
78
78
|
encoding: ASCII-8BIT
|
79
|
-
string: '{"object":"list","data":[{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status": "active","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":null,"after":null}}'
|
79
|
+
string: '{"object":"list","data":[{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status": "active","role":{"slug":"member"},"created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":null,"after":null}}'
|
80
80
|
http_version:
|
81
81
|
recorded_at: Tue, 15 Aug 2023 16:37:20 GMT
|
82
82
|
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: 5.
|
4
|
+
version: 5.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- WorkOS
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|