workos 2.13.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/event.rb +51 -0
- data/lib/workos/events.rb +52 -0
- data/lib/workos/mfa.rb +0 -2
- data/lib/workos/sso.rb +2 -4
- data/lib/workos/types/event_struct.rb +15 -0
- data/lib/workos/types.rb +1 -0
- data/lib/workos/version.rb +1 -1
- data/lib/workos/webhooks.rb +2 -2
- data/lib/workos.rb +2 -0
- data/spec/lib/workos/audit_logs_spec.rb +2 -0
- data/spec/lib/workos/event_spec.rb +88 -0
- 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_after.yml +80 -0
- data/spec/support/fixtures/vcr_cassettes/events/list_events_with_event.yml +80 -0
- data/spec/support/fixtures/vcr_cassettes/events/list_events_with_no_options.yml +80 -0
- data/spec/support/fixtures/vcr_cassettes/events/list_events_with_range.yml +80 -0
- metadata +16 -3
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/event.rb
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# typed: true
|
3
|
+
|
4
|
+
module WorkOS
|
5
|
+
# The Event class provides a lightweight wrapper around
|
6
|
+
# a WorkOS Event resource. This class is not meant to be instantiated
|
7
|
+
# in user space, and is instantiated internally but exposed.
|
8
|
+
class Event
|
9
|
+
include HashProvider
|
10
|
+
extend T::Sig
|
11
|
+
|
12
|
+
attr_accessor :id, :event, :data, :created_at
|
13
|
+
|
14
|
+
sig { params(json: String).void }
|
15
|
+
def initialize(json)
|
16
|
+
raw = parse_json(json)
|
17
|
+
|
18
|
+
@id = T.let(raw.id, String)
|
19
|
+
@event = T.let(raw.event, String)
|
20
|
+
@created_at = T.let(raw.created_at, String)
|
21
|
+
@data = raw.data
|
22
|
+
end
|
23
|
+
|
24
|
+
def to_json(*)
|
25
|
+
{
|
26
|
+
id: id,
|
27
|
+
event: event,
|
28
|
+
data: data,
|
29
|
+
created_at: created_at,
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
sig do
|
36
|
+
params(
|
37
|
+
json_string: String,
|
38
|
+
).returns(WorkOS::Types::EventStruct)
|
39
|
+
end
|
40
|
+
def parse_json(json_string)
|
41
|
+
hash = JSON.parse(json_string, symbolize_names: true)
|
42
|
+
|
43
|
+
WorkOS::Types::EventStruct.new(
|
44
|
+
id: hash[:id],
|
45
|
+
event: hash[:event],
|
46
|
+
data: hash[:data],
|
47
|
+
created_at: hash[:created_at],
|
48
|
+
)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# typed: strict
|
3
|
+
|
4
|
+
require 'net/http'
|
5
|
+
|
6
|
+
module WorkOS
|
7
|
+
# The Events module provides convenience methods for working with the
|
8
|
+
# WorkOS Events platform. You'll need a valid API key and be in the
|
9
|
+
# Events beta to be able to access the API
|
10
|
+
#
|
11
|
+
module Events
|
12
|
+
class << self
|
13
|
+
extend T::Sig
|
14
|
+
include Client
|
15
|
+
|
16
|
+
# Retrieve events.
|
17
|
+
#
|
18
|
+
# @param [Hash] options An options hash
|
19
|
+
# @option options [String] event The type of event
|
20
|
+
# retrieved.
|
21
|
+
# @option options [String] limit Maximum number of records to return.
|
22
|
+
# @option options [String] after Pagination cursor to receive records
|
23
|
+
# after a provided Event ID.
|
24
|
+
#
|
25
|
+
# @return [Hash]
|
26
|
+
sig do
|
27
|
+
params(
|
28
|
+
options: T::Hash[Symbol, String],
|
29
|
+
).returns(WorkOS::Types::ListStruct)
|
30
|
+
end
|
31
|
+
def list_events(options = {})
|
32
|
+
response = execute_request(
|
33
|
+
request: get_request(
|
34
|
+
path: '/events',
|
35
|
+
auth: true,
|
36
|
+
params: options,
|
37
|
+
),
|
38
|
+
)
|
39
|
+
|
40
|
+
parsed_response = JSON.parse(response.body)
|
41
|
+
events = parsed_response['data'].map do |event|
|
42
|
+
::WorkOS::Event.new(event.to_json)
|
43
|
+
end
|
44
|
+
|
45
|
+
WorkOS::Types::ListStruct.new(
|
46
|
+
data: events,
|
47
|
+
list_metadata: parsed_response['listMetadata'],
|
48
|
+
)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
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
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# typed: strict
|
3
|
+
|
4
|
+
module WorkOS
|
5
|
+
module Types
|
6
|
+
# The EventStruct acts as a typed interface
|
7
|
+
# for the Event class
|
8
|
+
class EventStruct < T::Struct
|
9
|
+
const :id, String
|
10
|
+
const :event, String
|
11
|
+
const :data, T::Hash[Symbol, Object]
|
12
|
+
const :created_at, String
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/workos/types.rb
CHANGED
@@ -9,6 +9,7 @@ module WorkOS
|
|
9
9
|
require_relative 'types/connection_struct'
|
10
10
|
require_relative 'types/directory_struct'
|
11
11
|
require_relative 'types/directory_group_struct'
|
12
|
+
require_relative 'types/event_struct'
|
12
13
|
require_relative 'types/intent_enum'
|
13
14
|
require_relative 'types/list_struct'
|
14
15
|
require_relative 'types/organization_struct'
|
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
|
#
|
data/lib/workos.rb
CHANGED
@@ -46,6 +46,8 @@ module WorkOS
|
|
46
46
|
autoload :DirectorySync, 'workos/directory_sync'
|
47
47
|
autoload :Directory, 'workos/directory'
|
48
48
|
autoload :DirectoryGroup, 'workos/directory_group'
|
49
|
+
autoload :Event, 'workos/event'
|
50
|
+
autoload :Events, 'workos/events'
|
49
51
|
autoload :Organization, 'workos/organization'
|
50
52
|
autoload :Organizations, 'workos/organizations'
|
51
53
|
autoload :Passwordless, 'workos/passwordless'
|
@@ -0,0 +1,88 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# typed: false
|
3
|
+
|
4
|
+
describe WorkOS::Events do
|
5
|
+
it_behaves_like 'client'
|
6
|
+
|
7
|
+
describe '.list_events' do
|
8
|
+
context 'with no options' do
|
9
|
+
it 'returns events and metadata' do
|
10
|
+
expected_metadata = {
|
11
|
+
'after' => nil,
|
12
|
+
}
|
13
|
+
|
14
|
+
VCR.use_cassette 'events/list_events_with_no_options' do
|
15
|
+
events = described_class.list_events
|
16
|
+
|
17
|
+
expect(events.data.size).to eq(1)
|
18
|
+
expect(events.list_metadata).to eq(expected_metadata)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
context 'with event option' do
|
24
|
+
it 'forms the proper request to the API' do
|
25
|
+
request_args = [
|
26
|
+
'/events?events=connection.activated',
|
27
|
+
'Content-Type' => 'application/json'
|
28
|
+
]
|
29
|
+
|
30
|
+
expected_request = Net::HTTP::Get.new(*request_args)
|
31
|
+
|
32
|
+
expect(Net::HTTP::Get).to receive(:new).with(*request_args).
|
33
|
+
and_return(expected_request)
|
34
|
+
|
35
|
+
VCR.use_cassette 'events/list_events_with_event' do
|
36
|
+
events = described_class.list_events(
|
37
|
+
events: ['connection.activated'],
|
38
|
+
)
|
39
|
+
|
40
|
+
expect(events.data.size).to eq(1)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
context 'with the after option' do
|
46
|
+
it 'forms the proper request to the API' do
|
47
|
+
request_args = [
|
48
|
+
'/events?after=event_01FGCPNV312FHFRCX0BYWHVSE1',
|
49
|
+
'Content-Type' => 'application/json'
|
50
|
+
]
|
51
|
+
|
52
|
+
expected_request = Net::HTTP::Get.new(*request_args)
|
53
|
+
|
54
|
+
expect(Net::HTTP::Get).to receive(:new).with(*request_args).
|
55
|
+
and_return(expected_request)
|
56
|
+
|
57
|
+
VCR.use_cassette 'events/list_events_with_after' do
|
58
|
+
events = described_class.list_events(after: 'event_01FGCPNV312FHFRCX0BYWHVSE1')
|
59
|
+
|
60
|
+
expect(events.data.size).to eq(1)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
context 'with the range_start and range_end options' do
|
66
|
+
it 'forms the proper request to the API' do
|
67
|
+
request_args = [
|
68
|
+
'/events?range_start=2023-01-01T00%3A00%3A00Z&range_end=2023-01-03T00%3A00%3A00Z',
|
69
|
+
'Content-Type' => 'application/json'
|
70
|
+
]
|
71
|
+
|
72
|
+
expected_request = Net::HTTP::Get.new(*request_args)
|
73
|
+
|
74
|
+
expect(Net::HTTP::Get).to receive(:new).with(*request_args).
|
75
|
+
and_return(expected_request)
|
76
|
+
|
77
|
+
VCR.use_cassette 'events/list_events_with_range' do
|
78
|
+
events = described_class.list_events(
|
79
|
+
range_start: '2023-01-01T00:00:00Z',
|
80
|
+
range_end: '2023-01-03T00:00:00Z',
|
81
|
+
)
|
82
|
+
|
83
|
+
expect(events.data.size).to eq(1)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -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
|
@@ -0,0 +1,80 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.workos.com/events?after=event_01FGCPNV312FHFRCX0BYWHVSE1
|
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.2; arm64-darwin21; v2.3.0
|
18
|
+
Authorization:
|
19
|
+
- Bearer <API_KEY>
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Date:
|
26
|
+
- Thu, 14 Jul 2022 16:46:23 GMT
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
Content-Length:
|
30
|
+
- '616'
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
Access-Control-Allow-Credentials:
|
34
|
+
- 'true'
|
35
|
+
Content-Security-Policy:
|
36
|
+
- 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
|
37
|
+
https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
|
38
|
+
''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
|
39
|
+
Etag:
|
40
|
+
- W/"680-NPvBik348v8xg6EE7iZMYwD5UXw"
|
41
|
+
Expect-Ct:
|
42
|
+
- max-age=0
|
43
|
+
Referrer-Policy:
|
44
|
+
- no-referrer
|
45
|
+
Strict-Transport-Security:
|
46
|
+
- max-age=15552000; includeSubDomains
|
47
|
+
Vary:
|
48
|
+
- Origin, Accept-Encoding
|
49
|
+
Via:
|
50
|
+
- 1.1 spaces-router (b642bf20b975)
|
51
|
+
X-Content-Type-Options:
|
52
|
+
- nosniff
|
53
|
+
X-Dns-Prefetch-Control:
|
54
|
+
- 'off'
|
55
|
+
X-Download-Options:
|
56
|
+
- noopen
|
57
|
+
X-Frame-Options:
|
58
|
+
- SAMEORIGIN
|
59
|
+
X-Permitted-Cross-Domain-Policies:
|
60
|
+
- none
|
61
|
+
X-Request-Id:
|
62
|
+
- 51a82273-b413-cead-b968-c07ba4d6fd08
|
63
|
+
X-Xss-Protection:
|
64
|
+
- '0'
|
65
|
+
Cf-Cache-Status:
|
66
|
+
- DYNAMIC
|
67
|
+
Report-To:
|
68
|
+
- '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=OS7ELJ3A8tkzMafvaIThD%2B5JlYmul1puZlAXTxEKYBLlq%2B6DCtqDqAi4dtr4yRP3khNmg6MwPiuLqtdOXRmPOtag9Ti%2FGK8ra%2BJOlpwkFjD965CNBfzao4EJtExDkbS3"}],"group":"cf-nel","max_age":604800}'
|
69
|
+
Nel:
|
70
|
+
- '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}'
|
71
|
+
Server:
|
72
|
+
- cloudflare
|
73
|
+
Cf-Ray:
|
74
|
+
- 72abbbf2b93e8ca5-EWR
|
75
|
+
body:
|
76
|
+
encoding: ASCII-8BIT
|
77
|
+
string: '{"object":"list","data":[{"object":"event","id":"event_01FK3HFFGMC2WF32RR8SKWC8KA","event":"dsync.user.created","created_at":"2021-10-28T13:29:54.451Z","data":{"email":"foo@foocorp.com"}}], "listMetadata":{"after":null}}'
|
78
|
+
http_version:
|
79
|
+
recorded_at: Thu, 14 Jul 2022 16:46:23 GMT
|
80
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,80 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.workos.com/events?events=connection.activated
|
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.2; arm64-darwin21; v2.3.0
|
18
|
+
Authorization:
|
19
|
+
- Bearer <API_KEY>
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Date:
|
26
|
+
- Thu, 14 Jul 2022 16:46:23 GMT
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
Content-Length:
|
30
|
+
- '616'
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
Access-Control-Allow-Credentials:
|
34
|
+
- 'true'
|
35
|
+
Content-Security-Policy:
|
36
|
+
- 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
|
37
|
+
https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
|
38
|
+
''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
|
39
|
+
Etag:
|
40
|
+
- W/"680-NPvBik348v8xg6EE7iZMYwD5UXw"
|
41
|
+
Expect-Ct:
|
42
|
+
- max-age=0
|
43
|
+
Referrer-Policy:
|
44
|
+
- no-referrer
|
45
|
+
Strict-Transport-Security:
|
46
|
+
- max-age=15552000; includeSubDomains
|
47
|
+
Vary:
|
48
|
+
- Origin, Accept-Encoding
|
49
|
+
Via:
|
50
|
+
- 1.1 spaces-router (b642bf20b975)
|
51
|
+
X-Content-Type-Options:
|
52
|
+
- nosniff
|
53
|
+
X-Dns-Prefetch-Control:
|
54
|
+
- 'off'
|
55
|
+
X-Download-Options:
|
56
|
+
- noopen
|
57
|
+
X-Frame-Options:
|
58
|
+
- SAMEORIGIN
|
59
|
+
X-Permitted-Cross-Domain-Policies:
|
60
|
+
- none
|
61
|
+
X-Request-Id:
|
62
|
+
- 51a82273-b413-cead-b968-c07ba4d6fd08
|
63
|
+
X-Xss-Protection:
|
64
|
+
- '0'
|
65
|
+
Cf-Cache-Status:
|
66
|
+
- DYNAMIC
|
67
|
+
Report-To:
|
68
|
+
- '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=OS7ELJ3A8tkzMafvaIThD%2B5JlYmul1puZlAXTxEKYBLlq%2B6DCtqDqAi4dtr4yRP3khNmg6MwPiuLqtdOXRmPOtag9Ti%2FGK8ra%2BJOlpwkFjD965CNBfzao4EJtExDkbS3"}],"group":"cf-nel","max_age":604800}'
|
69
|
+
Nel:
|
70
|
+
- '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}'
|
71
|
+
Server:
|
72
|
+
- cloudflare
|
73
|
+
Cf-Ray:
|
74
|
+
- 72abbbf2b93e8ca5-EWR
|
75
|
+
body:
|
76
|
+
encoding: ASCII-8BIT
|
77
|
+
string: '{"object":"list","data":[{"object":"event","id":"event_01FK3HFFGMC2WF32RR8SKWC8KA","event":"dsync.user.created","created_at":"2021-10-28T13:29:54.451Z","data":{"email":"foo@foocorp.com"}}], "listMetadata":{"after":null}}'
|
78
|
+
http_version:
|
79
|
+
recorded_at: Thu, 14 Jul 2022 16:46:23 GMT
|
80
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,80 @@
|
|
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.2; arm64-darwin21; v2.3.0
|
18
|
+
Authorization:
|
19
|
+
- Bearer <API_KEY>
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Date:
|
26
|
+
- Thu, 14 Jul 2022 16:46:23 GMT
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
Content-Length:
|
30
|
+
- '616'
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
Access-Control-Allow-Credentials:
|
34
|
+
- 'true'
|
35
|
+
Content-Security-Policy:
|
36
|
+
- 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
|
37
|
+
https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
|
38
|
+
''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
|
39
|
+
Etag:
|
40
|
+
- W/"680-NPvBik348v8xg6EE7iZMYwD5UXw"
|
41
|
+
Expect-Ct:
|
42
|
+
- max-age=0
|
43
|
+
Referrer-Policy:
|
44
|
+
- no-referrer
|
45
|
+
Strict-Transport-Security:
|
46
|
+
- max-age=15552000; includeSubDomains
|
47
|
+
Vary:
|
48
|
+
- Origin, Accept-Encoding
|
49
|
+
Via:
|
50
|
+
- 1.1 spaces-router (b642bf20b975)
|
51
|
+
X-Content-Type-Options:
|
52
|
+
- nosniff
|
53
|
+
X-Dns-Prefetch-Control:
|
54
|
+
- 'off'
|
55
|
+
X-Download-Options:
|
56
|
+
- noopen
|
57
|
+
X-Frame-Options:
|
58
|
+
- SAMEORIGIN
|
59
|
+
X-Permitted-Cross-Domain-Policies:
|
60
|
+
- none
|
61
|
+
X-Request-Id:
|
62
|
+
- 51a82273-b413-cead-b968-c07ba4d6fd08
|
63
|
+
X-Xss-Protection:
|
64
|
+
- '0'
|
65
|
+
Cf-Cache-Status:
|
66
|
+
- DYNAMIC
|
67
|
+
Report-To:
|
68
|
+
- '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=OS7ELJ3A8tkzMafvaIThD%2B5JlYmul1puZlAXTxEKYBLlq%2B6DCtqDqAi4dtr4yRP3khNmg6MwPiuLqtdOXRmPOtag9Ti%2FGK8ra%2BJOlpwkFjD965CNBfzao4EJtExDkbS3"}],"group":"cf-nel","max_age":604800}'
|
69
|
+
Nel:
|
70
|
+
- '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}'
|
71
|
+
Server:
|
72
|
+
- cloudflare
|
73
|
+
Cf-Ray:
|
74
|
+
- 72abbbf2b93e8ca5-EWR
|
75
|
+
body:
|
76
|
+
encoding: ASCII-8BIT
|
77
|
+
string: '{"object":"list","data":[{"object":"event","id":"event_01FK3HFFGMC2WF32RR8SKWC8KA","event":"dsync.user.created","created_at":"2021-10-28T13:29:54.451Z","data":{"email":"foo@foocorp.com"}}], "listMetadata":{"after":null}}'
|
78
|
+
http_version:
|
79
|
+
recorded_at: Thu, 14 Jul 2022 16:46:23 GMT
|
80
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,80 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.workos.com/events?range_end=2023-01-03T00:00:00Z&range_start=2023-01-01T00:00:00Z
|
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.2; arm64-darwin21; v2.3.0
|
18
|
+
Authorization:
|
19
|
+
- Bearer <API_KEY>
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Date:
|
26
|
+
- Thu, 14 Jul 2022 16:46:23 GMT
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
Content-Length:
|
30
|
+
- '616'
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
Access-Control-Allow-Credentials:
|
34
|
+
- 'true'
|
35
|
+
Content-Security-Policy:
|
36
|
+
- 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
|
37
|
+
https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
|
38
|
+
''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
|
39
|
+
Etag:
|
40
|
+
- W/"680-NPvBik348v8xg6EE7iZMYwD5UXw"
|
41
|
+
Expect-Ct:
|
42
|
+
- max-age=0
|
43
|
+
Referrer-Policy:
|
44
|
+
- no-referrer
|
45
|
+
Strict-Transport-Security:
|
46
|
+
- max-age=15552000; includeSubDomains
|
47
|
+
Vary:
|
48
|
+
- Origin, Accept-Encoding
|
49
|
+
Via:
|
50
|
+
- 1.1 spaces-router (b642bf20b975)
|
51
|
+
X-Content-Type-Options:
|
52
|
+
- nosniff
|
53
|
+
X-Dns-Prefetch-Control:
|
54
|
+
- 'off'
|
55
|
+
X-Download-Options:
|
56
|
+
- noopen
|
57
|
+
X-Frame-Options:
|
58
|
+
- SAMEORIGIN
|
59
|
+
X-Permitted-Cross-Domain-Policies:
|
60
|
+
- none
|
61
|
+
X-Request-Id:
|
62
|
+
- 51a82273-b413-cead-b968-c07ba4d6fd08
|
63
|
+
X-Xss-Protection:
|
64
|
+
- '0'
|
65
|
+
Cf-Cache-Status:
|
66
|
+
- DYNAMIC
|
67
|
+
Report-To:
|
68
|
+
- '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=OS7ELJ3A8tkzMafvaIThD%2B5JlYmul1puZlAXTxEKYBLlq%2B6DCtqDqAi4dtr4yRP3khNmg6MwPiuLqtdOXRmPOtag9Ti%2FGK8ra%2BJOlpwkFjD965CNBfzao4EJtExDkbS3"}],"group":"cf-nel","max_age":604800}'
|
69
|
+
Nel:
|
70
|
+
- '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}'
|
71
|
+
Server:
|
72
|
+
- cloudflare
|
73
|
+
Cf-Ray:
|
74
|
+
- 72abbbf2b93e8ca5-EWR
|
75
|
+
body:
|
76
|
+
encoding: ASCII-8BIT
|
77
|
+
string: '{"object":"list","data":[{"object":"event","id":"event_01FK3HFFGMC2WF32RR8SKWC8KA","event":"dsync.user.created","created_at":"2021-10-28T13:29:54.451Z","data":{"email":"foo@foocorp.com"}}], "listMetadata":{"after":null}}'
|
78
|
+
http_version:
|
79
|
+
recorded_at: Thu, 14 Jul 2022 16:46:23 GMT
|
80
|
+
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.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-
|
11
|
+
date: 2023-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sorbet-runtime
|
@@ -223,6 +223,8 @@ files:
|
|
223
223
|
- lib/workos/directory_sync.rb
|
224
224
|
- lib/workos/directory_user.rb
|
225
225
|
- lib/workos/errors.rb
|
226
|
+
- lib/workos/event.rb
|
227
|
+
- lib/workos/events.rb
|
226
228
|
- lib/workos/factor.rb
|
227
229
|
- lib/workos/hash_provider.rb
|
228
230
|
- lib/workos/mfa.rb
|
@@ -240,6 +242,7 @@ files:
|
|
240
242
|
- lib/workos/types/directory_group_struct.rb
|
241
243
|
- lib/workos/types/directory_struct.rb
|
242
244
|
- lib/workos/types/directory_user_struct.rb
|
245
|
+
- lib/workos/types/event_struct.rb
|
243
246
|
- lib/workos/types/factor_struct.rb
|
244
247
|
- lib/workos/types/intent_enum.rb
|
245
248
|
- lib/workos/types/list_struct.rb
|
@@ -300,6 +303,7 @@ files:
|
|
300
303
|
- spec/lib/workos/configuration_spec.rb
|
301
304
|
- spec/lib/workos/directory_sync_spec.rb
|
302
305
|
- spec/lib/workos/directory_user_spec.rb
|
306
|
+
- spec/lib/workos/event_spec.rb
|
303
307
|
- spec/lib/workos/mfa_spec.rb
|
304
308
|
- spec/lib/workos/organizations_spec.rb
|
305
309
|
- spec/lib/workos/passwordless_spec.rb
|
@@ -345,6 +349,10 @@ files:
|
|
345
349
|
- spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_group.yml
|
346
350
|
- spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_limit.yml
|
347
351
|
- spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_no_options.yml
|
352
|
+
- spec/support/fixtures/vcr_cassettes/events/list_events_with_after.yml
|
353
|
+
- spec/support/fixtures/vcr_cassettes/events/list_events_with_event.yml
|
354
|
+
- spec/support/fixtures/vcr_cassettes/events/list_events_with_no_options.yml
|
355
|
+
- spec/support/fixtures/vcr_cassettes/events/list_events_with_range.yml
|
348
356
|
- spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_generic_valid.yml
|
349
357
|
- spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_sms_valid.yml
|
350
358
|
- spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_totp_valid.yml
|
@@ -413,7 +421,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
413
421
|
- !ruby/object:Gem::Version
|
414
422
|
version: '0'
|
415
423
|
requirements: []
|
416
|
-
rubygems_version: 3.4.
|
424
|
+
rubygems_version: 3.4.14
|
417
425
|
signing_key:
|
418
426
|
specification_version: 4
|
419
427
|
summary: API client for WorkOS
|
@@ -423,6 +431,7 @@ test_files:
|
|
423
431
|
- spec/lib/workos/configuration_spec.rb
|
424
432
|
- spec/lib/workos/directory_sync_spec.rb
|
425
433
|
- spec/lib/workos/directory_user_spec.rb
|
434
|
+
- spec/lib/workos/event_spec.rb
|
426
435
|
- spec/lib/workos/mfa_spec.rb
|
427
436
|
- spec/lib/workos/organizations_spec.rb
|
428
437
|
- spec/lib/workos/passwordless_spec.rb
|
@@ -468,6 +477,10 @@ test_files:
|
|
468
477
|
- spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_group.yml
|
469
478
|
- spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_limit.yml
|
470
479
|
- spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_no_options.yml
|
480
|
+
- spec/support/fixtures/vcr_cassettes/events/list_events_with_after.yml
|
481
|
+
- spec/support/fixtures/vcr_cassettes/events/list_events_with_event.yml
|
482
|
+
- spec/support/fixtures/vcr_cassettes/events/list_events_with_no_options.yml
|
483
|
+
- spec/support/fixtures/vcr_cassettes/events/list_events_with_range.yml
|
471
484
|
- spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_generic_valid.yml
|
472
485
|
- spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_sms_valid.yml
|
473
486
|
- spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_totp_valid.yml
|