noresponse 6.0.0 → 6.0.1
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/accounts.rb +663 -71
- data/lib/no_response/models/operations/listaccounts_request.rb +52 -0
- data/lib/no_response/models/operations/listaccounts_request.rbi +26 -0
- data/lib/no_response/models/operations/listaccounts_response.rb +32 -0
- data/lib/no_response/models/operations/listaccounts_response.rbi +20 -0
- data/lib/no_response/models/operations/recordenforcement_request.rb +33 -0
- data/lib/no_response/models/operations/recordenforcement_request.rbi +20 -0
- data/lib/no_response/models/operations/recordenforcement_response.rb +32 -0
- data/lib/no_response/models/operations/recordenforcement_response.rbi +20 -0
- data/lib/no_response/models/operations.rb +4 -0
- data/lib/no_response/models/shared/accountlist.rb +40 -0
- data/lib/no_response/models/shared/accountlist.rbi +20 -0
- data/lib/no_response/models/shared/conflicterrorcode.rb +1 -0
- data/lib/no_response/models/shared/enforcement.rb +156 -0
- data/lib/no_response/models/shared/enforcement.rbi +68 -0
- data/lib/no_response/models/shared/enforcementaction.rb +23 -0
- data/lib/no_response/models/shared/enforcementaction.rbi +9 -0
- data/lib/no_response/models/shared/enforcementprovider.rb +21 -0
- data/lib/no_response/models/shared/enforcementprovider.rbi +9 -0
- data/lib/no_response/models/shared/enforcementrequest.rb +122 -0
- data/lib/no_response/models/shared/enforcementrequest.rbi +50 -0
- data/lib/no_response/models/shared/enforcementstate.rb +22 -0
- data/lib/no_response/models/shared/enforcementstate.rbi +9 -0
- data/lib/no_response/models/shared/enforcementstatus.rb +19 -0
- data/lib/no_response/models/shared/enforcementstatus.rbi +9 -0
- data/lib/no_response/models/shared.rb +7 -0
- data/lib/no_response/sdkconfiguration.rb +2 -2
- metadata +23 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module NoResponse
|
|
5
|
+
module Models
|
|
6
|
+
module Operations
|
|
7
|
+
|
|
8
|
+
class ListAccountsRequest
|
|
9
|
+
extend T::Sig
|
|
10
|
+
include Crystalline::MetadataFields
|
|
11
|
+
|
|
12
|
+
# next_cursor from an earlier page, unchanged. Absent, the list starts from the oldest change.
|
|
13
|
+
field(
|
|
14
|
+
:changed_since,
|
|
15
|
+
Crystalline::Nilable.new(::String),
|
|
16
|
+
{'query_param': {'field_name': "changed_since", 'style': "form", 'explode': true}}
|
|
17
|
+
)
|
|
18
|
+
# Most accounts per page.
|
|
19
|
+
field(
|
|
20
|
+
:limit,
|
|
21
|
+
Crystalline::Nilable.new(::Integer),
|
|
22
|
+
{'query_param': {'field_name': "limit", 'style': "form", 'explode': true}}
|
|
23
|
+
)
|
|
24
|
+
# true lists only accounts with a decision other than allow for some flow and no applied enforcement at their current risk_version.
|
|
25
|
+
field(
|
|
26
|
+
:unenforced,
|
|
27
|
+
Crystalline::Nilable.new(Crystalline::Boolean.new),
|
|
28
|
+
{'query_param': {'field_name': "unenforced", 'style': "form", 'explode': true}}
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
sig {
|
|
32
|
+
params(changed_since: T.nilable(::String), limit: T.nilable(::Integer), unenforced: T.nilable(T::Boolean))
|
|
33
|
+
.void
|
|
34
|
+
}
|
|
35
|
+
def initialize(changed_since: nil, limit: 50, unenforced: false)
|
|
36
|
+
@changed_since = changed_since
|
|
37
|
+
@limit = limit
|
|
38
|
+
@unenforced = unenforced
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
42
|
+
def ==(other)
|
|
43
|
+
return false unless other.is_a?(self.class)
|
|
44
|
+
return false unless @changed_since == other.changed_since
|
|
45
|
+
return false unless @limit == other.limit
|
|
46
|
+
return false unless @unenforced == other.unenforced
|
|
47
|
+
true
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
class NoResponse::Models::Operations::ListAccountsRequest
|
|
5
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
class NoResponse::Models::Operations::ListAccountsRequest
|
|
9
|
+
def changed_since
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def changed_since=(str_)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def limit
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def limit=(str_)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def unenforced
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def unenforced=(str_)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -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 ListAccountsResponse
|
|
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::AccountList, {}
|
|
15
|
+
|
|
16
|
+
sig { params(headers: T::Hash[Symbol, T::Array[::String]], result: Models::Shared::AccountList).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::ListAccountsResponse
|
|
5
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
class NoResponse::Models::Operations::ListAccountsResponse
|
|
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
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module NoResponse
|
|
5
|
+
module Models
|
|
6
|
+
module Operations
|
|
7
|
+
|
|
8
|
+
class RecordEnforcementRequest
|
|
9
|
+
extend T::Sig
|
|
10
|
+
include Crystalline::MetadataFields
|
|
11
|
+
|
|
12
|
+
# The account_id the workspace sends with its assessments, as one path segment (percent-encode '|' and ':' if the client requires it). A value that does not match the account_id shape answers 400 invalid_request.
|
|
13
|
+
field :account_id, ::String, {'path_param': {'field_name': "account_id", 'style': "simple", 'explode': false}}
|
|
14
|
+
|
|
15
|
+
field :body, Models::Shared::EnforcementRequest, {'request': {'media_type': "application/json"}}
|
|
16
|
+
|
|
17
|
+
sig { params(account_id: ::String, body: Models::Shared::EnforcementRequest).void }
|
|
18
|
+
def initialize(account_id:, body:)
|
|
19
|
+
@account_id = account_id
|
|
20
|
+
@body = body
|
|
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 @account_id == other.account_id
|
|
27
|
+
return false unless @body == other.body
|
|
28
|
+
true
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
class NoResponse::Models::Operations::RecordEnforcementRequest
|
|
5
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
class NoResponse::Models::Operations::RecordEnforcementRequest
|
|
9
|
+
def account_id
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def account_id=(str_)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def body
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def body=(str_)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -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 RecordEnforcementResponse
|
|
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::Enforcement, {}
|
|
15
|
+
|
|
16
|
+
sig { params(headers: T::Hash[Symbol, T::Array[::String]], result: Models::Shared::Enforcement).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::RecordEnforcementResponse
|
|
5
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
class NoResponse::Models::Operations::RecordEnforcementResponse
|
|
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
|
|
@@ -22,6 +22,8 @@ module NoResponse
|
|
|
22
22
|
autoload :GetAssessmentResponse, "no_response/models/operations/getassessment_response.rb"
|
|
23
23
|
autoload :ListAccountAssessmentsRequest, "no_response/models/operations/listaccountassessments_request.rb"
|
|
24
24
|
autoload :ListAccountAssessmentsResponse, "no_response/models/operations/listaccountassessments_response.rb"
|
|
25
|
+
autoload :ListAccountsRequest, "no_response/models/operations/listaccounts_request.rb"
|
|
26
|
+
autoload :ListAccountsResponse, "no_response/models/operations/listaccounts_response.rb"
|
|
25
27
|
autoload :ListIntegrationsResponse, "no_response/models/operations/listintegrations_response.rb"
|
|
26
28
|
autoload :ListWebhookDeliveriesRequest, "no_response/models/operations/listwebhookdeliveries_request.rb"
|
|
27
29
|
autoload :ListWebhookDeliveriesResponse, "no_response/models/operations/listwebhookdeliveries_response.rb"
|
|
@@ -29,6 +31,8 @@ module NoResponse
|
|
|
29
31
|
autoload :QueryAccountAssessmentsResponse, "no_response/models/operations/queryaccountassessments_response.rb"
|
|
30
32
|
autoload :RecordAssessmentOutcomeRequest, "no_response/models/operations/recordassessmentoutcome_request.rb"
|
|
31
33
|
autoload :RecordAssessmentOutcomeResponse, "no_response/models/operations/recordassessmentoutcome_response.rb"
|
|
34
|
+
autoload :RecordEnforcementRequest, "no_response/models/operations/recordenforcement_request.rb"
|
|
35
|
+
autoload :RecordEnforcementResponse, "no_response/models/operations/recordenforcement_response.rb"
|
|
32
36
|
autoload :RecordKeyUsageRequest, "no_response/models/operations/recordkeyusage_request.rb"
|
|
33
37
|
autoload :RecordKeyUsageResponse, "no_response/models/operations/recordkeyusage_response.rb"
|
|
34
38
|
autoload :ReplayWebhookDeliveryRequest, "no_response/models/operations/replaywebhookdelivery_request.rb"
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module NoResponse
|
|
5
|
+
module Models
|
|
6
|
+
module Shared
|
|
7
|
+
# Body of the 200 answer to GET /v1/accounts: the calling workspace's accounts whose risk changed after changed_since, in the environment of the calling key, oldest change first. An account is listed when its risk_version advanced and it has a current risk, and each item is the account exactly as GET /v1/accounts/{account_id} answers it. An account appears once per page, at its latest change; when its risk changes again later, it appears again on a later page with the newer risk_version. next_cursor is always present: pass it back as changed_since to read the changes made after this page.
|
|
8
|
+
class AccountList
|
|
9
|
+
extend T::Sig
|
|
10
|
+
include Crystalline::MetadataFields
|
|
11
|
+
|
|
12
|
+
field(
|
|
13
|
+
:items,
|
|
14
|
+
Crystalline::Array.new(Models::Shared::Account),
|
|
15
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("items"), required: true}}
|
|
16
|
+
)
|
|
17
|
+
# Opaque cursor after the last change this page read, bound to the workspace and the environment of the calling key. Pass it back unchanged as changed_since. It is present on every page, the last one included: when nothing changed after changed_since it is the cursor that was sent, so a poller keeps calling with the latest next_cursor. A tampered or foreign cursor answers 400 invalid_cursor. Consumers do not parse it.
|
|
18
|
+
field(
|
|
19
|
+
:next_cursor,
|
|
20
|
+
::String,
|
|
21
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("next_cursor"), required: true}}
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
sig { params(items: T::Array[Models::Shared::Account], next_cursor: ::String).void }
|
|
25
|
+
def initialize(items:, next_cursor:)
|
|
26
|
+
@items = items
|
|
27
|
+
@next_cursor = next_cursor
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
31
|
+
def ==(other)
|
|
32
|
+
return false unless other.is_a?(self.class)
|
|
33
|
+
return false unless @items == other.items
|
|
34
|
+
return false unless @next_cursor == other.next_cursor
|
|
35
|
+
true
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
class NoResponse::Models::Shared::AccountList
|
|
5
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
class NoResponse::Models::Shared::AccountList
|
|
9
|
+
def items
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def items=(str_)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def next_cursor
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def next_cursor=(str_)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -13,6 +13,7 @@ module NoResponse
|
|
|
13
13
|
WEBHOOK_ENDPOINT_LIMIT_REACHED = new("webhook_endpoint_limit_reached")
|
|
14
14
|
WEBHOOK_ENDPOINT_UNVERIFIED = new("webhook_endpoint_unverified")
|
|
15
15
|
TOO_MANY_INTEGRATIONS = new("too_many_integrations")
|
|
16
|
+
RISK_VERSION_AHEAD = new("risk_version_ahead")
|
|
16
17
|
end
|
|
17
18
|
|
|
18
19
|
open!
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module NoResponse
|
|
5
|
+
module Models
|
|
6
|
+
module Shared
|
|
7
|
+
# The answer of POST /v1/accounts/{account_id}/enforcements: one enforcement of one of the calling workspace's accounts, kept once per (account, risk_version, flow, action). The first report answers 201 with the new record. A repeat answers 200 with the record as first stored, whatever the repeat's state_before, status, provider or error_code. The one exception is a stored failed record followed by an applied report: the record becomes applied, keeps its id and created_at, takes the applied report's state_before and provider, drops error_code and answers 201, so a successful retry after a failure is recorded. Only an applied record at the account's current risk_version takes the account out of GET /v1/accounts?unenforced=true.
|
|
8
|
+
class Enforcement
|
|
9
|
+
extend T::Sig
|
|
10
|
+
include Crystalline::MetadataFields
|
|
11
|
+
|
|
12
|
+
# Opaque, server-assigned id of one recorded enforcement: 'enf_' and 26 Crockford base32 characters. Unique within the workspace.
|
|
13
|
+
field :id, ::String, {'format_json': {'letter_case': ::NoResponse::Utils.field_name("id"), required: true}}
|
|
14
|
+
# The account_id of the request path.
|
|
15
|
+
field(
|
|
16
|
+
:account_id,
|
|
17
|
+
::String,
|
|
18
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("account_id"), required: true}}
|
|
19
|
+
)
|
|
20
|
+
# The account's risk_version the workspace acted on. It can be older than the account's current risk_version: such a record is kept and does not count for unenforced.
|
|
21
|
+
field(
|
|
22
|
+
:risk_version,
|
|
23
|
+
::Integer,
|
|
24
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("risk_version"), required: true}}
|
|
25
|
+
)
|
|
26
|
+
# The event an assessment is made for: account_creation (a user creates an account), login (a user returns to an existing account) or purchase (a payment or a credit grant). The account's risk is reported with the decision for this flow.
|
|
27
|
+
field(
|
|
28
|
+
:flow,
|
|
29
|
+
Models::Shared::Flow,
|
|
30
|
+
{
|
|
31
|
+
'format_json': {
|
|
32
|
+
'letter_case': ::NoResponse::Utils.field_name("flow"),
|
|
33
|
+
required: true,
|
|
34
|
+
'decoder': ::NoResponse::Utils.open_enum_from_string(Models::Shared::Flow, false)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
# What the workspace did in its identity provider: revoke_sessions (signed the account out everywhere), restrict (limited what the account can do), unrestrict (lifted an earlier restriction), fail_onboarding (stopped an account that was still onboarding), reject_activation (refused to activate a provisional account) or none (decided to take no action).
|
|
39
|
+
field(
|
|
40
|
+
:action,
|
|
41
|
+
Models::Shared::EnforcementAction,
|
|
42
|
+
{
|
|
43
|
+
'format_json': {
|
|
44
|
+
'letter_case': ::NoResponse::Utils.field_name("action"),
|
|
45
|
+
required: true,
|
|
46
|
+
'decoder': ::NoResponse::Utils.open_enum_from_string(Models::Shared::EnforcementAction, false)
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
# The account's state in the workspace's identity provider just before the action: onboarding, provisional (created, not yet activated), active, restricted or rejected.
|
|
51
|
+
field(
|
|
52
|
+
:state_before,
|
|
53
|
+
Models::Shared::EnforcementState,
|
|
54
|
+
{
|
|
55
|
+
'format_json': {
|
|
56
|
+
'letter_case': ::NoResponse::Utils.field_name("state_before"),
|
|
57
|
+
required: true,
|
|
58
|
+
'decoder': ::NoResponse::Utils.open_enum_from_string(Models::Shared::EnforcementState, false)
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
# applied when the identity provider accepted the action, failed when it refused it or could not be reached. Only applied counts as enforced.
|
|
63
|
+
field(
|
|
64
|
+
:status,
|
|
65
|
+
Models::Shared::EnforcementStatus,
|
|
66
|
+
{
|
|
67
|
+
'format_json': {
|
|
68
|
+
'letter_case': ::NoResponse::Utils.field_name("status"),
|
|
69
|
+
required: true,
|
|
70
|
+
'decoder': ::NoResponse::Utils.open_enum_from_string(Models::Shared::EnforcementStatus, false)
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
# The identity provider the action ran in; custom for the workspace's own user store.
|
|
75
|
+
field(
|
|
76
|
+
:provider,
|
|
77
|
+
Models::Shared::EnforcementProvider,
|
|
78
|
+
{
|
|
79
|
+
'format_json': {
|
|
80
|
+
'letter_case': ::NoResponse::Utils.field_name("provider"),
|
|
81
|
+
required: true,
|
|
82
|
+
'decoder': ::NoResponse::Utils.open_enum_from_string(Models::Shared::EnforcementProvider, false)
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
# When NoResponse first recorded this enforcement, in UTC. A failed record that becomes applied keeps it.
|
|
87
|
+
field(
|
|
88
|
+
:created_at,
|
|
89
|
+
::String,
|
|
90
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("created_at"), required: true}}
|
|
91
|
+
)
|
|
92
|
+
# Why a failed action failed, as a short code of the workspace's choosing (lower-case letters, digits, '_', '.' and '-'), such as the identity provider's error code. Allowed only with status failed: with status applied it answers 400 invalid_request. Keep personal data out of it.
|
|
93
|
+
field(
|
|
94
|
+
:error_code,
|
|
95
|
+
Crystalline::Nilable.new(::String),
|
|
96
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("error_code")}}
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
sig {
|
|
100
|
+
params(
|
|
101
|
+
id: ::String,
|
|
102
|
+
account_id: ::String,
|
|
103
|
+
risk_version: ::Integer,
|
|
104
|
+
flow: Models::Shared::Flow,
|
|
105
|
+
action: Models::Shared::EnforcementAction,
|
|
106
|
+
state_before: Models::Shared::EnforcementState,
|
|
107
|
+
status: Models::Shared::EnforcementStatus,
|
|
108
|
+
provider: Models::Shared::EnforcementProvider,
|
|
109
|
+
created_at: ::String,
|
|
110
|
+
error_code: T.nilable(::String)
|
|
111
|
+
)
|
|
112
|
+
.void
|
|
113
|
+
}
|
|
114
|
+
def initialize(
|
|
115
|
+
id:,
|
|
116
|
+
account_id:,
|
|
117
|
+
risk_version:,
|
|
118
|
+
flow:,
|
|
119
|
+
action:,
|
|
120
|
+
state_before:,
|
|
121
|
+
status:,
|
|
122
|
+
provider:,
|
|
123
|
+
created_at:,
|
|
124
|
+
error_code: nil
|
|
125
|
+
)
|
|
126
|
+
@id = id
|
|
127
|
+
@account_id = account_id
|
|
128
|
+
@risk_version = risk_version
|
|
129
|
+
@flow = flow
|
|
130
|
+
@action = action
|
|
131
|
+
@state_before = state_before
|
|
132
|
+
@status = status
|
|
133
|
+
@provider = provider
|
|
134
|
+
@created_at = created_at
|
|
135
|
+
@error_code = error_code
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
139
|
+
def ==(other)
|
|
140
|
+
return false unless other.is_a?(self.class)
|
|
141
|
+
return false unless @id == other.id
|
|
142
|
+
return false unless @account_id == other.account_id
|
|
143
|
+
return false unless @risk_version == other.risk_version
|
|
144
|
+
return false unless @flow == other.flow
|
|
145
|
+
return false unless @action == other.action
|
|
146
|
+
return false unless @state_before == other.state_before
|
|
147
|
+
return false unless @status == other.status
|
|
148
|
+
return false unless @provider == other.provider
|
|
149
|
+
return false unless @created_at == other.created_at
|
|
150
|
+
return false unless @error_code == other.error_code
|
|
151
|
+
true
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
end
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
class NoResponse::Models::Shared::Enforcement
|
|
5
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
class NoResponse::Models::Shared::Enforcement
|
|
9
|
+
def id
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def id=(str_)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def account_id
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def account_id=(str_)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def risk_version
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def risk_version=(str_)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def flow
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def flow=(str_)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def action
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def action=(str_)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def state_before
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def state_before=(str_)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def status
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def status=(str_)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def provider
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def provider=(str_)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def created_at
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def created_at=(str_)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def error_code
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def error_code=(str_)
|
|
67
|
+
end
|
|
68
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module NoResponse
|
|
5
|
+
module Models
|
|
6
|
+
module Shared
|
|
7
|
+
# EnforcementAction - What the workspace did in its identity provider: revoke_sessions (signed the account out everywhere), restrict (limited what the account can do), unrestrict (lifted an earlier restriction), fail_onboarding (stopped an account that was still onboarding), reject_activation (refused to activate a provisional account) or none (decided to take no action).
|
|
8
|
+
class EnforcementAction
|
|
9
|
+
include ::Crystalline::Enum
|
|
10
|
+
enums do
|
|
11
|
+
REVOKE_SESSIONS = new("revoke_sessions")
|
|
12
|
+
RESTRICT = new("restrict")
|
|
13
|
+
UNRESTRICT = new("unrestrict")
|
|
14
|
+
FAIL_ONBOARDING = new("fail_onboarding")
|
|
15
|
+
REJECT_ACTIVATION = new("reject_activation")
|
|
16
|
+
NONE = new("none")
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
open!
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module NoResponse
|
|
5
|
+
module Models
|
|
6
|
+
module Shared
|
|
7
|
+
# EnforcementProvider - The identity provider the action ran in; custom for the workspace's own user store.
|
|
8
|
+
class EnforcementProvider
|
|
9
|
+
include ::Crystalline::Enum
|
|
10
|
+
enums do
|
|
11
|
+
CLERK = new("clerk")
|
|
12
|
+
WORKOS = new("workos")
|
|
13
|
+
AUTH0 = new("auth0")
|
|
14
|
+
CUSTOM = new("custom")
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
open!
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|