noresponse 5.0.0 → 5.1.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 +4 -4
- data/lib/no_response/late_results.rb +14 -6
- data/lib/no_response/models/shared/scope.rb +1 -0
- data/lib/no_response/models/shared/webhookdeliveryattempt.rb +1 -1
- data/lib/no_response/models/shared/webhookreplay.rb +1 -1
- data/lib/no_response/sdkconfiguration.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1cd813c8c8a3ee490674bb528bbf53bdf3083775b0924810db800673269ad66b
|
|
4
|
+
data.tar.gz: 967a0e6df9b9b4264c8184e04fe0c8201942e0a20b6dd91fd054c565f7668de2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eb21fca79e4de5b3e3e57da9fa60dd47011b78d276b401f5cd9412156a02564e23f2037ef3c9ad04e6b1a0d8610214a1fc41e688a3ef758a39edb001ea4ff701
|
|
7
|
+
data.tar.gz: b3e06260fc509ee328c5ff6476738a470fb6f3e634d805008bf7c70b06095c3931cd08492f6f19aabd1d854cfe3aced3e7f7a952eac3f2b4736a0732acb2a11c
|
|
@@ -70,12 +70,20 @@ module NoResponse
|
|
|
70
70
|
# strings or symbols) to NONE, REVOKE_SESSIONS or BAN; a decision you
|
|
71
71
|
# leave out does nothing. An unknown action raises ArgumentError.
|
|
72
72
|
def action_for(event, policy = DEFAULT_POLICY)
|
|
73
|
-
return NONE if event.
|
|
73
|
+
return NONE if event.test? || event.expired?
|
|
74
74
|
|
|
75
75
|
data = event.data
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
if event.type == 'account.risk_changed'
|
|
77
|
+
# The event is sent when any flow's decision changes; sessions are about the
|
|
78
|
+
# login decision, so an unchanged login decision acts on nothing.
|
|
79
|
+
decision = data.account.decisions_by_flow.login.to_s
|
|
80
|
+
return NONE if data.previous_decisions_by_flow&.login.to_s == decision
|
|
81
|
+
elsif event.type == 'assessment.updated'
|
|
82
|
+
return NONE if data.status == Models::Shared::Status::PENDING || data.account.nil?
|
|
83
|
+
decision = data.account.risk.decision.to_s
|
|
84
|
+
else
|
|
85
|
+
return NONE
|
|
86
|
+
end
|
|
79
87
|
return NONE unless DECISIONS.include?(decision)
|
|
80
88
|
|
|
81
89
|
table = policy.to_h.transform_keys(&:to_s)
|
|
@@ -105,9 +113,9 @@ module NoResponse
|
|
|
105
113
|
def handle(payload, headers, secrets, provider, policy: DEFAULT_POLICY, user_id: nil, **verify)
|
|
106
114
|
event = Webhooks.construct_event(payload, headers, secrets, **verify)
|
|
107
115
|
action = action_for(event, policy)
|
|
108
|
-
return Result.new(event: event, action: NONE) if action == NONE
|
|
116
|
+
return Result.new(event: event, action: NONE) if action == NONE
|
|
109
117
|
|
|
110
|
-
account_id = event.data.detail.account_id
|
|
118
|
+
account_id = event.type == 'account.risk_changed' ? event.data.account.id : event.data.detail.account_id
|
|
111
119
|
resolved = user_id ? user_id.call(account_id, event) : account_id
|
|
112
120
|
return Result.new(event: event, action: NONE) if resolved.nil? || resolved.to_s.empty?
|
|
113
121
|
|
|
@@ -15,7 +15,7 @@ module NoResponse
|
|
|
15
15
|
::String,
|
|
16
16
|
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("event_id"), required: true}}
|
|
17
17
|
)
|
|
18
|
-
# The event's type, as its body's type: assessment.updated, account.deleted
|
|
18
|
+
# The event's type, as its body's type: assessment.updated, endpoint.verification, account.deleted, workspace.deleted, webhook_endpoint.disabled, account.risk_changed, or a type added later.
|
|
19
19
|
field(
|
|
20
20
|
:event_type,
|
|
21
21
|
::String,
|
|
@@ -21,7 +21,7 @@ module NoResponse
|
|
|
21
21
|
::String,
|
|
22
22
|
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("event_id"), required: true}}
|
|
23
23
|
)
|
|
24
|
-
# The event's type, as its body's type: assessment.updated, account.deleted
|
|
24
|
+
# The event's type, as its body's type: assessment.updated, endpoint.verification, account.deleted, workspace.deleted, webhook_endpoint.disabled, account.risk_changed, or a type added later.
|
|
25
25
|
field(
|
|
26
26
|
:event_type,
|
|
27
27
|
::String,
|
|
@@ -95,9 +95,9 @@ module NoResponse
|
|
|
95
95
|
|
|
96
96
|
@language = "ruby"
|
|
97
97
|
@openapi_doc_version = "1"
|
|
98
|
-
@sdk_version = "5.
|
|
98
|
+
@sdk_version = "5.1.0"
|
|
99
99
|
@gen_version = "internal"
|
|
100
|
-
@user_agent = "noresponse-sdk/ruby 5.
|
|
100
|
+
@user_agent = "noresponse-sdk/ruby 5.1.0 internal 1 noresponse"
|
|
101
101
|
end
|
|
102
102
|
|
|
103
103
|
sig { returns([String, T::Hash[Symbol, String]]) }
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: noresponse
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.
|
|
4
|
+
version: 5.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- NoResponse
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: base64
|