workos 2.14.0 → 2.15.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 +1 -1
- data/lib/workos/audit_logs.rb +9 -2
- data/lib/workos/directory_user.rb +4 -6
- data/lib/workos/mfa.rb +0 -2
- data/lib/workos/sso.rb +2 -4
- data/lib/workos/version.rb +1 -1
- data/lib/workos/webhooks.rb +2 -2
- data/spec/lib/workos/audit_logs_spec.rb +2 -0
- data/spec/lib/workos/event_spec.rb +4 -4
- data/spec/support/fixtures/vcr_cassettes/audit_logs/create_export_with_filters.yml +1 -2
- data/spec/support/fixtures/vcr_cassettes/events/list_events_with_range.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: 2b01746fa31764bb3e0a381ca2e3dd0bef08a39a9e80db8d5079997e2e392d36
|
4
|
+
data.tar.gz: 79ec855c5da2d642a911b7896d353628e837c020a471d70824b39bb510e60d71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6aaee86d818a23e40de43f9f5eececdb109fe1fdbba6c4c7a50916e814976ec7a140628415c40aca4d170eb4fd3105125eb8bc4c68ea8ff695f6bb8f91baeea9
|
7
|
+
data.tar.gz: c805ad7bf051ebaeb1b5ac485f710d951d5890cd9219adbf32daa3edf653d2baa8e0fb740c550d4e0be9433d7fe6fb355d4130148a66ef9e80f7f73d76bebc66
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
data/lib/workos/audit_logs.rb
CHANGED
@@ -46,7 +46,9 @@ module WorkOS
|
|
46
46
|
# @param [String] range_start ISO-8601 datetime
|
47
47
|
# @param [String] range_end ISO-8601 datetime
|
48
48
|
# @param [Array<String>] actions A list of actions to filter by
|
49
|
-
# @param [Array<String>]
|
49
|
+
# @param [Array<String>] @deprecated use `actor_names` instead
|
50
|
+
# @param [Array<String>] actor_names A list of actor names to filter by
|
51
|
+
# @param [Array<String>] actor_ids A list of actor ids to filter by
|
50
52
|
# @param [Array<String>] targets A list of target types to filter by
|
51
53
|
#
|
52
54
|
# @return [WorkOS::AuditLogExport]
|
@@ -58,9 +60,12 @@ module WorkOS
|
|
58
60
|
actions: T.nilable(T::Array[String]),
|
59
61
|
actors: T.nilable(T::Array[String]),
|
60
62
|
targets: T.nilable(T::Array[String]),
|
63
|
+
actor_names: T.nilable(T::Array[String]),
|
64
|
+
actor_ids: T.nilable(T::Array[String]),
|
61
65
|
).returns(WorkOS::AuditLogExport)
|
62
66
|
end
|
63
|
-
def create_export(organization:, range_start:, range_end:, actions: nil,
|
67
|
+
def create_export(organization:, range_start:, range_end:, actions: nil, # rubocop:disable Metrics/ParameterLists
|
68
|
+
actors: nil, targets: nil, actor_names: nil, actor_ids: nil)
|
64
69
|
body = {
|
65
70
|
organization_id: organization,
|
66
71
|
range_start: range_start,
|
@@ -69,6 +74,8 @@ module WorkOS
|
|
69
74
|
|
70
75
|
body['actions'] = actions unless actions.nil?
|
71
76
|
body['actors'] = actors unless actors.nil?
|
77
|
+
body['actor_names'] = actor_names unless actor_names.nil?
|
78
|
+
body['actor_ids'] = actor_ids unless actor_ids.nil?
|
72
79
|
body['targets'] = targets unless targets.nil?
|
73
80
|
|
74
81
|
request = post_request(
|
@@ -13,7 +13,7 @@ module WorkOS
|
|
13
13
|
:groups, :custom_attributes, :raw_attributes, :directory_id, :organization_id,
|
14
14
|
:created_at, :updated_at
|
15
15
|
|
16
|
-
# rubocop:disable Metrics/AbcSize
|
16
|
+
# rubocop:disable Metrics/AbcSize
|
17
17
|
sig { params(json: String).void }
|
18
18
|
def initialize(json)
|
19
19
|
raw = parse_json(json)
|
@@ -36,9 +36,8 @@ module WorkOS
|
|
36
36
|
|
37
37
|
replace_without_warning(to_json)
|
38
38
|
end
|
39
|
-
# rubocop:enable Metrics/AbcSize
|
39
|
+
# rubocop:enable Metrics/AbcSize
|
40
40
|
|
41
|
-
# rubocop:disable Metrics/MethodLength
|
42
41
|
def to_json(*)
|
43
42
|
{
|
44
43
|
id: id,
|
@@ -58,7 +57,6 @@ module WorkOS
|
|
58
57
|
updated_at: updated_at,
|
59
58
|
}
|
60
59
|
end
|
61
|
-
# rubocop:enable Metrics/MethodLength
|
62
60
|
|
63
61
|
def primary_email
|
64
62
|
primary_email = (emails || []).find { |email| email[:primary] }
|
@@ -67,7 +65,7 @@ module WorkOS
|
|
67
65
|
|
68
66
|
private
|
69
67
|
|
70
|
-
# rubocop:disable Metrics/
|
68
|
+
# rubocop:disable Metrics/AbcSize
|
71
69
|
sig do
|
72
70
|
params(
|
73
71
|
json_string: String,
|
@@ -94,6 +92,6 @@ module WorkOS
|
|
94
92
|
raw_attributes: hash[:raw_attributes],
|
95
93
|
)
|
96
94
|
end
|
97
|
-
# rubocop:enable Metrics/
|
95
|
+
# rubocop:enable Metrics/AbcSize
|
98
96
|
end
|
99
97
|
end
|
data/lib/workos/mfa.rb
CHANGED
@@ -76,7 +76,6 @@ module WorkOS
|
|
76
76
|
phone_number: T.nilable(String),
|
77
77
|
).returns(WorkOS::Factor)
|
78
78
|
end
|
79
|
-
# rubocop:disable Metrics/MethodLength
|
80
79
|
def enroll_factor(
|
81
80
|
type:,
|
82
81
|
totp_issuer: nil,
|
@@ -101,7 +100,6 @@ module WorkOS
|
|
101
100
|
))
|
102
101
|
WorkOS::Factor.new(response.body)
|
103
102
|
end
|
104
|
-
# rubocop:enable Metrics/MethodLength
|
105
103
|
|
106
104
|
sig do
|
107
105
|
params(
|
data/lib/workos/sso.rb
CHANGED
@@ -54,7 +54,7 @@ module WorkOS
|
|
54
54
|
# "response_type=code&state=%7B%3Anext_page%3D%3E%22%2Fdocs%22%7D"
|
55
55
|
#
|
56
56
|
# @return [String]
|
57
|
-
# rubocop:disable Metrics/
|
57
|
+
# rubocop:disable Metrics/ParameterLists
|
58
58
|
sig do
|
59
59
|
params(
|
60
60
|
redirect_uri: String,
|
@@ -106,7 +106,7 @@ module WorkOS
|
|
106
106
|
|
107
107
|
"https://#{WorkOS::API_HOSTNAME}/sso/authorize?#{query}"
|
108
108
|
end
|
109
|
-
# rubocop:enable Metrics/
|
109
|
+
# rubocop:enable Metrics/ParameterLists
|
110
110
|
|
111
111
|
sig do
|
112
112
|
params(
|
@@ -271,7 +271,6 @@ module WorkOS
|
|
271
271
|
end
|
272
272
|
|
273
273
|
sig { params(response: Net::HTTPResponse).void }
|
274
|
-
# rubocop:disable Metrics/MethodLength
|
275
274
|
def check_and_raise_profile_and_token_error(response:)
|
276
275
|
begin
|
277
276
|
body = JSON.parse(response.body)
|
@@ -293,7 +292,6 @@ module WorkOS
|
|
293
292
|
request_id: request_id,
|
294
293
|
)
|
295
294
|
end
|
296
|
-
# rubocop:enable Metrics/MethodLength
|
297
295
|
end
|
298
296
|
end
|
299
297
|
end
|
data/lib/workos/version.rb
CHANGED
data/lib/workos/webhooks.rb
CHANGED
@@ -82,7 +82,7 @@ module WorkOS
|
|
82
82
|
tolerance: Integer,
|
83
83
|
).returns(T::Boolean)
|
84
84
|
end
|
85
|
-
# rubocop:disable Metrics/
|
85
|
+
# rubocop:disable Metrics/AbcSize
|
86
86
|
def verify_header(
|
87
87
|
payload:,
|
88
88
|
sig_header:,
|
@@ -120,7 +120,7 @@ module WorkOS
|
|
120
120
|
|
121
121
|
true
|
122
122
|
end
|
123
|
-
# rubocop:enable Metrics/
|
123
|
+
# rubocop:enable Metrics/AbcSize
|
124
124
|
|
125
125
|
# Extracts timestamp and signature hash from WorkOS-Signature header
|
126
126
|
#
|
@@ -62,10 +62,10 @@ describe WorkOS::Events do
|
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
|
-
context 'with the
|
65
|
+
context 'with the range_start and range_end options' do
|
66
66
|
it 'forms the proper request to the API' do
|
67
67
|
request_args = [
|
68
|
-
'/events?
|
68
|
+
'/events?range_start=2023-01-01T00%3A00%3A00Z&range_end=2023-01-03T00%3A00%3A00Z',
|
69
69
|
'Content-Type' => 'application/json'
|
70
70
|
]
|
71
71
|
|
@@ -76,8 +76,8 @@ describe WorkOS::Events do
|
|
76
76
|
|
77
77
|
VCR.use_cassette 'events/list_events_with_range' do
|
78
78
|
events = described_class.list_events(
|
79
|
-
|
80
|
-
|
79
|
+
range_start: '2023-01-01T00:00:00Z',
|
80
|
+
range_end: '2023-01-03T00:00:00Z',
|
81
81
|
)
|
82
82
|
|
83
83
|
expect(events.data.size).to eq(1)
|
@@ -6,8 +6,7 @@ http_interactions:
|
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string:
|
9
|
-
'{"organization_id":"org_123","range_start":"2022-06-22T15:04:19.704Z","range_end":"2022-08-22T15:04:19.704Z","actions":["user.signed_in"],"actors":["Jon
|
10
|
-
Smith"],"targets":["user","team"]}'
|
9
|
+
'{"organization_id":"org_123","range_start":"2022-06-22T15:04:19.704Z","range_end":"2022-08-22T15:04:19.704Z","actions":["user.signed_in"],"actors":["Jon Smith"],"actor_names":["Jon Smith"],"actor_ids":["user_123"],"targets":["user","team"]}'
|
11
10
|
headers:
|
12
11
|
Content-Type:
|
13
12
|
- application/json
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://api.workos.com/events?
|
5
|
+
uri: https://api.workos.com/events?range_end=2023-01-03T00:00:00Z&range_start=2023-01-01T00:00:00Z
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
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.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- WorkOS
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sorbet-runtime
|