workosv2 2.15.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 +7 -0
- data/.github/CODEOWNERS +5 -0
- data/.github/pull_request_template.md +11 -0
- data/.github/renovate.json +5 -0
- data/.gitignore +49 -0
- data/.rspec +1 -0
- data/.rubocop.yml +24 -0
- data/.ruby-version +1 -0
- data/.semaphore/rubygems.yml +24 -0
- data/.semaphore/semaphore.yml +51 -0
- data/Gemfile +5 -0
- data/Gemfile.lock +126 -0
- data/Gemfile.lock.old +127 -0
- data/LICENSE +21 -0
- data/README.md +53 -0
- data/bin/build +3 -0
- data/bin/console +3 -0
- data/bin/docs +5 -0
- data/bin/publish +3 -0
- data/bin/tapioca +29 -0
- data/codecov.yml +12 -0
- data/docs/WorkOS/APIError.html +160 -0
- data/docs/WorkOS/AuditLog.html +235 -0
- data/docs/WorkOS/AuditTrail.html +235 -0
- data/docs/WorkOS/AuthenticationError.html +160 -0
- data/docs/WorkOS/Base.html +287 -0
- data/docs/WorkOS/Client.html +504 -0
- data/docs/WorkOS/InvalidRequestError.html +160 -0
- data/docs/WorkOS/Profile.html +788 -0
- data/docs/WorkOS/RequestError.html +135 -0
- data/docs/WorkOS/SSO.html +691 -0
- data/docs/WorkOS/Types/ProfileStruct.html +135 -0
- data/docs/WorkOS/Types/Provider.html +135 -0
- data/docs/WorkOS/Types.html +128 -0
- data/docs/WorkOS/WorkOSError.html +447 -0
- data/docs/WorkOS.html +324 -0
- data/docs/class_list.html +51 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +496 -0
- data/docs/file.README.html +252 -0
- data/docs/file_list.html +56 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +250 -0
- data/docs/js/app.js +314 -0
- data/docs/js/full_list.js +216 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +267 -0
- data/docs/top-level-namespace.html +110 -0
- data/lib/workosv2/audit_log_export.rb +55 -0
- data/lib/workosv2/audit_logs.rb +114 -0
- data/lib/workosv2/audit_trail.rb +111 -0
- data/lib/workosv2/challenge.rb +55 -0
- data/lib/workosv2/client.rb +186 -0
- data/lib/workosv2/configuration.rb +17 -0
- data/lib/workosv2/connection.rb +66 -0
- data/lib/workosv2/deprecated_hash_wrapper.rb +76 -0
- data/lib/workosv2/directory.rb +65 -0
- data/lib/workosv2/directory_group.rb +68 -0
- data/lib/workosv2/directory_sync.rb +218 -0
- data/lib/workosv2/directory_user.rb +97 -0
- data/lib/workosv2/errors.rb +81 -0
- data/lib/workosv2/event.rb +51 -0
- data/lib/workosv2/events.rb +52 -0
- data/lib/workosv2/factor.rb +54 -0
- data/lib/workosv2/hash_provider.rb +19 -0
- data/lib/workosv2/mfa.rb +178 -0
- data/lib/workosv2/organization.rb +57 -0
- data/lib/workosv2/organizations.rb +188 -0
- data/lib/workosv2/passwordless.rb +85 -0
- data/lib/workosv2/portal.rb +66 -0
- data/lib/workosv2/profile.rb +76 -0
- data/lib/workosv2/profile_and_token.rb +29 -0
- data/lib/workosv2/sso.rb +297 -0
- data/lib/workosv2/types/audit_log_export_struct.rb +17 -0
- data/lib/workosv2/types/challenge_struct.rb +18 -0
- data/lib/workosv2/types/connection_struct.rb +20 -0
- data/lib/workosv2/types/directory_group_struct.rb +19 -0
- data/lib/workosv2/types/directory_struct.rb +19 -0
- data/lib/workosv2/types/directory_user_struct.rb +26 -0
- data/lib/workosv2/types/event_struct.rb +15 -0
- data/lib/workosv2/types/factor_struct.rb +18 -0
- data/lib/workosv2/types/intent_enum.rb +17 -0
- data/lib/workosv2/types/list_struct.rb +13 -0
- data/lib/workosv2/types/organization_struct.rb +17 -0
- data/lib/workosv2/types/passwordless_session_struct.rb +17 -0
- data/lib/workosv2/types/profile_struct.rb +21 -0
- data/lib/workosv2/types/provider_enum.rb +15 -0
- data/lib/workosv2/types/verify_challenge_struct.rb +13 -0
- data/lib/workosv2/types/webhook_struct.rb +15 -0
- data/lib/workosv2/types.rb +25 -0
- data/lib/workosv2/verify_challenge.rb +39 -0
- data/lib/workosv2/version.rb +6 -0
- data/lib/workosv2/webhook.rb +51 -0
- data/lib/workosv2/webhooks.rb +217 -0
- data/lib/workosv2.rb +79 -0
- data/sorbet/config +2 -0
- data/sorbet/rbi/gems/addressable@2.8.0.rbi +290 -0
- data/sorbet/rbi/gems/ast@2.4.2.rbi +54 -0
- data/sorbet/rbi/gems/codecov@0.2.12.rbi +55 -0
- data/sorbet/rbi/gems/coderay@1.1.3.rbi +8 -0
- data/sorbet/rbi/gems/crack@0.4.5.rbi +57 -0
- data/sorbet/rbi/gems/diff-lcs@1.4.4.rbi +185 -0
- data/sorbet/rbi/gems/docile@1.3.5.rbi +54 -0
- data/sorbet/rbi/gems/hashdiff@1.0.1.rbi +82 -0
- data/sorbet/rbi/gems/json@2.5.1.rbi +109 -0
- data/sorbet/rbi/gems/method_source@1.0.0.rbi +8 -0
- data/sorbet/rbi/gems/parallel@1.20.1.rbi +113 -0
- data/sorbet/rbi/gems/parser@3.0.1.0.rbi +1187 -0
- data/sorbet/rbi/gems/pry@0.14.2.rbi +8 -0
- data/sorbet/rbi/gems/public_suffix@4.0.6.rbi +146 -0
- data/sorbet/rbi/gems/rainbow@3.0.0.rbi +153 -0
- data/sorbet/rbi/gems/rake@13.0.3.rbi +807 -0
- data/sorbet/rbi/gems/rbi@0.0.16.rbi +2118 -0
- data/sorbet/rbi/gems/regexp_parser@2.1.1.rbi +1117 -0
- data/sorbet/rbi/gems/rexml@3.2.5.rbi +709 -0
- data/sorbet/rbi/gems/rspec-core@3.9.3.rbi +2467 -0
- data/sorbet/rbi/gems/rspec-expectations@3.9.4.rbi +1569 -0
- data/sorbet/rbi/gems/rspec-mocks@3.9.1.rbi +1493 -0
- data/sorbet/rbi/gems/rspec-support@3.9.4.rbi +511 -0
- data/sorbet/rbi/gems/rspec@3.9.0.rbi +38 -0
- data/sorbet/rbi/gems/rubocop-ast@1.4.1.rbi +1881 -0
- data/sorbet/rbi/gems/rubocop@0.93.1.rbi +11497 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi +405 -0
- data/sorbet/rbi/gems/simplecov-html@0.12.3.rbi +89 -0
- data/sorbet/rbi/gems/simplecov@0.21.2.rbi +577 -0
- data/sorbet/rbi/gems/simplecov_json_formatter@0.1.2.rbi +8 -0
- data/sorbet/rbi/gems/spoom@1.1.15.rbi +1549 -0
- data/sorbet/rbi/gems/tapioca@0.7.3.rbi +1718 -0
- data/sorbet/rbi/gems/thor@1.2.1.rbi +844 -0
- data/sorbet/rbi/gems/unicode-display_width@1.7.0.rbi +22 -0
- data/sorbet/rbi/gems/unparser@0.6.2.rbi +8 -0
- data/sorbet/rbi/gems/vcr@5.0.0.rbi +699 -0
- data/sorbet/rbi/gems/webmock@3.12.2.rbi +662 -0
- data/sorbet/rbi/gems/yard-sorbet@0.8.0.rbi +268 -0
- data/sorbet/rbi/gems/yard@0.9.26.rbi +4048 -0
- data/sorbet/tapioca/config.yml +13 -0
- data/sorbet/tapioca/require.rb +4 -0
- data/spec/lib/workos/audit_logs_spec.rb +151 -0
- data/spec/lib/workos/audit_trail_spec.rb +146 -0
- data/spec/lib/workos/configuration_spec.rb +61 -0
- data/spec/lib/workos/directory_sync_spec.rb +492 -0
- data/spec/lib/workos/directory_user_spec.rb +36 -0
- data/spec/lib/workos/event_spec.rb +88 -0
- data/spec/lib/workos/mfa_spec.rb +281 -0
- data/spec/lib/workos/organizations_spec.rb +257 -0
- data/spec/lib/workos/passwordless_spec.rb +77 -0
- data/spec/lib/workos/portal_spec.rb +87 -0
- data/spec/lib/workos/sso_spec.rb +650 -0
- data/spec/lib/workos/webhooks_spec.rb +236 -0
- data/spec/spec_helper.rb +56 -0
- data/spec/support/fixtures/vcr_cassettes/audit_logs/create_event.yml +59 -0
- data/spec/support/fixtures/vcr_cassettes/audit_logs/create_event_custom_idempotency_key.yml +60 -0
- data/spec/support/fixtures/vcr_cassettes/audit_logs/create_event_invalid.yml +59 -0
- data/spec/support/fixtures/vcr_cassettes/audit_logs/create_export.yml +76 -0
- data/spec/support/fixtures/vcr_cassettes/audit_logs/create_export_with_filters.yml +77 -0
- data/spec/support/fixtures/vcr_cassettes/audit_logs/get_export.yml +73 -0
- data/spec/support/fixtures/vcr_cassettes/audit_trail/create_event.yml +65 -0
- data/spec/support/fixtures/vcr_cassettes/audit_trail/create_event_custom_idempotency_key.yml +67 -0
- data/spec/support/fixtures/vcr_cassettes/audit_trail/create_event_invalid.yml +68 -0
- data/spec/support/fixtures/vcr_cassettes/audit_trail/create_events_duplicate_idempotency_key_and_payload.yml +131 -0
- data/spec/support/fixtures/vcr_cassettes/audit_trail/create_events_duplicate_idempotency_key_different_payload.yml +134 -0
- data/spec/support/fixtures/vcr_cassettes/audit_trail/get_events.yml +61 -0
- data/spec/support/fixtures/vcr_cassettes/base/execute_request_unauthenticated.yml +66 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/delete_directory.yml +72 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/get_directory_with_invalid_id.yml +83 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/get_directory_with_valid_id.yml +84 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/get_group.yml +80 -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 +83 -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/with_after.yml +87 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_before.yml +89 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_domain.yml +84 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_limit.yml +85 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_no_options.yml +93 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_search.yml +85 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_after.yml +90 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_before.yml +90 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_directory.yml +90 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_limit.yml +84 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_no_options.yml +84 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_user.yml +82 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_after.yml +186 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_before.yml +88 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_directory.yml +194 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_group.yml +186 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_limit.yml +189 -0
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_no_options.yml +74 -0
- 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
- data/spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_generic_valid.yml +82 -0
- data/spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_sms_valid.yml +82 -0
- data/spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_totp_valid.yml +82 -0
- data/spec/support/fixtures/vcr_cassettes/mfa/delete_factor.yml +80 -0
- data/spec/support/fixtures/vcr_cassettes/mfa/enroll_factor_generic_valid.yml +82 -0
- data/spec/support/fixtures/vcr_cassettes/mfa/enroll_factor_sms_valid.yml +82 -0
- data/spec/support/fixtures/vcr_cassettes/mfa/enroll_factor_totp_valid.yml +82 -0
- data/spec/support/fixtures/vcr_cassettes/mfa/get_factor_invalid.yml +82 -0
- data/spec/support/fixtures/vcr_cassettes/mfa/get_factor_valid.yml +82 -0
- data/spec/support/fixtures/vcr_cassettes/mfa/verify_challenge_generic_expired.yml +84 -0
- data/spec/support/fixtures/vcr_cassettes/mfa/verify_challenge_generic_invalid.yml +84 -0
- data/spec/support/fixtures/vcr_cassettes/mfa/verify_challenge_generic_valid.yml +82 -0
- data/spec/support/fixtures/vcr_cassettes/mfa/verify_challenge_generic_valid_is_false.yml +82 -0
- data/spec/support/fixtures/vcr_cassettes/organization/create.yml +84 -0
- data/spec/support/fixtures/vcr_cassettes/organization/create_invalid.yml +72 -0
- data/spec/support/fixtures/vcr_cassettes/organization/create_with_duplicate_idempotency_key_and_different_payload.yml +155 -0
- data/spec/support/fixtures/vcr_cassettes/organization/create_with_duplicate_idempotency_key_and_payload.yml +154 -0
- data/spec/support/fixtures/vcr_cassettes/organization/create_with_idempotency_key.yml +79 -0
- data/spec/support/fixtures/vcr_cassettes/organization/delete.yml +72 -0
- data/spec/support/fixtures/vcr_cassettes/organization/delete_invalid.yml +72 -0
- data/spec/support/fixtures/vcr_cassettes/organization/get.yml +84 -0
- data/spec/support/fixtures/vcr_cassettes/organization/get_invalid.yml +72 -0
- data/spec/support/fixtures/vcr_cassettes/organization/list.yml +87 -0
- data/spec/support/fixtures/vcr_cassettes/organization/update.yml +84 -0
- data/spec/support/fixtures/vcr_cassettes/passwordless/create_session.yml +72 -0
- data/spec/support/fixtures/vcr_cassettes/passwordless/create_session_invalid.yml +73 -0
- data/spec/support/fixtures/vcr_cassettes/passwordless/send_session.yml +72 -0
- data/spec/support/fixtures/vcr_cassettes/passwordless/send_session_invalid.yml +73 -0
- data/spec/support/fixtures/vcr_cassettes/portal/generate_link_audit_logs.yml +72 -0
- data/spec/support/fixtures/vcr_cassettes/portal/generate_link_dsync.yml +72 -0
- data/spec/support/fixtures/vcr_cassettes/portal/generate_link_invalid.yml +72 -0
- data/spec/support/fixtures/vcr_cassettes/portal/generate_link_sso.yml +72 -0
- data/spec/support/fixtures/vcr_cassettes/sso/delete_connection_with_invalid_id.yml +72 -0
- data/spec/support/fixtures/vcr_cassettes/sso/delete_connection_with_valid_id.yml +70 -0
- data/spec/support/fixtures/vcr_cassettes/sso/get_connection_with_invalid_id.yml +72 -0
- data/spec/support/fixtures/vcr_cassettes/sso/get_connection_with_valid_id.yml +86 -0
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_after.yml +83 -0
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_before.yml +86 -0
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_connection_type.yml +90 -0
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_domain.yml +86 -0
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_limit.yml +83 -0
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_no_options.yml +89 -0
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_organization_id.yml +86 -0
- data/spec/support/fixtures/vcr_cassettes/sso/profile.yml +74 -0
- data/spec/support/profile.txt +1 -0
- data/spec/support/shared_examples/client_spec.rb +30 -0
- data/spec/support/webhook_payload.txt +1 -0
- data/workosv2.gemspec +38 -0
- metadata +531 -0
@@ -0,0 +1,236 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# typed: false
|
3
|
+
|
4
|
+
require 'json'
|
5
|
+
require 'openssl'
|
6
|
+
|
7
|
+
describe WorkOSV2::Webhooks do
|
8
|
+
before(:each) do
|
9
|
+
@payload = File.read("#{SPEC_ROOT}/support/webhook_payload.txt")
|
10
|
+
@secret = 'secret'
|
11
|
+
@timestamp = Time.at(Time.now.to_i * 1000)
|
12
|
+
unhashed_string = "#{@timestamp.to_i}.#{@payload}"
|
13
|
+
digest = OpenSSL::Digest.new('sha256')
|
14
|
+
@signature_hash = OpenSSL::HMAC.hexdigest(digest, @secret, unhashed_string)
|
15
|
+
@expectation = {
|
16
|
+
id: 'directory_user_01FAEAJCR3ZBZ30D8BD1924TVG',
|
17
|
+
state: 'active',
|
18
|
+
emails: [{
|
19
|
+
type: 'work',
|
20
|
+
value: 'blair@foo-corp.com',
|
21
|
+
primary: true,
|
22
|
+
}],
|
23
|
+
idp_id: '00u1e8mutl6wlH3lL4x7',
|
24
|
+
object: 'directory_user',
|
25
|
+
username: 'blair@foo-corp.com',
|
26
|
+
last_name: 'Lunchford',
|
27
|
+
first_name: 'Blair',
|
28
|
+
directory_id: 'directory_01F9M7F68PZP8QXP8G7X5QRHS7',
|
29
|
+
raw_attributes: {
|
30
|
+
name: {
|
31
|
+
givenName: 'Blair',
|
32
|
+
familyName: 'Lunchford',
|
33
|
+
middleName: 'Elizabeth',
|
34
|
+
honorificPrefix: 'Ms.',
|
35
|
+
},
|
36
|
+
title: 'Developer Success Engineer',
|
37
|
+
active: true,
|
38
|
+
emails: [{
|
39
|
+
type: 'work',
|
40
|
+
value: 'blair@foo-corp.com',
|
41
|
+
primary: true,
|
42
|
+
}],
|
43
|
+
groups: [],
|
44
|
+
locale: 'en-US',
|
45
|
+
schemas: [
|
46
|
+
'urn:ietf:params:scim:schemas:core:2.0:User',
|
47
|
+
'urn:ietf:params:scim:schemas:extension:enterprise:2.0:User'
|
48
|
+
],
|
49
|
+
userName: 'blair@foo-corp.com',
|
50
|
+
addresses: [{
|
51
|
+
region: 'CA',
|
52
|
+
primary: true,
|
53
|
+
locality: 'San Francisco',
|
54
|
+
postalCode: '94016',
|
55
|
+
}],
|
56
|
+
externalId: '00u1e8mutl6wlH3lL4x7',
|
57
|
+
displayName: 'Blair Lunchford',
|
58
|
+
"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": {
|
59
|
+
manager: {
|
60
|
+
value: '2',
|
61
|
+
displayName: 'Kate Chapman',
|
62
|
+
},
|
63
|
+
division: 'Engineering',
|
64
|
+
department: 'Customer Success',
|
65
|
+
},
|
66
|
+
},
|
67
|
+
}
|
68
|
+
end
|
69
|
+
|
70
|
+
# rubocop:disable Metrics/BlockLength
|
71
|
+
shared_examples 'WorkOSV2-Signature header failures' do
|
72
|
+
context 'with an empty header' do
|
73
|
+
it 'raises an error' do
|
74
|
+
expect do
|
75
|
+
described_class.construct_event(
|
76
|
+
payload: @payload,
|
77
|
+
sig_header: '',
|
78
|
+
secret: @secret,
|
79
|
+
)
|
80
|
+
end.to raise_error(
|
81
|
+
WorkOSV2::SignatureVerificationError,
|
82
|
+
'Unable to extract timestamp and signature hash from header',
|
83
|
+
)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
context 'with an empty signature hash' do
|
88
|
+
it 'raises an error' do
|
89
|
+
expect do
|
90
|
+
described_class.construct_event(
|
91
|
+
payload: @payload,
|
92
|
+
sig_header: "t=#{@timestamp.to_i}, v1=",
|
93
|
+
secret: @secret,
|
94
|
+
)
|
95
|
+
end.to raise_error(
|
96
|
+
WorkOSV2::SignatureVerificationError,
|
97
|
+
'No signature hash found with expected scheme v1',
|
98
|
+
)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
context 'with an incorrect signature hash' do
|
103
|
+
it 'raises an error' do
|
104
|
+
expect do
|
105
|
+
described_class.construct_event(
|
106
|
+
payload: @payload,
|
107
|
+
sig_header: "t=#{@timestamp.to_i}, v1=99999",
|
108
|
+
secret: @secret,
|
109
|
+
)
|
110
|
+
end.to raise_error(
|
111
|
+
WorkOSV2::SignatureVerificationError,
|
112
|
+
'Signature hash does not match the expected signature hash for payload',
|
113
|
+
)
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
context 'with an incorrect payload' do
|
118
|
+
it 'raises an error' do
|
119
|
+
expect do
|
120
|
+
described_class.construct_event(
|
121
|
+
payload: 'invalid',
|
122
|
+
sig_header: "t=#{@timestamp.to_i}, v1=#{@signature_hash}",
|
123
|
+
secret: @secret,
|
124
|
+
)
|
125
|
+
end.to raise_error(
|
126
|
+
WorkOSV2::SignatureVerificationError,
|
127
|
+
'Signature hash does not match the expected signature hash for payload',
|
128
|
+
)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
context 'with an incorrect webhook secret' do
|
133
|
+
it 'raises an error' do
|
134
|
+
expect do
|
135
|
+
described_class.construct_event(
|
136
|
+
payload: @payload,
|
137
|
+
sig_header: "t=#{@timestamp.to_i}, v1=#{@signature_hash}",
|
138
|
+
secret: 'invalid',
|
139
|
+
)
|
140
|
+
end.to raise_error(
|
141
|
+
WorkOSV2::SignatureVerificationError,
|
142
|
+
'Signature hash does not match the expected signature hash for payload',
|
143
|
+
)
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
context 'with a timestamp outside tolerance' do
|
148
|
+
it 'raises an error' do
|
149
|
+
expect do
|
150
|
+
described_class.construct_event(
|
151
|
+
payload: @payload,
|
152
|
+
sig_header: "t=#{@timestamp.to_i - (200 * 1000)}, v1=#{@signature_hash}",
|
153
|
+
secret: @secret,
|
154
|
+
)
|
155
|
+
end.to raise_error(
|
156
|
+
WorkOSV2::SignatureVerificationError,
|
157
|
+
'Timestamp outside the tolerance zone',
|
158
|
+
)
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
162
|
+
# rubocop:enable Metrics/BlockLength
|
163
|
+
|
164
|
+
describe '.construct_event' do
|
165
|
+
it_behaves_like 'WorkOSV2-Signature header failures'
|
166
|
+
|
167
|
+
context 'with the correct payload, sig_header, and secret' do
|
168
|
+
it 'returns a webhook event' do
|
169
|
+
webhook = described_class.construct_event(
|
170
|
+
payload: @payload,
|
171
|
+
sig_header: "t=#{@timestamp.to_i}, v1=#{@signature_hash}",
|
172
|
+
secret: @secret,
|
173
|
+
)
|
174
|
+
|
175
|
+
expect(webhook.data).to eq(@expectation)
|
176
|
+
expect(webhook.event).to eq('dsync.user.created')
|
177
|
+
expect(webhook.id).to eq('wh_123')
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
context 'with the correct payload, sig_header, secret, and tolerance' do
|
182
|
+
it 'returns a webhook event' do
|
183
|
+
webhook = described_class.construct_event(
|
184
|
+
payload: @payload,
|
185
|
+
sig_header: "t=#{@timestamp.to_i}, v1=#{@signature_hash}",
|
186
|
+
secret: @secret,
|
187
|
+
tolerance: 300,
|
188
|
+
)
|
189
|
+
|
190
|
+
expect(webhook.data).to eq(@expectation)
|
191
|
+
expect(webhook.event).to eq('dsync.user.created')
|
192
|
+
expect(webhook.id).to eq('wh_123')
|
193
|
+
end
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
describe '.verify_header' do
|
198
|
+
it_behaves_like 'WorkOSV2-Signature header failures'
|
199
|
+
|
200
|
+
it 'returns true when the signature is valid' do
|
201
|
+
described_class.verify_header(
|
202
|
+
payload: @payload,
|
203
|
+
sig_header: "t=#{@timestamp.to_i}, v1=#{@signature_hash}",
|
204
|
+
secret: @secret,
|
205
|
+
)
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
209
|
+
describe '.get_timestamp_and_signature_hash' do
|
210
|
+
it_behaves_like 'WorkOSV2-Signature header failures'
|
211
|
+
|
212
|
+
it 'returns the timestamp and signature when the signature is valid' do
|
213
|
+
timestamp_int = @timestamp.to_i
|
214
|
+
timestamp_and_signature = described_class.get_timestamp_and_signature_hash(
|
215
|
+
sig_header: "t=#{timestamp_int}, v1=#{@signature_hash}",
|
216
|
+
)
|
217
|
+
|
218
|
+
expect(timestamp_and_signature).to eq([timestamp_int.to_s, @signature_hash])
|
219
|
+
end
|
220
|
+
end
|
221
|
+
|
222
|
+
describe '.compute_signature' do
|
223
|
+
it_behaves_like 'WorkOSV2-Signature header failures'
|
224
|
+
|
225
|
+
it 'returns the computed signature' do
|
226
|
+
timestamp_int = @timestamp.to_i
|
227
|
+
signature = described_class.compute_signature(
|
228
|
+
timestamp: timestamp_int.to_s,
|
229
|
+
payload: @payload,
|
230
|
+
secret: @secret,
|
231
|
+
)
|
232
|
+
|
233
|
+
expect(signature).to eq(@signature_hash)
|
234
|
+
end
|
235
|
+
end
|
236
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# typed: false
|
3
|
+
|
4
|
+
require 'simplecov'
|
5
|
+
SimpleCov.start
|
6
|
+
|
7
|
+
if ENV['CI'] == 'true'
|
8
|
+
require 'codecov'
|
9
|
+
SimpleCov.formatter = SimpleCov::Formatter::Codecov
|
10
|
+
end
|
11
|
+
|
12
|
+
$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib')
|
13
|
+
$LOAD_PATH << File.join(File.dirname(__FILE__))
|
14
|
+
|
15
|
+
require 'rubygems'
|
16
|
+
require 'rspec'
|
17
|
+
require 'webmock/rspec'
|
18
|
+
require 'workosv2'
|
19
|
+
require 'vcr'
|
20
|
+
|
21
|
+
# Support
|
22
|
+
Dir['./spec/support/**/*.rb'].sort.each { |f| require f }
|
23
|
+
|
24
|
+
SPEC_ROOT = File.dirname __FILE__
|
25
|
+
|
26
|
+
VCR.configure do |config|
|
27
|
+
config.cassette_library_dir = 'spec/support/fixtures/vcr_cassettes'
|
28
|
+
config.filter_sensitive_data('<API_KEY>') { WorkOSV2.config.key }
|
29
|
+
config.hook_into :webmock
|
30
|
+
end
|
31
|
+
|
32
|
+
RSpec.configure do |config|
|
33
|
+
config.expect_with :rspec do |expectations|
|
34
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
35
|
+
end
|
36
|
+
|
37
|
+
config.mock_with :rspec do |mocks|
|
38
|
+
mocks.verify_partial_doubles = true
|
39
|
+
end
|
40
|
+
|
41
|
+
config.shared_context_metadata_behavior = :apply_to_host_groups
|
42
|
+
|
43
|
+
WebMock::API.prepend(Module.new do
|
44
|
+
extend self
|
45
|
+
|
46
|
+
# Disable VCR when a WebMock stub is created
|
47
|
+
# for clearer spec failure messaging
|
48
|
+
def stub_request(*args)
|
49
|
+
VCR.turn_off!
|
50
|
+
super
|
51
|
+
end
|
52
|
+
end)
|
53
|
+
|
54
|
+
config.before(:all) { WorkOSV2.config.key ||= '' }
|
55
|
+
config.before(:each) { VCR.turn_on! }
|
56
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.workos.com/audit_logs/events
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"organization_id":"org_123","event":{"action":"user.signed_in","occurred_at":"2022-08-22T15:04:19.704Z","actor":{"id":"user_123","type":"user","name":"User","metadata":{"foo":"bar"}},"targets":[{"id":"team_123","type":"team","name":"Team","metadata":{"foo":"bar"}}],"context":{"location":"1.1.1.1","user_agent":"Mozilla"}}}'
|
9
|
+
headers:
|
10
|
+
Content-Type: "application/json"
|
11
|
+
Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
|
12
|
+
Accept: "*/*"
|
13
|
+
User-Agent: "WorkOSV2; ruby/3.0.2; x86_64-darwin21; v2.5.1"
|
14
|
+
Authorization: "Bearer example_api_key"
|
15
|
+
response:
|
16
|
+
status:
|
17
|
+
code: 201
|
18
|
+
message: Created
|
19
|
+
headers:
|
20
|
+
Server:
|
21
|
+
- Cowboy
|
22
|
+
Connection:
|
23
|
+
- keep-alive
|
24
|
+
Access-Control-Allow-Origin:
|
25
|
+
- https://dashboard.workos.com
|
26
|
+
Vary:
|
27
|
+
- Origin, Accept-Encoding
|
28
|
+
Access-Control-Allow-Credentials:
|
29
|
+
- "true"
|
30
|
+
X-Dns-Prefetch-Control:
|
31
|
+
- "off"
|
32
|
+
X-Frame-Options:
|
33
|
+
- SAMEORIGIN
|
34
|
+
Strict-Transport-Security:
|
35
|
+
- max-age=15552000; includeSubDomains
|
36
|
+
X-Download-Options:
|
37
|
+
- noopen
|
38
|
+
X-Content-Type-Options:
|
39
|
+
- nosniff
|
40
|
+
X-Xss-Protection:
|
41
|
+
- 1; mode=block
|
42
|
+
X-Request-Id:
|
43
|
+
- 1cf9b8e7-5910-4a6d-a333-46bcf841422e
|
44
|
+
Content-Type:
|
45
|
+
- application/json; charset=utf-8
|
46
|
+
Content-Length:
|
47
|
+
- "16"
|
48
|
+
Etag:
|
49
|
+
- W/"10-oV4hJxRVSENxc/wX8+mA4/Pe4tA"
|
50
|
+
Date:
|
51
|
+
- Sat, 11 Jan 2020 04:22:48 GMT
|
52
|
+
Via:
|
53
|
+
- 1.1 vegur
|
54
|
+
body:
|
55
|
+
encoding: UTF-8
|
56
|
+
string: '{"success":true}'
|
57
|
+
http_version:
|
58
|
+
recorded_at: Sat, 11 Jan 2020 04:22:48 GMT
|
59
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,60 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.workos.com/audit_logs/events
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"organization_id":"org_123","event":{"action":"user.signed_in","occurred_at":"2022-08-22T15:04:19.704Z","actor":{"id":"user_123","type":"user","name":"User","metadata":{"foo":"bar"}},"targets":[{"id":"team_123","type":"team","name":"Team","metadata":{"foo":"bar"}}],"context":{"location":"1.1.1.1","user_agent":"Mozilla"}}}'
|
9
|
+
headers:
|
10
|
+
Content-Type: "application/json"
|
11
|
+
Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
|
12
|
+
Accept: "*/*"
|
13
|
+
User-Agent: "WorkOSV2; ruby/3.0.2; x86_64-darwin21; v2.5.1"
|
14
|
+
Authorization: "Bearer example_api_key"
|
15
|
+
Idempotency-Key: "idempotency_key"
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 201
|
19
|
+
message: Created
|
20
|
+
headers:
|
21
|
+
Server:
|
22
|
+
- Cowboy
|
23
|
+
Connection:
|
24
|
+
- keep-alive
|
25
|
+
Access-Control-Allow-Origin:
|
26
|
+
- https://dashboard.workos.com
|
27
|
+
Vary:
|
28
|
+
- Origin, Accept-Encoding
|
29
|
+
Access-Control-Allow-Credentials:
|
30
|
+
- "true"
|
31
|
+
X-Dns-Prefetch-Control:
|
32
|
+
- "off"
|
33
|
+
X-Frame-Options:
|
34
|
+
- SAMEORIGIN
|
35
|
+
Strict-Transport-Security:
|
36
|
+
- max-age=15552000; includeSubDomains
|
37
|
+
X-Download-Options:
|
38
|
+
- noopen
|
39
|
+
X-Content-Type-Options:
|
40
|
+
- nosniff
|
41
|
+
X-Xss-Protection:
|
42
|
+
- 1; mode=block
|
43
|
+
X-Request-Id:
|
44
|
+
- 1cf9b8e7-5910-4a6d-a333-46bcf841422e
|
45
|
+
Content-Type:
|
46
|
+
- application/json; charset=utf-8
|
47
|
+
Content-Length:
|
48
|
+
- "16"
|
49
|
+
Etag:
|
50
|
+
- W/"10-oV4hJxRVSENxc/wX8+mA4/Pe4tA"
|
51
|
+
Date:
|
52
|
+
- Sat, 11 Jan 2020 04:22:48 GMT
|
53
|
+
Via:
|
54
|
+
- 1.1 vegur
|
55
|
+
body:
|
56
|
+
encoding: UTF-8
|
57
|
+
string: '{"success":true}'
|
58
|
+
http_version:
|
59
|
+
recorded_at: Sat, 11 Jan 2020 04:22:48 GMT
|
60
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,59 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.workos.com/audit_logs/events
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"organization_id":"org_123","event":{"action":"user.signed_in","occurred_at":"2022-08-22T15:04:19.704Z","actor":{"id":"user_123","type":"user","name":"User","metadata":{"foo":"bar"}},"targets":[{"id":"team_123","type":"team","name":"Team","metadata":{"foo":"bar"}}],"context":{"location":"1.1.1.1","user_agent":"Mozilla"}}}'
|
9
|
+
headers:
|
10
|
+
Content-Type: "application/json"
|
11
|
+
Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
|
12
|
+
Accept: "*/*"
|
13
|
+
User-Agent: "WorkOSV2; ruby/3.0.2; x86_64-darwin21; v2.5.1"
|
14
|
+
Authorization: "Bearer example_api_key"
|
15
|
+
response:
|
16
|
+
status:
|
17
|
+
code: 400
|
18
|
+
message: Bad Request
|
19
|
+
headers:
|
20
|
+
Server:
|
21
|
+
- Cowboy
|
22
|
+
Connection:
|
23
|
+
- keep-alive
|
24
|
+
Access-Control-Allow-Origin:
|
25
|
+
- https://dashboard.workos.com
|
26
|
+
Vary:
|
27
|
+
- Origin, Accept-Encoding
|
28
|
+
Access-Control-Allow-Credentials:
|
29
|
+
- "true"
|
30
|
+
X-Dns-Prefetch-Control:
|
31
|
+
- "off"
|
32
|
+
X-Frame-Options:
|
33
|
+
- SAMEORIGIN
|
34
|
+
Strict-Transport-Security:
|
35
|
+
- max-age=15552000; includeSubDomains
|
36
|
+
X-Download-Options:
|
37
|
+
- noopen
|
38
|
+
X-Content-Type-Options:
|
39
|
+
- nosniff
|
40
|
+
X-Xss-Protection:
|
41
|
+
- 1; mode=block
|
42
|
+
X-Request-Id:
|
43
|
+
- 1cf9b8e7-5910-4a6d-a333-46bcf841422e
|
44
|
+
Content-Type:
|
45
|
+
- application/json; charset=utf-8
|
46
|
+
Content-Length:
|
47
|
+
- "16"
|
48
|
+
Etag:
|
49
|
+
- W/"10-oV4hJxRVSENxc/wX8+mA4/Pe4tA"
|
50
|
+
Date:
|
51
|
+
- Sat, 11 Jan 2020 04:22:48 GMT
|
52
|
+
Via:
|
53
|
+
- 1.1 vegur
|
54
|
+
body:
|
55
|
+
encoding: UTF-8
|
56
|
+
string: '{"code":"invalid_audit_log","message":"Invalid Audit Log event","errors":[{"instancePath":"/targets/0/type","schemaPath":"#/properties/targets/allOf/0/contains/properties/type/const","keyword":"const","params":{"allowValues":["team"]},"message":"must be equal to constant","schema":"team","parentSchema":{"enum":["team"],"type":"string"},"data":"user"}]}'
|
57
|
+
http_version:
|
58
|
+
recorded_at: Sat, 11 Jan 2020 04:22:48 GMT
|
59
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,76 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.workos.com/audit_logs/exports
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"organization_id":"org_123","range_start":"2022-06-22T15:04:19.704Z","range_end":"2022-08-22T15:04:19.704Z"}'
|
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
|
+
- WorkOSV2; ruby/3.0.2; x86_64-darwin21; v2.5.1
|
18
|
+
Authorization:
|
19
|
+
- "Bearer example_api_key"
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 201
|
23
|
+
message: Created
|
24
|
+
headers:
|
25
|
+
Date:
|
26
|
+
- Mon, 22 Aug 2022 17:47:49 GMT
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
Content-Length:
|
30
|
+
- "26"
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
Cf-Ray:
|
34
|
+
- 73ed6f92c9161847-ATL
|
35
|
+
Etag:
|
36
|
+
- W/"1a-pljHtlo127JYJR4E/RYOPb6ucbw"
|
37
|
+
Strict-Transport-Security:
|
38
|
+
- max-age=15552000; includeSubDomains
|
39
|
+
Vary:
|
40
|
+
- Origin, Accept-Encoding
|
41
|
+
Via:
|
42
|
+
- 1.1 spaces-router (a302eeabfffb)
|
43
|
+
Cf-Cache-Status:
|
44
|
+
- DYNAMIC
|
45
|
+
Access-Control-Allow-Credentials:
|
46
|
+
- "true"
|
47
|
+
Content-Security-Policy:
|
48
|
+
- "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self'
|
49
|
+
https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src
|
50
|
+
'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"
|
51
|
+
Expect-Ct:
|
52
|
+
- max-age=0
|
53
|
+
Referrer-Policy:
|
54
|
+
- no-referrer
|
55
|
+
X-Content-Type-Options:
|
56
|
+
- nosniff
|
57
|
+
X-Dns-Prefetch-Control:
|
58
|
+
- "off"
|
59
|
+
X-Download-Options:
|
60
|
+
- noopen
|
61
|
+
X-Frame-Options:
|
62
|
+
- SAMEORIGIN
|
63
|
+
X-Permitted-Cross-Domain-Policies:
|
64
|
+
- none
|
65
|
+
X-Request-Id:
|
66
|
+
- eb09b349-08f4-b79b-ccb2-87fa4609c1ee
|
67
|
+
X-Xss-Protection:
|
68
|
+
- "0"
|
69
|
+
Server:
|
70
|
+
- cloudflare
|
71
|
+
body:
|
72
|
+
encoding: UTF-8
|
73
|
+
string: '{"object":"audit_log_export","id":"audit_log_export_123","state":"pending","created_at":"2022-08-22T15:04:19.704Z","updated_at":"2022-08-22T15:04:19.704Z"}'
|
74
|
+
http_version:
|
75
|
+
recorded_at: Mon, 22 Aug 2022 17:47:49 GMT
|
76
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,77 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.workos.com/audit_logs/exports
|
6
|
+
body:
|
7
|
+
encoding: UTF-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 Smith"],"actor_names":["Jon Smith"],"actor_ids":["user_123"],"targets":["user","team"]}'
|
10
|
+
headers:
|
11
|
+
Content-Type:
|
12
|
+
- application/json
|
13
|
+
Accept-Encoding:
|
14
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
15
|
+
Accept:
|
16
|
+
- "*/*"
|
17
|
+
User-Agent:
|
18
|
+
- WorkOSV2; ruby/3.0.2; x86_64-darwin21; v2.5.1
|
19
|
+
Authorization:
|
20
|
+
- "Bearer example_api_key"
|
21
|
+
response:
|
22
|
+
status:
|
23
|
+
code: 201
|
24
|
+
message: Created
|
25
|
+
headers:
|
26
|
+
Date:
|
27
|
+
- Mon, 22 Aug 2022 17:47:49 GMT
|
28
|
+
Content-Type:
|
29
|
+
- application/json; charset=utf-8
|
30
|
+
Content-Length:
|
31
|
+
- "26"
|
32
|
+
Connection:
|
33
|
+
- keep-alive
|
34
|
+
Cf-Ray:
|
35
|
+
- 73ed6f92c9161847-ATL
|
36
|
+
Etag:
|
37
|
+
- W/"1a-pljHtlo127JYJR4E/RYOPb6ucbw"
|
38
|
+
Strict-Transport-Security:
|
39
|
+
- max-age=15552000; includeSubDomains
|
40
|
+
Vary:
|
41
|
+
- Origin, Accept-Encoding
|
42
|
+
Via:
|
43
|
+
- 1.1 spaces-router (a302eeabfffb)
|
44
|
+
Cf-Cache-Status:
|
45
|
+
- DYNAMIC
|
46
|
+
Access-Control-Allow-Credentials:
|
47
|
+
- "true"
|
48
|
+
Content-Security-Policy:
|
49
|
+
- "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self'
|
50
|
+
https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src
|
51
|
+
'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"
|
52
|
+
Expect-Ct:
|
53
|
+
- max-age=0
|
54
|
+
Referrer-Policy:
|
55
|
+
- no-referrer
|
56
|
+
X-Content-Type-Options:
|
57
|
+
- nosniff
|
58
|
+
X-Dns-Prefetch-Control:
|
59
|
+
- "off"
|
60
|
+
X-Download-Options:
|
61
|
+
- noopen
|
62
|
+
X-Frame-Options:
|
63
|
+
- SAMEORIGIN
|
64
|
+
X-Permitted-Cross-Domain-Policies:
|
65
|
+
- none
|
66
|
+
X-Request-Id:
|
67
|
+
- eb09b349-08f4-b79b-ccb2-87fa4609c1ee
|
68
|
+
X-Xss-Protection:
|
69
|
+
- "0"
|
70
|
+
Server:
|
71
|
+
- cloudflare
|
72
|
+
body:
|
73
|
+
encoding: UTF-8
|
74
|
+
string: '{"object":"audit_log_export","id":"audit_log_export_123","state":"pending","created_at":"2022-08-22T15:04:19.704Z","updated_at":"2022-08-22T15:04:19.704Z"}'
|
75
|
+
http_version:
|
76
|
+
recorded_at: Mon, 22 Aug 2022 17:47:49 GMT
|
77
|
+
recorded_with: VCR 5.0.0
|