workos 0.2.3 → 0.4.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/Gemfile.lock +2 -2
- data/README.md +1 -1
- data/lib/workos.rb +1 -0
- data/lib/workos/audit_trail.rb +48 -0
- data/lib/workos/directory_sync.rb +128 -0
- data/lib/workos/profile.rb +2 -2
- data/lib/workos/sso.rb +4 -4
- data/lib/workos/types/profile_struct.rb +2 -2
- data/lib/workos/version.rb +1 -1
- data/spec/lib/workos/audit_trail_spec.rb +12 -0
- data/spec/lib/workos/directory_sync_spec.rb +139 -0
- data/spec/lib/workos/sso_spec.rb +4 -4
- data/spec/support/fixtures/vcr_cassettes/audit_trail/get_events.yml +61 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/get_group.yml +62 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/get_group_with_invalid_id.yml +62 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/get_user.yml +62 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/get_user_with_invalid_id.yml +62 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories.yml +62 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories_with_domain_param.yml +63 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups.yml +64 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups_with_directory_param.yml +62 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users.yml +64 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users_with_directory_param.yml +62 -0
- data/workos.gemspec +14 -11
- metadata +31 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce58ab479d49e4f828ebe675fb3f3b8104a6d82d85f19da6087f9a907dc1e827
|
4
|
+
data.tar.gz: 96d0c77cf047d6e56952414cda3d80d2395b692b4125af95c15a9ba85b00c0c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8529507b9187453055b084ec30446123a2572f4045380f17916d640b1c0f052eb64089d620695469b3eb0839c3d88e4f6827a24de1802bd432f2c5f134cb3094
|
7
|
+
data.tar.gz: 505133b5a111f5efdfd1b9c26b773f6359dc21841273df43ae0f7090afec8ee11350830004f2dd285d7b607b3d423e95513c50484cab36ade8be60686be214f1
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
workos (0.
|
4
|
+
workos (0.4.0)
|
5
5
|
sorbet-runtime (~> 0.5)
|
6
6
|
|
7
7
|
GEM
|
@@ -56,7 +56,7 @@ GEM
|
|
56
56
|
simplecov-html (0.10.2)
|
57
57
|
sorbet (0.5.5560)
|
58
58
|
sorbet-static (= 0.5.5560)
|
59
|
-
sorbet-runtime (0.5.
|
59
|
+
sorbet-runtime (0.5.5858)
|
60
60
|
sorbet-static (0.5.5560-universal-darwin-14)
|
61
61
|
unicode-display_width (1.6.0)
|
62
62
|
url (0.3.2)
|
data/README.md
CHANGED
@@ -80,7 +80,7 @@ WorkOS::AuditTrail.create_event(event: payload, idempotency_key: 'key123456')
|
|
80
80
|
```
|
81
81
|
|
82
82
|
See our [API
|
83
|
-
Reference](https://docs.workos.com/api-reference#idempotency)
|
83
|
+
Reference](https://docs.workos.com/audit-trail/api-reference#idempotency)
|
84
84
|
for more information on idempotency keys.
|
85
85
|
|
86
86
|
## The SSO Module
|
data/lib/workos.rb
CHANGED
@@ -30,6 +30,7 @@ module WorkOS
|
|
30
30
|
autoload :Client, 'workos/client'
|
31
31
|
autoload :AuditTrail, 'workos/audit_trail'
|
32
32
|
autoload :Connection, 'workos/connection'
|
33
|
+
autoload :DirectorySync, 'workos/directory_sync'
|
33
34
|
autoload :Profile, 'workos/profile'
|
34
35
|
autoload :SSO, 'workos/sso'
|
35
36
|
|
data/lib/workos/audit_trail.rb
CHANGED
@@ -57,6 +57,54 @@ module WorkOS
|
|
57
57
|
|
58
58
|
execute_request(request: request)
|
59
59
|
end
|
60
|
+
|
61
|
+
# Retrieve Audit Trail events.
|
62
|
+
#
|
63
|
+
# @param [Hash] options An options hash
|
64
|
+
# @option options [String] before Event ID to look before
|
65
|
+
# @option options [String] after Event ID to look after
|
66
|
+
# @option options [Integer] limit Number of Events to return
|
67
|
+
# @option options [Array<String>] group List of Groups to filter for
|
68
|
+
# @option options [Array<String>] action List of Actions to filter for
|
69
|
+
# @option options [Array<String>] action_type List of Action Types to
|
70
|
+
# filter for
|
71
|
+
# @option options [Array<String>] actor_name List of Actor Name to filter
|
72
|
+
# for
|
73
|
+
# @option options [Array<String>] actor_id List of Actor IDs to filter for
|
74
|
+
# @option options [Array<String>] target_name List of Target Names to
|
75
|
+
# filter for
|
76
|
+
# @option options [Array<String>] target_id List of Target IDs to filter
|
77
|
+
# for
|
78
|
+
# @option options [String] occurred_at ISO-8601 datetime of when an event
|
79
|
+
# occurred
|
80
|
+
# @option options [String] occurred_at_gt ISO-8601 datetime of when an
|
81
|
+
# event occurred after
|
82
|
+
# @option options [String] occurred_at_gte ISO-8601 datetime of when an
|
83
|
+
# event occurred at or after
|
84
|
+
# @option options [String] occurred_at_lt ISO-8601 datetime of when an
|
85
|
+
# event occurred before
|
86
|
+
# @option options [String] ISO-8601 datetime of when an event occured at
|
87
|
+
# or before
|
88
|
+
# @option options [String] search Keyword search
|
89
|
+
#
|
90
|
+
# @return [Array<Hash>]
|
91
|
+
sig do
|
92
|
+
params(
|
93
|
+
options: T::Hash[Symbol, String],
|
94
|
+
).returns(T::Array[T::Hash[String, T.nilable(String)]])
|
95
|
+
end
|
96
|
+
|
97
|
+
def get_events(options = {})
|
98
|
+
response = execute_request(
|
99
|
+
request: get_request(
|
100
|
+
path: '/events',
|
101
|
+
auth: true,
|
102
|
+
params: options,
|
103
|
+
),
|
104
|
+
)
|
105
|
+
|
106
|
+
JSON.parse(response.body)['data']
|
107
|
+
end
|
60
108
|
end
|
61
109
|
end
|
62
110
|
end
|
@@ -0,0 +1,128 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# typed: true
|
3
|
+
|
4
|
+
module WorkOS
|
5
|
+
# The Directory Sync module provides convenience methods for working with the
|
6
|
+
# WorkOS Directory Sync platform. You'll need a valid API key and to have
|
7
|
+
# created a Directory Sync connection on your WorkOS dashboard.
|
8
|
+
#
|
9
|
+
# @see https://docs.workos.com/directory-sync/overview
|
10
|
+
module DirectorySync
|
11
|
+
class << self
|
12
|
+
extend T::Sig
|
13
|
+
include Base
|
14
|
+
include Client
|
15
|
+
|
16
|
+
# Retrieve directories.
|
17
|
+
#
|
18
|
+
# @param [Hash] options An options hash
|
19
|
+
# @option options [String] domain The domain of the directory to be
|
20
|
+
# retrieved.
|
21
|
+
# @option options [String] search A search term for direcory names.
|
22
|
+
#
|
23
|
+
# @return [Hash]
|
24
|
+
sig do
|
25
|
+
params(
|
26
|
+
options: T::Hash[Symbol, String],
|
27
|
+
).returns(T::Array[T::Hash[String, T.nilable(String)]])
|
28
|
+
end
|
29
|
+
def list_directories(options = {})
|
30
|
+
response = execute_request(
|
31
|
+
request: get_request(
|
32
|
+
path: '/directories',
|
33
|
+
auth: true,
|
34
|
+
params: options,
|
35
|
+
),
|
36
|
+
)
|
37
|
+
|
38
|
+
JSON.parse(response.body)['data']
|
39
|
+
end
|
40
|
+
|
41
|
+
# Retrieve directory groups.
|
42
|
+
#
|
43
|
+
# @param [Hash] options An options hash
|
44
|
+
# @option options [String] directory The ID of the directory whose
|
45
|
+
# directory groups will be retrieved.
|
46
|
+
# @option options [String] user The ID of the directory user whose
|
47
|
+
# directory groups will be retrieved.
|
48
|
+
#
|
49
|
+
# @return [Hash]
|
50
|
+
sig do
|
51
|
+
params(
|
52
|
+
options: T::Hash[Symbol, String],
|
53
|
+
).returns(T::Array[T::Hash[String, T.nilable(String)]])
|
54
|
+
end
|
55
|
+
def list_groups(options = {})
|
56
|
+
response = execute_request(
|
57
|
+
request: get_request(
|
58
|
+
path: '/directory_groups',
|
59
|
+
auth: true,
|
60
|
+
params: options,
|
61
|
+
),
|
62
|
+
)
|
63
|
+
|
64
|
+
JSON.parse(response.body)['data']
|
65
|
+
end
|
66
|
+
|
67
|
+
# Retrieve directory users.
|
68
|
+
#
|
69
|
+
# @param [Hash] options An options hash
|
70
|
+
# @option options [String] directory The ID of the directory whose
|
71
|
+
# directory users will be retrieved.
|
72
|
+
# @option options [String] user The ID of the directory group whose
|
73
|
+
# directory users will be retrieved.
|
74
|
+
#
|
75
|
+
# @return [Hash]
|
76
|
+
sig do
|
77
|
+
params(
|
78
|
+
options: T::Hash[Symbol, String],
|
79
|
+
).returns(T::Array[T::Hash[String, T.untyped]])
|
80
|
+
end
|
81
|
+
def list_users(options = {})
|
82
|
+
response = execute_request(
|
83
|
+
request: get_request(
|
84
|
+
path: '/directory_users',
|
85
|
+
auth: true,
|
86
|
+
params: options,
|
87
|
+
),
|
88
|
+
)
|
89
|
+
|
90
|
+
JSON.parse(response.body)['data']
|
91
|
+
end
|
92
|
+
|
93
|
+
# Retrieve the directory group with the given ID.
|
94
|
+
#
|
95
|
+
# @param [String] id The ID of the directory group.
|
96
|
+
#
|
97
|
+
# @return Hash
|
98
|
+
sig { params(id: String).returns(T::Hash[String, T.untyped]) }
|
99
|
+
def get_group(id)
|
100
|
+
response = execute_request(
|
101
|
+
request: get_request(
|
102
|
+
path: "/directory_groups/#{id}",
|
103
|
+
auth: true,
|
104
|
+
),
|
105
|
+
)
|
106
|
+
|
107
|
+
JSON.parse(response.body)
|
108
|
+
end
|
109
|
+
|
110
|
+
# Retrieve the directory user with the given ID.
|
111
|
+
#
|
112
|
+
# @param [String] id The ID of the directory user.
|
113
|
+
#
|
114
|
+
# @return Hash
|
115
|
+
sig { params(id: String).returns(T::Hash[String, T.untyped]) }
|
116
|
+
def get_user(id)
|
117
|
+
response = execute_request(
|
118
|
+
request: get_request(
|
119
|
+
path: "/directory_users/#{id}",
|
120
|
+
auth: true,
|
121
|
+
),
|
122
|
+
)
|
123
|
+
|
124
|
+
JSON.parse(response.body)
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
data/lib/workos/profile.rb
CHANGED
@@ -22,8 +22,8 @@ module WorkOS
|
|
22
22
|
|
23
23
|
@id = T.let(raw.id, String)
|
24
24
|
@email = T.let(raw.email, String)
|
25
|
-
@first_name =
|
26
|
-
@last_name =
|
25
|
+
@first_name = raw.first_name
|
26
|
+
@last_name = raw.last_name
|
27
27
|
@connection_type = T.let(raw.connection_type, String)
|
28
28
|
@idp_id = T.let(raw.idp_id, String)
|
29
29
|
end
|
data/lib/workos/sso.rb
CHANGED
@@ -31,7 +31,7 @@ module WorkOS
|
|
31
31
|
# @param [String] redirect_uri The URI where users are directed
|
32
32
|
# after completing the authentication step. Must match a
|
33
33
|
# configured redirect URI on your WorkOS dashboard.
|
34
|
-
# @param [
|
34
|
+
# @param [String] state An aribtrary state object
|
35
35
|
# that is preserved and available to the client in the response.
|
36
36
|
# @example
|
37
37
|
# WorkOS::SSO.authorization_url(
|
@@ -40,7 +40,7 @@ module WorkOS
|
|
40
40
|
# redirect_uri: 'https://workos.com/callback',
|
41
41
|
# state: {
|
42
42
|
# next_page: '/docs'
|
43
|
-
# }
|
43
|
+
# }.to_s
|
44
44
|
# )
|
45
45
|
#
|
46
46
|
# => "https://api.workos.com/sso/authorize?domain=acme.com" \
|
@@ -55,11 +55,11 @@ module WorkOS
|
|
55
55
|
redirect_uri: String,
|
56
56
|
domain: T.nilable(String),
|
57
57
|
provider: T.nilable(String),
|
58
|
-
state:
|
58
|
+
state: T.nilable(String),
|
59
59
|
).returns(String)
|
60
60
|
end
|
61
61
|
def authorization_url(
|
62
|
-
project_id:, redirect_uri:, domain: nil, provider: nil, state:
|
62
|
+
project_id:, redirect_uri:, domain: nil, provider: nil, state: ''
|
63
63
|
)
|
64
64
|
validate_domain_and_provider(provider: provider, domain: domain)
|
65
65
|
|
@@ -8,8 +8,8 @@ module WorkOS
|
|
8
8
|
class ProfileStruct < T::Struct
|
9
9
|
const :id, String
|
10
10
|
const :email, String
|
11
|
-
const :first_name, String
|
12
|
-
const :last_name, String
|
11
|
+
const :first_name, T.nilable(String)
|
12
|
+
const :last_name, T.nilable(String)
|
13
13
|
const :connection_type, String
|
14
14
|
const :idp_id, String
|
15
15
|
end
|
data/lib/workos/version.rb
CHANGED
@@ -137,4 +137,16 @@ describe WorkOS::AuditTrail do
|
|
137
137
|
end
|
138
138
|
end
|
139
139
|
end
|
140
|
+
|
141
|
+
describe '.get_events' do
|
142
|
+
context 'with no options' do
|
143
|
+
it 'returns events' do
|
144
|
+
VCR.use_cassette('audit_trail/get_events') do
|
145
|
+
events = described_class.get_events
|
146
|
+
|
147
|
+
expect(events.size).to eq(2)
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
140
152
|
end
|
@@ -0,0 +1,139 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# typed: false
|
3
|
+
|
4
|
+
describe WorkOS::DirectorySync do
|
5
|
+
before(:all) do
|
6
|
+
WorkOS.key = 'key'
|
7
|
+
end
|
8
|
+
|
9
|
+
after(:all) do
|
10
|
+
WorkOS.key = nil
|
11
|
+
end
|
12
|
+
|
13
|
+
describe '.list_directories' do
|
14
|
+
context 'with no options' do
|
15
|
+
it 'returns directories' do
|
16
|
+
VCR.use_cassette('directory_sync/list_directories') do
|
17
|
+
directories = WorkOS::DirectorySync.list_directories
|
18
|
+
expect(directories.size).to eq(1)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
context 'with domain option' do
|
24
|
+
it 'returns directories' do
|
25
|
+
VCR.use_cassette('directory_sync/list_directories_with_domain_param') do
|
26
|
+
directories = WorkOS::DirectorySync.list_directories(
|
27
|
+
domain: 'foo-corp.com',
|
28
|
+
)
|
29
|
+
|
30
|
+
expect(directories.first['domain']).to eq('foo-corp.com')
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe '.list_groups' do
|
37
|
+
context 'with no options' do
|
38
|
+
it 'returns groups' do
|
39
|
+
VCR.use_cassette('directory_sync/list_groups') do
|
40
|
+
expect do
|
41
|
+
WorkOS::DirectorySync.list_groups
|
42
|
+
end.to raise_error(
|
43
|
+
WorkOS::InvalidRequestError,
|
44
|
+
/Status 422, Validation failed/,
|
45
|
+
)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
context 'with directory option' do
|
51
|
+
it 'returns groups' do
|
52
|
+
VCR.use_cassette('directory_sync/list_groups_with_directory_param') do
|
53
|
+
groups = WorkOS::DirectorySync.list_groups(
|
54
|
+
directory: 'directory_edp_01E64QQVQTCB0DECJ9CFNXEWDW',
|
55
|
+
)
|
56
|
+
|
57
|
+
expect(groups.size).to eq(2)
|
58
|
+
expect(groups.first['name']).to eq('Walrus')
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
describe '.list_users' do
|
65
|
+
context 'with no options' do
|
66
|
+
it 'returns users' do
|
67
|
+
VCR.use_cassette('directory_sync/list_users') do
|
68
|
+
expect do
|
69
|
+
WorkOS::DirectorySync.list_users
|
70
|
+
end.to raise_error(
|
71
|
+
WorkOS::InvalidRequestError,
|
72
|
+
/Status 422, Validation failed/,
|
73
|
+
)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
context 'with directory option' do
|
79
|
+
it 'returns users' do
|
80
|
+
VCR.use_cassette('directory_sync/list_users_with_directory_param') do
|
81
|
+
users = WorkOS::DirectorySync.list_users(
|
82
|
+
directory: 'directory_edp_01E64QQVQTCB0DECJ9CFNXEWDW',
|
83
|
+
)
|
84
|
+
|
85
|
+
expect(users.size).to eq(1)
|
86
|
+
expect(users.first['last_name']).to eq('Tran')
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
describe '.get_group' do
|
93
|
+
context 'with valid id' do
|
94
|
+
it 'returns a group' do
|
95
|
+
VCR.use_cassette('directory_sync/get_group') do
|
96
|
+
group = WorkOS::DirectorySync.get_group(
|
97
|
+
'directory_grp_01E64QTDNS0EGJ0FMCVY9BWGZT',
|
98
|
+
)
|
99
|
+
|
100
|
+
expect(group['name']).to eq('Walrus')
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
context 'with invalid id' do
|
106
|
+
it 'raises an error' do
|
107
|
+
VCR.use_cassette('directory_sync/get_group_with_invalid_id') do
|
108
|
+
expect do
|
109
|
+
WorkOS::DirectorySync.get_group('invalid')
|
110
|
+
end.to raise_error(WorkOS::APIError)
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
describe '.get_user' do
|
117
|
+
context 'with valid id' do
|
118
|
+
it 'returns a user' do
|
119
|
+
VCR.use_cassette('directory_sync/get_user') do
|
120
|
+
user = WorkOS::DirectorySync.get_user(
|
121
|
+
'directory_usr_01E64QS50EAY48S0XJ1AA4WX4D',
|
122
|
+
)
|
123
|
+
|
124
|
+
expect(user['first_name']).to eq('Mark')
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
context 'with invalid id' do
|
130
|
+
it 'raises an error' do
|
131
|
+
VCR.use_cassette('directory_sync/get_user_with_invalid_id') do
|
132
|
+
expect do
|
133
|
+
WorkOS::DirectorySync.get_user('invalid')
|
134
|
+
end.to raise_error(WorkOS::APIError)
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
data/spec/lib/workos/sso_spec.rb
CHANGED
@@ -13,7 +13,7 @@ describe WorkOS::SSO do
|
|
13
13
|
redirect_uri: 'foo.com/auth/callback',
|
14
14
|
state: {
|
15
15
|
next_page: '/dashboard/edit',
|
16
|
-
},
|
16
|
+
}.to_s,
|
17
17
|
}
|
18
18
|
end
|
19
19
|
it 'returns a valid URL' do
|
@@ -47,7 +47,7 @@ describe WorkOS::SSO do
|
|
47
47
|
redirect_uri: 'foo.com/auth/callback',
|
48
48
|
state: {
|
49
49
|
next_page: '/dashboard/edit',
|
50
|
-
},
|
50
|
+
}.to_s,
|
51
51
|
}
|
52
52
|
end
|
53
53
|
it 'returns a valid URL' do
|
@@ -80,7 +80,7 @@ describe WorkOS::SSO do
|
|
80
80
|
redirect_uri: 'foo.com/auth/callback',
|
81
81
|
state: {
|
82
82
|
next_page: '/dashboard/edit',
|
83
|
-
},
|
83
|
+
}.to_s,
|
84
84
|
}
|
85
85
|
end
|
86
86
|
it 'raises an error' do
|
@@ -101,7 +101,7 @@ describe WorkOS::SSO do
|
|
101
101
|
redirect_uri: 'foo.com/auth/callback',
|
102
102
|
state: {
|
103
103
|
next_page: '/dashboard/edit',
|
104
|
-
},
|
104
|
+
}.to_s,
|
105
105
|
}
|
106
106
|
end
|
107
107
|
it 'raises an error' do
|
@@ -0,0 +1,61 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.workos.com/events
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ""
|
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/2.7.1; x86_64-darwin19; v0.4.0
|
18
|
+
Authorization:
|
19
|
+
- Bearer <API_KEY>
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Vary:
|
26
|
+
- Origin, Accept-Encoding
|
27
|
+
Access-Control-Allow-Credentials:
|
28
|
+
- "true"
|
29
|
+
X-Dns-Prefetch-Control:
|
30
|
+
- "off"
|
31
|
+
X-Frame-Options:
|
32
|
+
- SAMEORIGIN
|
33
|
+
Strict-Transport-Security:
|
34
|
+
- max-age=15552000; includeSubDomains
|
35
|
+
X-Download-Options:
|
36
|
+
- noopen
|
37
|
+
X-Content-Type-Options:
|
38
|
+
- nosniff
|
39
|
+
X-Xss-Protection:
|
40
|
+
- 1; mode=block
|
41
|
+
X-Request-Id:
|
42
|
+
- ""
|
43
|
+
Content-Type:
|
44
|
+
- application/json; charset=utf-8
|
45
|
+
Etag:
|
46
|
+
- W/"1784-HtVN7X+AT30Dlt9nZrirP0nnyV8"
|
47
|
+
Date:
|
48
|
+
- Fri, 31 Jul 2020 14:41:12 GMT
|
49
|
+
Connection:
|
50
|
+
- keep-alive
|
51
|
+
Transfer-Encoding:
|
52
|
+
- chunked
|
53
|
+
body:
|
54
|
+
encoding: ASCII-8BIT
|
55
|
+
string:
|
56
|
+
'{"data":[{"object":"event","id":"evt_01EEJM9Q9SMC3W2SZDKA5VJ8XQ","group":"workos.com","location":"::1","latitude":null,"longitude":null,"type":"r","actor_name":"foo@example.com","actor_id":"user_01EEG9P7A1DA9VY9CX7GT47RPF","target_name":"api_key_query","target_id":"key_01EEG9MPHAYX46BBZKGK3BGQXJ","metadata":{"description":"User
|
57
|
+
viewed API key.","x_request_id":""},"occurred_at":"2020-07-31T14:27:00.384Z","action":{"object":"event_action","id":"evt_action_01EEGQXWAHB065P5JD0QDAAGDC","name":"user.viewed_api_key","project_id":"project_01DZB0E7HQMA6G85PQNHQJMZD0"}},{"object":"event","id":"evt_01EEJM9Q7GMR1VGT6VXN2N2JJQ","group":"workos.com","location":"::1","latitude":null,"longitude":null,"type":"r","actor_name":"foo@example.com","actor_id":"user_01EEG9P7A1DA9VY9CX7GT47RPF","target_name":"api_key_query","target_id":"key_01EEG9MPGM8KFT9VBQHJMV8YZB","metadata":{"description":"User
|
58
|
+
viewed API key.","x_request_id":""},"occurred_at":"2020-07-31T14:27:00.360Z","action":{"object":"event_action","id":"evt_action_01EEGQXWAHB065P5JD0QDAAGDC","name":"user.viewed_api_key","project_id":"project_01DZB0E7HQMA6G85PQNHQJMZD0"}}],"listMetadata":{"before":"evt_01EEJKZDAR6G4JHFQT4R3KSZDQ","after":null}}'
|
59
|
+
http_version:
|
60
|
+
recorded_at: Fri, 31 Jul 2020 14:41:12 GMT
|
61
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,62 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.workos.com/directory_groups/directory_grp_01E64QTDNS0EGJ0FMCVY9BWGZT
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
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/2.7.1; x86_64-darwin19; v0.2.3
|
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
|
+
X-Dns-Prefetch-Control:
|
34
|
+
- 'off'
|
35
|
+
X-Frame-Options:
|
36
|
+
- SAMEORIGIN
|
37
|
+
Strict-Transport-Security:
|
38
|
+
- max-age=15552000; includeSubDomains
|
39
|
+
X-Download-Options:
|
40
|
+
- noopen
|
41
|
+
X-Content-Type-Options:
|
42
|
+
- nosniff
|
43
|
+
X-Xss-Protection:
|
44
|
+
- 1; mode=block
|
45
|
+
X-Request-Id:
|
46
|
+
- 4fb94ab3-ecff-4cea-b0b7-d4d1b3ffad3a
|
47
|
+
Content-Type:
|
48
|
+
- application/json; charset=utf-8
|
49
|
+
Content-Length:
|
50
|
+
- '65'
|
51
|
+
Etag:
|
52
|
+
- W/"41-QrnAKhorJuUwAsR1OyMpfB8q1Kc"
|
53
|
+
Date:
|
54
|
+
- Thu, 30 Apr 2020 04:47:49 GMT
|
55
|
+
Via:
|
56
|
+
- 1.1 vegur
|
57
|
+
body:
|
58
|
+
encoding: UTF-8
|
59
|
+
string: '{"id":"directory_grp_01E64QTDNS0EGJ0FMCVY9BWGZT","name":"Walrus"}'
|
60
|
+
http_version:
|
61
|
+
recorded_at: Thu, 30 Apr 2020 04:47:49 GMT
|
62
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,62 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.workos.com/directory_groups/invalid
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
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/2.7.1; x86_64-darwin19; v0.2.3
|
18
|
+
Authorization:
|
19
|
+
- Bearer <API_KEY>
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 404
|
23
|
+
message: Not Found
|
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
|
+
X-Dns-Prefetch-Control:
|
34
|
+
- 'off'
|
35
|
+
X-Frame-Options:
|
36
|
+
- SAMEORIGIN
|
37
|
+
Strict-Transport-Security:
|
38
|
+
- max-age=15552000; includeSubDomains
|
39
|
+
X-Download-Options:
|
40
|
+
- noopen
|
41
|
+
X-Content-Type-Options:
|
42
|
+
- nosniff
|
43
|
+
X-Xss-Protection:
|
44
|
+
- 1; mode=block
|
45
|
+
X-Request-Id:
|
46
|
+
- bbf92391-32bd-4d77-bbdc-0e77983d04d4
|
47
|
+
Content-Type:
|
48
|
+
- application/json; charset=utf-8
|
49
|
+
Content-Length:
|
50
|
+
- '23'
|
51
|
+
Etag:
|
52
|
+
- W/"17-SuRA/yvUWUo8rK6x7dKURLeBo+0"
|
53
|
+
Date:
|
54
|
+
- Thu, 30 Apr 2020 04:48:28 GMT
|
55
|
+
Via:
|
56
|
+
- 1.1 vegur
|
57
|
+
body:
|
58
|
+
encoding: UTF-8
|
59
|
+
string: '{"message":"Not Found"}'
|
60
|
+
http_version:
|
61
|
+
recorded_at: Thu, 30 Apr 2020 04:48:28 GMT
|
62
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,62 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.workos.com/directory_users/directory_usr_01E64QS50EAY48S0XJ1AA4WX4D
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
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/2.7.1; x86_64-darwin19; v0.2.3
|
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
|
+
X-Dns-Prefetch-Control:
|
34
|
+
- 'off'
|
35
|
+
X-Frame-Options:
|
36
|
+
- SAMEORIGIN
|
37
|
+
Strict-Transport-Security:
|
38
|
+
- max-age=15552000; includeSubDomains
|
39
|
+
X-Download-Options:
|
40
|
+
- noopen
|
41
|
+
X-Content-Type-Options:
|
42
|
+
- nosniff
|
43
|
+
X-Xss-Protection:
|
44
|
+
- 1; mode=block
|
45
|
+
X-Request-Id:
|
46
|
+
- fe3f582a-b944-4f2c-a225-ae3a7f099fa0
|
47
|
+
Content-Type:
|
48
|
+
- application/json; charset=utf-8
|
49
|
+
Content-Length:
|
50
|
+
- '368'
|
51
|
+
Etag:
|
52
|
+
- W/"170-JjGTDHa7GqXeAwXcua+s3+2z/oA"
|
53
|
+
Date:
|
54
|
+
- Thu, 30 Apr 2020 04:43:14 GMT
|
55
|
+
Via:
|
56
|
+
- 1.1 vegur
|
57
|
+
body:
|
58
|
+
encoding: UTF-8
|
59
|
+
string: '{"id":"directory_usr_01E64QS50EAY48S0XJ1AA4WX4D","raw_attributes":{"name":{"givenName":"Mark","familyName":"Tran"},"emails":[{"value":"mark@foo-corp.com","primary":true}],"userName":"mark@foo-corp.com","externalId":"118325297729072421906"},"first_name":"Mark","emails":[{"value":"mark@foo-corp.com","primary":true}],"username":"mark@foo-corp.com","last_name":"Tran"}'
|
60
|
+
http_version:
|
61
|
+
recorded_at: Thu, 30 Apr 2020 04:43:15 GMT
|
62
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,62 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.workos.com/directory_users/invalid
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
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/2.7.1; x86_64-darwin19; v0.2.3
|
18
|
+
Authorization:
|
19
|
+
- Bearer <API_KEY>
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 404
|
23
|
+
message: Not Found
|
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
|
+
X-Dns-Prefetch-Control:
|
34
|
+
- 'off'
|
35
|
+
X-Frame-Options:
|
36
|
+
- SAMEORIGIN
|
37
|
+
Strict-Transport-Security:
|
38
|
+
- max-age=15552000; includeSubDomains
|
39
|
+
X-Download-Options:
|
40
|
+
- noopen
|
41
|
+
X-Content-Type-Options:
|
42
|
+
- nosniff
|
43
|
+
X-Xss-Protection:
|
44
|
+
- 1; mode=block
|
45
|
+
X-Request-Id:
|
46
|
+
- 19dfa905-2015-44fb-8d5f-46f2d6c49826
|
47
|
+
Content-Type:
|
48
|
+
- application/json; charset=utf-8
|
49
|
+
Content-Length:
|
50
|
+
- '23'
|
51
|
+
Etag:
|
52
|
+
- W/"17-SuRA/yvUWUo8rK6x7dKURLeBo+0"
|
53
|
+
Date:
|
54
|
+
- Thu, 30 Apr 2020 04:45:35 GMT
|
55
|
+
Via:
|
56
|
+
- 1.1 vegur
|
57
|
+
body:
|
58
|
+
encoding: UTF-8
|
59
|
+
string: '{"message":"Not Found"}'
|
60
|
+
http_version:
|
61
|
+
recorded_at: Thu, 30 Apr 2020 04:45:35 GMT
|
62
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,62 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.workos.com/directories
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
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/2.7.1; x86_64-darwin19; v0.2.3
|
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
|
+
X-Dns-Prefetch-Control:
|
34
|
+
- 'off'
|
35
|
+
X-Frame-Options:
|
36
|
+
- SAMEORIGIN
|
37
|
+
Strict-Transport-Security:
|
38
|
+
- max-age=15552000; includeSubDomains
|
39
|
+
X-Download-Options:
|
40
|
+
- noopen
|
41
|
+
X-Content-Type-Options:
|
42
|
+
- nosniff
|
43
|
+
X-Xss-Protection:
|
44
|
+
- 1; mode=block
|
45
|
+
X-Request-Id:
|
46
|
+
- 53c53a76-1f3f-43bb-85a3-8faef43db375
|
47
|
+
Content-Type:
|
48
|
+
- application/json; charset=utf-8
|
49
|
+
Etag:
|
50
|
+
- W/"b53-vfsK4+PwHsj4f+pAs0MzdO3odVo"
|
51
|
+
Date:
|
52
|
+
- Thu, 30 Apr 2020 03:11:45 GMT
|
53
|
+
Transfer-Encoding:
|
54
|
+
- chunked
|
55
|
+
Via:
|
56
|
+
- 1.1 vegur
|
57
|
+
body:
|
58
|
+
encoding: ASCII-8BIT
|
59
|
+
string: '{"object":"list","listMetadata":{"before":"directory_edp_01E44H95QPBGZ6A4D89VYZ0WX1","after":null},"data":[{"object":"directory","id":"directory_edp_01E64QQVQTCB0DECJ9CFNXEWDW","external_key":"lA3gS1kCZMCkk82E","state":"linked","type":"gsuite directory","name":"Foo Corp","bearer_token":null,"project_id":"project_01DFYCG8RCB1DB6DKFTGXF4Q9F","domain":"foo-corp.com"}]}'
|
60
|
+
http_version:
|
61
|
+
recorded_at: Thu, 30 Apr 2020 03:11:45 GMT
|
62
|
+
recorded_with: VCR 5.0.0
|
data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories_with_domain_param.yml
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.workos.com/directories?domain=foo-corp.com
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
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/2.7.1; x86_64-darwin19; v0.2.3
|
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
|
+
X-Dns-Prefetch-Control:
|
34
|
+
- 'off'
|
35
|
+
X-Frame-Options:
|
36
|
+
- SAMEORIGIN
|
37
|
+
Strict-Transport-Security:
|
38
|
+
- max-age=15552000; includeSubDomains
|
39
|
+
X-Download-Options:
|
40
|
+
- noopen
|
41
|
+
X-Content-Type-Options:
|
42
|
+
- nosniff
|
43
|
+
X-Xss-Protection:
|
44
|
+
- 1; mode=block
|
45
|
+
X-Request-Id:
|
46
|
+
- '08feb93b-22e8-4955-b17d-0e5efa1ed6a4'
|
47
|
+
Content-Type:
|
48
|
+
- application/json; charset=utf-8
|
49
|
+
Content-Length:
|
50
|
+
- '330'
|
51
|
+
Etag:
|
52
|
+
- W/"14a-Q+U+kuKWjl8FQwSosUsvUraY82A"
|
53
|
+
Date:
|
54
|
+
- Thu, 30 Apr 2020 03:42:20 GMT
|
55
|
+
Via:
|
56
|
+
- 1.1 vegur
|
57
|
+
body:
|
58
|
+
encoding: UTF-8
|
59
|
+
string: '{"object":"list","listMetadata":{"before":null,"after":null},"data":[{"object":"directory","id":"directory_edp_01E64QQVQTCB0DECJ9CFNXEWDW","external_key":"lA3gS1kCZMCkk82E","state":"linked","type":"gsuite
|
60
|
+
directory","name":"Foo Corp","bearer_token":null,"project_id":"project_01DFYCG8RCB1DB6DKFTGXF4Q9F","domain":"foo-corp.com"}]}'
|
61
|
+
http_version:
|
62
|
+
recorded_at: Thu, 30 Apr 2020 03:42:20 GMT
|
63
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,64 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.workos.com/directory_groups
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
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/2.7.1; x86_64-darwin19; v0.2.3
|
18
|
+
Authorization:
|
19
|
+
- Bearer <API_KEY>
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 422
|
23
|
+
message: Unprocessable Entity
|
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
|
+
X-Dns-Prefetch-Control:
|
34
|
+
- 'off'
|
35
|
+
X-Frame-Options:
|
36
|
+
- SAMEORIGIN
|
37
|
+
Strict-Transport-Security:
|
38
|
+
- max-age=15552000; includeSubDomains
|
39
|
+
X-Download-Options:
|
40
|
+
- noopen
|
41
|
+
X-Content-Type-Options:
|
42
|
+
- nosniff
|
43
|
+
X-Xss-Protection:
|
44
|
+
- 1; mode=block
|
45
|
+
X-Request-Id:
|
46
|
+
- 3ffb5dc0-7dbe-453f-9514-6e50363b413e
|
47
|
+
Content-Type:
|
48
|
+
- application/json; charset=utf-8
|
49
|
+
Content-Length:
|
50
|
+
- '219'
|
51
|
+
Etag:
|
52
|
+
- W/"db-gphk1TAe8P3eXtQnl1v8qxKQjZs"
|
53
|
+
Date:
|
54
|
+
- Thu, 30 Apr 2020 06:24:08 GMT
|
55
|
+
Via:
|
56
|
+
- 1.1 vegur
|
57
|
+
body:
|
58
|
+
encoding: UTF-8
|
59
|
+
string: '{"message":"Validation failed","errors":[{"field":"directory","code":"Please
|
60
|
+
provide either \"directory\" or \"user\" parameters."},{"field":"user","code":"Please
|
61
|
+
provide either \"directory\" or \"user\" parameters."}]}'
|
62
|
+
http_version:
|
63
|
+
recorded_at: Thu, 30 Apr 2020 06:24:08 GMT
|
64
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,62 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.workos.com/directory_groups?directory=directory_edp_01E64QQVQTCB0DECJ9CFNXEWDW
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
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/2.7.1; x86_64-darwin19; v0.2.3
|
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
|
+
X-Dns-Prefetch-Control:
|
34
|
+
- 'off'
|
35
|
+
X-Frame-Options:
|
36
|
+
- SAMEORIGIN
|
37
|
+
Strict-Transport-Security:
|
38
|
+
- max-age=15552000; includeSubDomains
|
39
|
+
X-Download-Options:
|
40
|
+
- noopen
|
41
|
+
X-Content-Type-Options:
|
42
|
+
- nosniff
|
43
|
+
X-Xss-Protection:
|
44
|
+
- 1; mode=block
|
45
|
+
X-Request-Id:
|
46
|
+
- 87133408-9847-42ef-a6da-183280e6402c
|
47
|
+
Content-Type:
|
48
|
+
- application/json; charset=utf-8
|
49
|
+
Content-Length:
|
50
|
+
- '813'
|
51
|
+
Etag:
|
52
|
+
- W/"32d-Pi2S8kCjmY/SVPoMmwh0JNvHbgY"
|
53
|
+
Date:
|
54
|
+
- Thu, 30 Apr 2020 04:31:47 GMT
|
55
|
+
Via:
|
56
|
+
- 1.1 vegur
|
57
|
+
body:
|
58
|
+
encoding: UTF-8
|
59
|
+
string: '{"object":"list","listMetadata":{"before":"directory_grp_01E64QTDHHE80V9N03ZTDV5SXD","after":null},"data":[{"id":"directory_grp_01E64QTDNS0EGJ0FMCVY9BWGZT","name":"Walrus"},{"id":"directory_grp_01E64QTDJTE8P0S3JKM7KV848A","name":"Design team"}]}'
|
60
|
+
http_version:
|
61
|
+
recorded_at: Thu, 30 Apr 2020 04:31:47 GMT
|
62
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,64 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.workos.com/directory_users
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
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/2.7.1; x86_64-darwin19; v0.2.3
|
18
|
+
Authorization:
|
19
|
+
- Bearer <API_KEY>
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 422
|
23
|
+
message: Unprocessable Entity
|
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
|
+
X-Dns-Prefetch-Control:
|
34
|
+
- 'off'
|
35
|
+
X-Frame-Options:
|
36
|
+
- SAMEORIGIN
|
37
|
+
Strict-Transport-Security:
|
38
|
+
- max-age=15552000; includeSubDomains
|
39
|
+
X-Download-Options:
|
40
|
+
- noopen
|
41
|
+
X-Content-Type-Options:
|
42
|
+
- nosniff
|
43
|
+
X-Xss-Protection:
|
44
|
+
- 1; mode=block
|
45
|
+
X-Request-Id:
|
46
|
+
- 67a36a16-8d82-495d-a4cd-11a42e6c111e
|
47
|
+
Content-Type:
|
48
|
+
- application/json; charset=utf-8
|
49
|
+
Content-Length:
|
50
|
+
- '222'
|
51
|
+
Etag:
|
52
|
+
- W/"de-33B+CY27z2HlOGKZPu4nzUVQpuI"
|
53
|
+
Date:
|
54
|
+
- Thu, 30 Apr 2020 06:23:44 GMT
|
55
|
+
Via:
|
56
|
+
- 1.1 vegur
|
57
|
+
body:
|
58
|
+
encoding: UTF-8
|
59
|
+
string: '{"message":"Validation failed","errors":[{"field":"directory","code":"Please
|
60
|
+
provide either \"directory\" or \"group\" parameters."},{"field":"group","code":"Please
|
61
|
+
provide either \"directory\" or \"group\" parameters."}]}'
|
62
|
+
http_version:
|
63
|
+
recorded_at: Thu, 30 Apr 2020 06:23:44 GMT
|
64
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,62 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.workos.com/directory_users?directory=directory_edp_01E64QQVQTCB0DECJ9CFNXEWDW
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
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/2.7.1; x86_64-darwin19; v0.2.3
|
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
|
+
X-Dns-Prefetch-Control:
|
34
|
+
- 'off'
|
35
|
+
X-Frame-Options:
|
36
|
+
- SAMEORIGIN
|
37
|
+
Strict-Transport-Security:
|
38
|
+
- max-age=15552000; includeSubDomains
|
39
|
+
X-Download-Options:
|
40
|
+
- noopen
|
41
|
+
X-Content-Type-Options:
|
42
|
+
- nosniff
|
43
|
+
X-Xss-Protection:
|
44
|
+
- 1; mode=block
|
45
|
+
X-Request-Id:
|
46
|
+
- 91802a43-3053-41e6-9a71-44fe88321224
|
47
|
+
Content-Type:
|
48
|
+
- application/json; charset=utf-8
|
49
|
+
Etag:
|
50
|
+
- W/"e55-P0NG6CugY3cr6/bL+B4xBkwDGns"
|
51
|
+
Date:
|
52
|
+
- Thu, 30 Apr 2020 04:36:02 GMT
|
53
|
+
Transfer-Encoding:
|
54
|
+
- chunked
|
55
|
+
Via:
|
56
|
+
- 1.1 vegur
|
57
|
+
body:
|
58
|
+
encoding: ASCII-8BIT
|
59
|
+
string: '{"object":"list","listMetadata":{"before":null,"after":null},"data":[{"id":"directory_usr_01E64QS50EAY48S0XJ1AA4WX4D","raw_attributes":{"name":{"givenName":"Mark","familyName":"Tran"},"emails":[{"value":"mark@foo-corp.com","primary":true}],"userName":"mark@foo-corp.com","externalId":"118325297729072421906"},"first_name":"Mark","emails":[{"value":"mark@foo-corp.com","primary":true}],"username":"mark@foo-corp.com","last_name":"Tran"}]}'
|
60
|
+
http_version:
|
61
|
+
recorded_at: Thu, 30 Apr 2020 04:36:02 GMT
|
62
|
+
recorded_with: VCR 5.0.0
|
data/workos.gemspec
CHANGED
@@ -5,18 +5,21 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
require 'workos/version'
|
6
6
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
|
-
spec.name
|
9
|
-
spec.version
|
10
|
-
spec.authors
|
11
|
-
spec.email
|
12
|
-
spec.description
|
13
|
-
spec.summary
|
14
|
-
spec.homepage
|
15
|
-
spec.license
|
8
|
+
spec.name = 'workos'
|
9
|
+
spec.version = WorkOS::VERSION
|
10
|
+
spec.authors = ['WorkOS']
|
11
|
+
spec.email = ['support@workos.com']
|
12
|
+
spec.description = 'API client for WorkOS'
|
13
|
+
spec.summary = 'API client for WorkOS'
|
14
|
+
spec.homepage = 'https://github.com/workos-inc/workos-ruby'
|
15
|
+
spec.license = 'MIT'
|
16
|
+
spec.metadata = {
|
17
|
+
'documentation_uri' => 'https://docs.workos.com/sdk/ruby',
|
18
|
+
}
|
16
19
|
|
17
|
-
spec.files
|
18
|
-
spec.executables
|
19
|
-
spec.test_files
|
20
|
+
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
21
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
22
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
23
|
spec.require_paths = ['lib']
|
21
24
|
|
22
25
|
spec.add_dependency 'sorbet-runtime', '~> 0.5'
|
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: 0.
|
4
|
+
version: 0.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: 2020-
|
11
|
+
date: 2020-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sorbet-runtime
|
@@ -211,6 +211,7 @@ files:
|
|
211
211
|
- lib/workos/base.rb
|
212
212
|
- lib/workos/client.rb
|
213
213
|
- lib/workos/connection.rb
|
214
|
+
- lib/workos/directory_sync.rb
|
214
215
|
- lib/workos/errors.rb
|
215
216
|
- lib/workos/profile.rb
|
216
217
|
- lib/workos/sso.rb
|
@@ -230,6 +231,7 @@ files:
|
|
230
231
|
- sorbet/rbi/todo.rbi
|
231
232
|
- spec/lib/workos/audit_trail_spec.rb
|
232
233
|
- spec/lib/workos/base_spec.rb
|
234
|
+
- spec/lib/workos/directory_sync_spec.rb
|
233
235
|
- spec/lib/workos/sso_spec.rb
|
234
236
|
- spec/spec_helper.rb
|
235
237
|
- spec/support/fixtures/vcr_cassettes/audit_trail/create_event.yml
|
@@ -237,15 +239,27 @@ files:
|
|
237
239
|
- spec/support/fixtures/vcr_cassettes/audit_trail/create_event_invalid.yml
|
238
240
|
- spec/support/fixtures/vcr_cassettes/audit_trail/create_events_duplicate_idempotency_key_and_payload.yml
|
239
241
|
- spec/support/fixtures/vcr_cassettes/audit_trail/create_events_duplicate_idempotency_key_different_payload.yml
|
242
|
+
- spec/support/fixtures/vcr_cassettes/audit_trail/get_events.yml
|
240
243
|
- spec/support/fixtures/vcr_cassettes/base/execute_request_unauthenticated.yml
|
244
|
+
- spec/support/fixtures/vcr_cassettes/directory_sync/get_group.yml
|
245
|
+
- spec/support/fixtures/vcr_cassettes/directory_sync/get_group_with_invalid_id.yml
|
246
|
+
- spec/support/fixtures/vcr_cassettes/directory_sync/get_user.yml
|
247
|
+
- spec/support/fixtures/vcr_cassettes/directory_sync/get_user_with_invalid_id.yml
|
248
|
+
- spec/support/fixtures/vcr_cassettes/directory_sync/list_directories.yml
|
249
|
+
- spec/support/fixtures/vcr_cassettes/directory_sync/list_directories_with_domain_param.yml
|
250
|
+
- spec/support/fixtures/vcr_cassettes/directory_sync/list_groups.yml
|
251
|
+
- spec/support/fixtures/vcr_cassettes/directory_sync/list_groups_with_directory_param.yml
|
252
|
+
- spec/support/fixtures/vcr_cassettes/directory_sync/list_users.yml
|
253
|
+
- spec/support/fixtures/vcr_cassettes/directory_sync/list_users_with_directory_param.yml
|
241
254
|
- spec/support/fixtures/vcr_cassettes/sso/create_connection_with_invalid_source.yml
|
242
255
|
- spec/support/fixtures/vcr_cassettes/sso/create_connection_with_valid_source.yml
|
243
256
|
- spec/support/profile.txt
|
244
257
|
- workos.gemspec
|
245
|
-
homepage: https://github.com/workos/workos-ruby
|
258
|
+
homepage: https://github.com/workos-inc/workos-ruby
|
246
259
|
licenses:
|
247
260
|
- MIT
|
248
|
-
metadata:
|
261
|
+
metadata:
|
262
|
+
documentation_uri: https://docs.workos.com/sdk/ruby
|
249
263
|
post_install_message:
|
250
264
|
rdoc_options: []
|
251
265
|
require_paths:
|
@@ -261,13 +275,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
261
275
|
- !ruby/object:Gem::Version
|
262
276
|
version: '0'
|
263
277
|
requirements: []
|
264
|
-
rubygems_version: 3.1.
|
278
|
+
rubygems_version: 3.1.4
|
265
279
|
signing_key:
|
266
280
|
specification_version: 4
|
267
281
|
summary: API client for WorkOS
|
268
282
|
test_files:
|
269
283
|
- spec/lib/workos/audit_trail_spec.rb
|
270
284
|
- spec/lib/workos/base_spec.rb
|
285
|
+
- spec/lib/workos/directory_sync_spec.rb
|
271
286
|
- spec/lib/workos/sso_spec.rb
|
272
287
|
- spec/spec_helper.rb
|
273
288
|
- spec/support/fixtures/vcr_cassettes/audit_trail/create_event.yml
|
@@ -275,7 +290,18 @@ test_files:
|
|
275
290
|
- spec/support/fixtures/vcr_cassettes/audit_trail/create_event_invalid.yml
|
276
291
|
- spec/support/fixtures/vcr_cassettes/audit_trail/create_events_duplicate_idempotency_key_and_payload.yml
|
277
292
|
- spec/support/fixtures/vcr_cassettes/audit_trail/create_events_duplicate_idempotency_key_different_payload.yml
|
293
|
+
- spec/support/fixtures/vcr_cassettes/audit_trail/get_events.yml
|
278
294
|
- spec/support/fixtures/vcr_cassettes/base/execute_request_unauthenticated.yml
|
295
|
+
- spec/support/fixtures/vcr_cassettes/directory_sync/get_group.yml
|
296
|
+
- spec/support/fixtures/vcr_cassettes/directory_sync/get_group_with_invalid_id.yml
|
297
|
+
- spec/support/fixtures/vcr_cassettes/directory_sync/get_user.yml
|
298
|
+
- spec/support/fixtures/vcr_cassettes/directory_sync/get_user_with_invalid_id.yml
|
299
|
+
- spec/support/fixtures/vcr_cassettes/directory_sync/list_directories.yml
|
300
|
+
- spec/support/fixtures/vcr_cassettes/directory_sync/list_directories_with_domain_param.yml
|
301
|
+
- spec/support/fixtures/vcr_cassettes/directory_sync/list_groups.yml
|
302
|
+
- spec/support/fixtures/vcr_cassettes/directory_sync/list_groups_with_directory_param.yml
|
303
|
+
- spec/support/fixtures/vcr_cassettes/directory_sync/list_users.yml
|
304
|
+
- spec/support/fixtures/vcr_cassettes/directory_sync/list_users_with_directory_param.yml
|
279
305
|
- spec/support/fixtures/vcr_cassettes/sso/create_connection_with_invalid_source.yml
|
280
306
|
- spec/support/fixtures/vcr_cassettes/sso/create_connection_with_valid_source.yml
|
281
307
|
- spec/support/profile.txt
|