noresponse 2.0.17 → 2.0.19
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/lib/no_response/integrations.rb +1156 -0
- data/lib/no_response/models/operations/createintegration_response.rb +32 -0
- data/lib/no_response/models/operations/createintegration_response.rbi +20 -0
- data/lib/no_response/models/operations/createwebhookendpoint_response.rb +34 -0
- data/lib/no_response/models/operations/createwebhookendpoint_response.rbi +20 -0
- data/lib/no_response/models/operations/deleteintegration_request.rb +33 -0
- data/lib/no_response/models/operations/deleteintegration_request.rbi +14 -0
- data/lib/no_response/models/operations/deleteintegration_response.rb +28 -0
- data/lib/no_response/models/operations/deleteintegration_response.rbi +14 -0
- data/lib/no_response/models/operations/deletewebhookendpoint_request.rb +29 -0
- data/lib/no_response/models/operations/deletewebhookendpoint_request.rbi +14 -0
- data/lib/no_response/models/operations/deletewebhookendpoint_response.rb +28 -0
- data/lib/no_response/models/operations/deletewebhookendpoint_response.rbi +14 -0
- data/lib/no_response/models/operations/listintegrations_response.rb +32 -0
- data/lib/no_response/models/operations/listintegrations_response.rbi +20 -0
- data/lib/no_response/models/operations/listwebhookendpoints_response.rb +32 -0
- data/lib/no_response/models/operations/listwebhookendpoints_response.rbi +20 -0
- data/lib/no_response/models/operations/rotateintegrationsecret_request.rb +37 -0
- data/lib/no_response/models/operations/rotateintegrationsecret_request.rbi +20 -0
- data/lib/no_response/models/operations/rotateintegrationsecret_response.rb +32 -0
- data/lib/no_response/models/operations/rotateintegrationsecret_response.rbi +20 -0
- data/lib/no_response/models/operations/rotatewebhooksigningkey_request.rb +33 -0
- data/lib/no_response/models/operations/rotatewebhooksigningkey_request.rbi +20 -0
- data/lib/no_response/models/operations/rotatewebhooksigningkey_response.rb +32 -0
- data/lib/no_response/models/operations/rotatewebhooksigningkey_response.rbi +20 -0
- data/lib/no_response/models/operations/sendwebhooktestevent_request.rb +33 -0
- data/lib/no_response/models/operations/sendwebhooktestevent_request.rbi +20 -0
- data/lib/no_response/models/operations/sendwebhooktestevent_response.rb +32 -0
- data/lib/no_response/models/operations/sendwebhooktestevent_response.rbi +20 -0
- data/lib/no_response/models/operations.rb +14 -0
- data/lib/no_response/models/shared/assessmentquery.rb +1 -1
- data/lib/no_response/models/shared/assessmentrequest.rb +1 -1
- data/lib/no_response/models/shared/badrequesterrorcode.rb +1 -0
- data/lib/no_response/models/shared/conflicterrorcode.rb +3 -0
- data/lib/no_response/models/shared/integration.rb +112 -0
- data/lib/no_response/models/shared/integration.rbi +56 -0
- data/lib/no_response/models/shared/integrationhookpoint.rb +19 -0
- data/lib/no_response/models/shared/integrationhookpoint.rbi +9 -0
- data/lib/no_response/models/shared/integrationlist.rb +32 -0
- data/lib/no_response/models/shared/integrationlist.rbi +14 -0
- data/lib/no_response/models/shared/integrationplatform.rb +19 -0
- data/lib/no_response/models/shared/integrationplatform.rbi +9 -0
- data/lib/no_response/models/shared/integrationrequest.rb +62 -0
- data/lib/no_response/models/shared/integrationrequest.rbi +26 -0
- data/lib/no_response/models/shared/integrationrotationrequest.rb +33 -0
- data/lib/no_response/models/shared/integrationrotationrequest.rbi +14 -0
- data/lib/no_response/models/shared/responsemode.rb +4 -1
- data/lib/no_response/models/shared/scope.rb +1 -0
- data/lib/no_response/models/shared/signingkey.rb +49 -0
- data/lib/no_response/models/shared/signingkey.rbi +26 -0
- data/lib/no_response/models/shared/signingsecret.rb +49 -0
- data/lib/no_response/models/shared/signingsecret.rbi +26 -0
- data/lib/no_response/models/shared/webhookendpoint.rb +100 -0
- data/lib/no_response/models/shared/webhookendpoint.rbi +50 -0
- data/lib/no_response/models/shared/webhookendpointcreated.rb +41 -0
- data/lib/no_response/models/shared/webhookendpointcreated.rbi +20 -0
- data/lib/no_response/models/shared/webhookendpointlist.rb +32 -0
- data/lib/no_response/models/shared/webhookendpointlist.rbi +14 -0
- data/lib/no_response/models/shared/webhookendpointrequest.rb +42 -0
- data/lib/no_response/models/shared/webhookendpointrequest.rbi +20 -0
- data/lib/no_response/models/shared/webhookendpointstate.rb +20 -0
- data/lib/no_response/models/shared/webhookendpointstate.rbi +9 -0
- data/lib/no_response/models/shared/webhookkeyrotation.rb +65 -0
- data/lib/no_response/models/shared/webhookkeyrotation.rbi +32 -0
- data/lib/no_response/models/shared/webhookkeyrotationrequest.rb +23 -0
- data/lib/no_response/models/shared/webhookkeyrotationrequest.rbi +9 -0
- data/lib/no_response/models/shared/webhooktest.rb +86 -0
- data/lib/no_response/models/shared/webhooktest.rbi +38 -0
- data/lib/no_response/models/shared/webhooktestrequest.rb +39 -0
- data/lib/no_response/models/shared/webhooktestrequest.rbi +14 -0
- data/lib/no_response/models/shared/webhooktestrequestevent.rb +19 -0
- data/lib/no_response/models/shared/webhooktestrequestevent.rbi +9 -0
- data/lib/no_response/models/shared.rb +18 -0
- data/lib/no_response/noresponseclient.rb +3 -1
- data/lib/no_response/sdkconfiguration.rb +2 -2
- data/lib/no_response/webhookendpoints.rb +1444 -0
- data/lib/noresponse.rb +2 -0
- metadata +67 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module NoResponse
|
|
5
|
+
module Models
|
|
6
|
+
module Operations
|
|
7
|
+
|
|
8
|
+
class SendWebhookTestEventResponse
|
|
9
|
+
extend T::Sig
|
|
10
|
+
include Crystalline::MetadataFields
|
|
11
|
+
|
|
12
|
+
field :headers, Crystalline::Hash.new(Symbol, Crystalline::Array.new(::String))
|
|
13
|
+
|
|
14
|
+
field :result, Models::Shared::WebhookTest, {}
|
|
15
|
+
|
|
16
|
+
sig { params(headers: T::Hash[Symbol, T::Array[::String]], result: Models::Shared::WebhookTest).void }
|
|
17
|
+
def initialize(headers:, result:)
|
|
18
|
+
@headers = headers
|
|
19
|
+
@result = result
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
23
|
+
def ==(other)
|
|
24
|
+
return false unless other.is_a?(self.class)
|
|
25
|
+
return false unless @headers == other.headers
|
|
26
|
+
return false unless @result == other.result
|
|
27
|
+
true
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
class NoResponse::Models::Operations::SendWebhookTestEventResponse
|
|
5
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
class NoResponse::Models::Operations::SendWebhookTestEventResponse
|
|
9
|
+
def headers
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def headers=(str_)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def result
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def result=(str_)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -6,12 +6,26 @@ module NoResponse
|
|
|
6
6
|
module Operations
|
|
7
7
|
autoload :CreateAssessmentRequest, "no_response/models/operations/createassessment_request.rb"
|
|
8
8
|
autoload :CreateAssessmentResponse, "no_response/models/operations/createassessment_response.rb"
|
|
9
|
+
autoload :CreateIntegrationResponse, "no_response/models/operations/createintegration_response.rb"
|
|
10
|
+
autoload :CreateWebhookEndpointResponse, "no_response/models/operations/createwebhookendpoint_response.rb"
|
|
11
|
+
autoload :DeleteIntegrationRequest, "no_response/models/operations/deleteintegration_request.rb"
|
|
12
|
+
autoload :DeleteIntegrationResponse, "no_response/models/operations/deleteintegration_response.rb"
|
|
13
|
+
autoload :DeleteWebhookEndpointRequest, "no_response/models/operations/deletewebhookendpoint_request.rb"
|
|
14
|
+
autoload :DeleteWebhookEndpointResponse, "no_response/models/operations/deletewebhookendpoint_response.rb"
|
|
9
15
|
autoload :GetAssessmentRequest, "no_response/models/operations/getassessment_request.rb"
|
|
10
16
|
autoload :GetAssessmentResponse, "no_response/models/operations/getassessment_response.rb"
|
|
17
|
+
autoload :ListIntegrationsResponse, "no_response/models/operations/listintegrations_response.rb"
|
|
18
|
+
autoload :ListWebhookEndpointsResponse, "no_response/models/operations/listwebhookendpoints_response.rb"
|
|
11
19
|
autoload :QueryAccountAssessmentsResponse, "no_response/models/operations/queryaccountassessments_response.rb"
|
|
12
20
|
autoload :RecordAssessmentOutcomeRequest, "no_response/models/operations/recordassessmentoutcome_request.rb"
|
|
13
21
|
autoload :RecordAssessmentOutcomeResponse, "no_response/models/operations/recordassessmentoutcome_response.rb"
|
|
14
22
|
autoload :RotateApiKeyResponse, "no_response/models/operations/rotateapikey_response.rb"
|
|
23
|
+
autoload :RotateIntegrationSecretRequest, "no_response/models/operations/rotateintegrationsecret_request.rb"
|
|
24
|
+
autoload :RotateIntegrationSecretResponse, "no_response/models/operations/rotateintegrationsecret_response.rb"
|
|
25
|
+
autoload :RotateWebhookSigningKeyRequest, "no_response/models/operations/rotatewebhooksigningkey_request.rb"
|
|
26
|
+
autoload :RotateWebhookSigningKeyResponse, "no_response/models/operations/rotatewebhooksigningkey_response.rb"
|
|
27
|
+
autoload :SendWebhookTestEventRequest, "no_response/models/operations/sendwebhooktestevent_request.rb"
|
|
28
|
+
autoload :SendWebhookTestEventResponse, "no_response/models/operations/sendwebhooktestevent_response.rb"
|
|
15
29
|
end
|
|
16
30
|
end
|
|
17
31
|
end
|
|
@@ -28,7 +28,7 @@ module NoResponse
|
|
|
28
28
|
{
|
|
29
29
|
'format_json': {
|
|
30
30
|
'letter_case': ::NoResponse::Utils.field_name("response_mode"),
|
|
31
|
-
'decoder': ::NoResponse::Utils.
|
|
31
|
+
'decoder': ::NoResponse::Utils.open_enum_from_string(Models::Shared::ResponseMode, true)
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
)
|
|
@@ -46,7 +46,7 @@ module NoResponse
|
|
|
46
46
|
{
|
|
47
47
|
'format_json': {
|
|
48
48
|
'letter_case': ::NoResponse::Utils.field_name("response_mode"),
|
|
49
|
-
'decoder': ::NoResponse::Utils.
|
|
49
|
+
'decoder': ::NoResponse::Utils.open_enum_from_string(Models::Shared::ResponseMode, true)
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
)
|
|
@@ -10,6 +10,9 @@ module NoResponse
|
|
|
10
10
|
enums do
|
|
11
11
|
IDEMPOTENCY_KEY_REUSED = new("idempotency_key_reused")
|
|
12
12
|
KEY_ROTATION_IN_PROGRESS = new("key_rotation_in_progress")
|
|
13
|
+
WEBHOOK_ENDPOINT_LIMIT_REACHED = new("webhook_endpoint_limit_reached")
|
|
14
|
+
WEBHOOK_ENDPOINT_UNVERIFIED = new("webhook_endpoint_unverified")
|
|
15
|
+
TOO_MANY_INTEGRATIONS = new("too_many_integrations")
|
|
13
16
|
end
|
|
14
17
|
|
|
15
18
|
open!
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module NoResponse
|
|
5
|
+
module Models
|
|
6
|
+
module Shared
|
|
7
|
+
# A hosted provider integration. Point the provider at url: a WorkOS user registration or authentication Action, or the NoResponse Auth0 Action, which sends secret as a bearer token. The answer allows or denies the event: deny only when the assessment's risk.block is true, and allow on every failure, so a fault on the NoResponse side lets the user through. secret is present only in the answers of POST /v1/integrations and POST /v1/integrations/{integration_id}/rotate for an Auth0 integration, and is not returned again.
|
|
8
|
+
class Integration
|
|
9
|
+
extend T::Sig
|
|
10
|
+
include Crystalline::MetadataFields
|
|
11
|
+
|
|
12
|
+
# Opaque, server-assigned integration id: int_ and a 26-character Crockford base32 ULID. Another tenant's integration id answers 404.
|
|
13
|
+
field(
|
|
14
|
+
:integration_id,
|
|
15
|
+
::String,
|
|
16
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("integration_id"), required: true}}
|
|
17
|
+
)
|
|
18
|
+
# The authentication provider that calls the endpoint.
|
|
19
|
+
field(
|
|
20
|
+
:platform,
|
|
21
|
+
Models::Shared::IntegrationPlatform,
|
|
22
|
+
{
|
|
23
|
+
'format_json': {
|
|
24
|
+
'letter_case': ::NoResponse::Utils.field_name("platform"),
|
|
25
|
+
required: true,
|
|
26
|
+
'decoder': ::NoResponse::Utils.open_enum_from_string(Models::Shared::IntegrationPlatform, false)
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
# Each hook point at most once.
|
|
31
|
+
field(
|
|
32
|
+
:hook_points,
|
|
33
|
+
Crystalline::Array.new(Models::Shared::IntegrationHookPoint),
|
|
34
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("hook_points"), required: true}}
|
|
35
|
+
)
|
|
36
|
+
# The hosted endpoint, https://api.noresponse.org/hooks/{integration_id} in production.
|
|
37
|
+
field :url, ::String, {'format_json': {'letter_case': ::NoResponse::Utils.field_name("url"), required: true}}
|
|
38
|
+
|
|
39
|
+
field(
|
|
40
|
+
:created_at,
|
|
41
|
+
::String,
|
|
42
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("created_at"), required: true}}
|
|
43
|
+
)
|
|
44
|
+
# Auth0 only, and only when it is created or rotated: the shared secret the Auth0 Action sends as Authorization: Bearer <secret>. nri_ and 43 unpadded base64url characters (32 random bytes). Store it as an Auth0 Action secret.
|
|
45
|
+
field(
|
|
46
|
+
:secret,
|
|
47
|
+
Crystalline::Nilable.new(::String),
|
|
48
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("secret")}}
|
|
49
|
+
)
|
|
50
|
+
# When the secret was last rotated; absent until the first rotation.
|
|
51
|
+
field(
|
|
52
|
+
:rotated_at,
|
|
53
|
+
Crystalline::Nilable.new(::String),
|
|
54
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("rotated_at")}}
|
|
55
|
+
)
|
|
56
|
+
# After a rotation, when the replaced secret stops being accepted; absent when no replaced secret is still accepted.
|
|
57
|
+
field(
|
|
58
|
+
:previous_secret_expires_at,
|
|
59
|
+
Crystalline::Nilable.new(::String),
|
|
60
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("previous_secret_expires_at")}}
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
sig {
|
|
64
|
+
params(
|
|
65
|
+
integration_id: ::String,
|
|
66
|
+
platform: Models::Shared::IntegrationPlatform,
|
|
67
|
+
hook_points: T::Array[Models::Shared::IntegrationHookPoint],
|
|
68
|
+
url: ::String,
|
|
69
|
+
created_at: ::String,
|
|
70
|
+
secret: T.nilable(::String),
|
|
71
|
+
rotated_at: T.nilable(::String),
|
|
72
|
+
previous_secret_expires_at: T.nilable(::String)
|
|
73
|
+
)
|
|
74
|
+
.void
|
|
75
|
+
}
|
|
76
|
+
def initialize(
|
|
77
|
+
integration_id:,
|
|
78
|
+
platform:,
|
|
79
|
+
hook_points:,
|
|
80
|
+
url:,
|
|
81
|
+
created_at:,
|
|
82
|
+
secret: nil,
|
|
83
|
+
rotated_at: nil,
|
|
84
|
+
previous_secret_expires_at: nil
|
|
85
|
+
)
|
|
86
|
+
@integration_id = integration_id
|
|
87
|
+
@platform = platform
|
|
88
|
+
@hook_points = hook_points
|
|
89
|
+
@url = url
|
|
90
|
+
@created_at = created_at
|
|
91
|
+
@secret = secret
|
|
92
|
+
@rotated_at = rotated_at
|
|
93
|
+
@previous_secret_expires_at = previous_secret_expires_at
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
97
|
+
def ==(other)
|
|
98
|
+
return false unless other.is_a?(self.class)
|
|
99
|
+
return false unless @integration_id == other.integration_id
|
|
100
|
+
return false unless @platform == other.platform
|
|
101
|
+
return false unless @hook_points == other.hook_points
|
|
102
|
+
return false unless @url == other.url
|
|
103
|
+
return false unless @created_at == other.created_at
|
|
104
|
+
return false unless @secret == other.secret
|
|
105
|
+
return false unless @rotated_at == other.rotated_at
|
|
106
|
+
return false unless @previous_secret_expires_at == other.previous_secret_expires_at
|
|
107
|
+
true
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
class NoResponse::Models::Shared::Integration
|
|
5
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
class NoResponse::Models::Shared::Integration
|
|
9
|
+
def integration_id
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def integration_id=(str_)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def platform
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def platform=(str_)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def hook_points
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def hook_points=(str_)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def url
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def url=(str_)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def created_at
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def created_at=(str_)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def secret
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def secret=(str_)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def rotated_at
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def rotated_at=(str_)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def previous_secret_expires_at
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def previous_secret_expires_at=(str_)
|
|
55
|
+
end
|
|
56
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module NoResponse
|
|
5
|
+
module Models
|
|
6
|
+
module Shared
|
|
7
|
+
# IntegrationHookPoint - pre_registration runs before the user exists; post_login runs after a successful sign-in.
|
|
8
|
+
class IntegrationHookPoint
|
|
9
|
+
include ::Crystalline::Enum
|
|
10
|
+
enums do
|
|
11
|
+
PRE_REGISTRATION = new("pre_registration")
|
|
12
|
+
POST_LOGIN = new("post_login")
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
open!
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module NoResponse
|
|
5
|
+
module Models
|
|
6
|
+
module Shared
|
|
7
|
+
# GET /v1/integrations: every integration of the tenant, oldest first, at most 10. No secret is ever listed.
|
|
8
|
+
class IntegrationList
|
|
9
|
+
extend T::Sig
|
|
10
|
+
include Crystalline::MetadataFields
|
|
11
|
+
|
|
12
|
+
field(
|
|
13
|
+
:items,
|
|
14
|
+
Crystalline::Array.new(Models::Shared::Integration),
|
|
15
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("items"), required: true}}
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
sig { params(items: T::Array[Models::Shared::Integration]).void }
|
|
19
|
+
def initialize(items:)
|
|
20
|
+
@items = items
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
24
|
+
def ==(other)
|
|
25
|
+
return false unless other.is_a?(self.class)
|
|
26
|
+
return false unless @items == other.items
|
|
27
|
+
true
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
class NoResponse::Models::Shared::IntegrationList
|
|
5
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
class NoResponse::Models::Shared::IntegrationList
|
|
9
|
+
def items
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def items=(str_)
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module NoResponse
|
|
5
|
+
module Models
|
|
6
|
+
module Shared
|
|
7
|
+
# IntegrationPlatform - The authentication provider that calls the endpoint.
|
|
8
|
+
class IntegrationPlatform
|
|
9
|
+
include ::Crystalline::Enum
|
|
10
|
+
enums do
|
|
11
|
+
WORKOS = new("workos")
|
|
12
|
+
AUTH0 = new("auth0")
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
open!
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module NoResponse
|
|
5
|
+
module Models
|
|
6
|
+
module Shared
|
|
7
|
+
# POST /v1/integrations body. Registers a hosted endpoint for one authentication provider. The tenant is the API key that signs the request, so the body has no tenant field and refuses one like any other unknown member. A WorkOS integration needs signing_secret, the Actions secret shown in the WorkOS dashboard, which NoResponse uses to verify each Action request and to sign its answer. An Auth0 integration sends no signing_secret: NoResponse generates the shared secret and returns it once.
|
|
8
|
+
class IntegrationRequest
|
|
9
|
+
extend T::Sig
|
|
10
|
+
include Crystalline::MetadataFields
|
|
11
|
+
|
|
12
|
+
# The authentication provider that calls the endpoint.
|
|
13
|
+
field(
|
|
14
|
+
:platform,
|
|
15
|
+
Models::Shared::IntegrationPlatform,
|
|
16
|
+
{
|
|
17
|
+
'format_json': {
|
|
18
|
+
'letter_case': ::NoResponse::Utils.field_name("platform"),
|
|
19
|
+
required: true,
|
|
20
|
+
'decoder': ::NoResponse::Utils.open_enum_from_string(Models::Shared::IntegrationPlatform, false)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
)
|
|
24
|
+
# The provider events the endpoint scores. Default both: pre_registration (WorkOS user registration Action, Auth0 pre-user-registration trigger) and post_login (WorkOS authentication Action, Auth0 post-login trigger). An event that is not listed is answered allow without an assessment.
|
|
25
|
+
field(
|
|
26
|
+
:hook_points,
|
|
27
|
+
Crystalline::Nilable.new(Crystalline::Array.new(Models::Shared::IntegrationHookPoint)),
|
|
28
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("hook_points")}}
|
|
29
|
+
)
|
|
30
|
+
# The WorkOS Actions signing secret, as the WorkOS dashboard shows it: 16 to 256 printable ASCII characters with no spaces. It is stored sealed and is not returned.
|
|
31
|
+
field(
|
|
32
|
+
:signing_secret,
|
|
33
|
+
Crystalline::Nilable.new(::String),
|
|
34
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("signing_secret")}}
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
sig {
|
|
38
|
+
params(
|
|
39
|
+
platform: Models::Shared::IntegrationPlatform,
|
|
40
|
+
hook_points: T.nilable(T::Array[Models::Shared::IntegrationHookPoint]),
|
|
41
|
+
signing_secret: T.nilable(::String)
|
|
42
|
+
)
|
|
43
|
+
.void
|
|
44
|
+
}
|
|
45
|
+
def initialize(platform:, hook_points: nil, signing_secret: nil)
|
|
46
|
+
@platform = platform
|
|
47
|
+
@hook_points = hook_points
|
|
48
|
+
@signing_secret = signing_secret
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
52
|
+
def ==(other)
|
|
53
|
+
return false unless other.is_a?(self.class)
|
|
54
|
+
return false unless @platform == other.platform
|
|
55
|
+
return false unless @hook_points == other.hook_points
|
|
56
|
+
return false unless @signing_secret == other.signing_secret
|
|
57
|
+
true
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
class NoResponse::Models::Shared::IntegrationRequest
|
|
5
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
class NoResponse::Models::Shared::IntegrationRequest
|
|
9
|
+
def platform
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def platform=(str_)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def hook_points
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def hook_points=(str_)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def signing_secret
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def signing_secret=(str_)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module NoResponse
|
|
5
|
+
module Models
|
|
6
|
+
module Shared
|
|
7
|
+
# POST /v1/integrations/{integration_id}/rotate body. For an Auth0 integration send {}: NoResponse generates a new shared secret and returns it once. For a WorkOS integration send the new signing_secret after regenerating it in the WorkOS dashboard. Either way the previous secret is still accepted for 24 hours, so the provider can be switched over without a refused call.
|
|
8
|
+
class IntegrationRotationRequest
|
|
9
|
+
extend T::Sig
|
|
10
|
+
include Crystalline::MetadataFields
|
|
11
|
+
|
|
12
|
+
# The WorkOS Actions signing secret, as the WorkOS dashboard shows it: 16 to 256 printable ASCII characters with no spaces. It is stored sealed and is not returned.
|
|
13
|
+
field(
|
|
14
|
+
:signing_secret,
|
|
15
|
+
Crystalline::Nilable.new(::String),
|
|
16
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("signing_secret")}}
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
sig { params(signing_secret: T.nilable(::String)).void }
|
|
20
|
+
def initialize(signing_secret: nil)
|
|
21
|
+
@signing_secret = signing_secret
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
25
|
+
def ==(other)
|
|
26
|
+
return false unless other.is_a?(self.class)
|
|
27
|
+
return false unless @signing_secret == other.signing_secret
|
|
28
|
+
true
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
class NoResponse::Models::Shared::IntegrationRotationRequest
|
|
5
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
class NoResponse::Models::Shared::IntegrationRotationRequest
|
|
9
|
+
def signing_secret
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def signing_secret=(str_)
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -5,11 +5,14 @@ module NoResponse
|
|
|
5
5
|
module Models
|
|
6
6
|
module Shared
|
|
7
7
|
# ResponseMode - standard returns the consolidated risk response; detailed adds merged provider-neutral facts when the key has detailed scope. There is no raw mode.
|
|
8
|
-
class ResponseMode
|
|
8
|
+
class ResponseMode
|
|
9
|
+
include ::Crystalline::Enum
|
|
9
10
|
enums do
|
|
10
11
|
STANDARD = new("standard")
|
|
11
12
|
DETAILED = new("detailed")
|
|
12
13
|
end
|
|
14
|
+
|
|
15
|
+
open!
|
|
13
16
|
end
|
|
14
17
|
end
|
|
15
18
|
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module NoResponse
|
|
5
|
+
module Models
|
|
6
|
+
module Shared
|
|
7
|
+
# One signing key, by id. The secret is not included.
|
|
8
|
+
class SigningKey
|
|
9
|
+
extend T::Sig
|
|
10
|
+
include Crystalline::MetadataFields
|
|
11
|
+
|
|
12
|
+
# The signing key id, sent as NR-Webhook-Key-Id on every delivery it signs.
|
|
13
|
+
field(
|
|
14
|
+
:key_id,
|
|
15
|
+
::String,
|
|
16
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("key_id"), required: true}}
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
field(
|
|
20
|
+
:created_at,
|
|
21
|
+
::String,
|
|
22
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("created_at"), required: true}}
|
|
23
|
+
)
|
|
24
|
+
# Present on a key a rotation replaced: it stops verifying at this instant, 7 days after the rotation. Absent on the key that signs.
|
|
25
|
+
field(
|
|
26
|
+
:expires_at,
|
|
27
|
+
Crystalline::Nilable.new(::String),
|
|
28
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("expires_at")}}
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
sig { params(key_id: ::String, created_at: ::String, expires_at: T.nilable(::String)).void }
|
|
32
|
+
def initialize(key_id:, created_at:, expires_at: nil)
|
|
33
|
+
@key_id = key_id
|
|
34
|
+
@created_at = created_at
|
|
35
|
+
@expires_at = expires_at
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
39
|
+
def ==(other)
|
|
40
|
+
return false unless other.is_a?(self.class)
|
|
41
|
+
return false unless @key_id == other.key_id
|
|
42
|
+
return false unless @created_at == other.created_at
|
|
43
|
+
return false unless @expires_at == other.expires_at
|
|
44
|
+
true
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
class NoResponse::Models::Shared::SigningKey
|
|
5
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
class NoResponse::Models::Shared::SigningKey
|
|
9
|
+
def key_id
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def key_id=(str_)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def created_at
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def created_at=(str_)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def expires_at
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def expires_at=(str_)
|
|
25
|
+
end
|
|
26
|
+
end
|