sift 2.1.0.1 → 2.1.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/README.md +2 -2
- data/lib/sift/client.rb +3 -2
- data/lib/sift/client/decision.rb +0 -1
- data/lib/sift/client/decision/apply_to.rb +11 -2
- data/lib/sift/version.rb +1 -1
- data/spec/unit/client/decision/apply_to_spec.rb +10 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03c97cb00f55ae8efdebca7310032148f3fff43a
|
4
|
+
data.tar.gz: 7f61b55899b79cdd834c956dc392bc865bcb2855
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9280032c8da35f1b9d874a9b7576972e2990ace48c4217564faf304989991738a259226ae5bda44a27505e7e10dd3a39f65616cf8a0523f80dbfb3b257e0d9cf
|
7
|
+
data.tar.gz: f8004f92021c98b55d4835201d9b4a5003a53bbf39ce9149a6ef71989f700715ee298cc8828620dc452afcebd76adcc323ef0fe1de8df7f5da7698659a6138ca
|
data/README.md
CHANGED
@@ -132,7 +132,7 @@ Applies a decision to an entity. Visit our [developer docs](http://siftscience.c
|
|
132
132
|
**Examples:**
|
133
133
|
```ruby
|
134
134
|
# apply decision to a user
|
135
|
-
response = client.
|
135
|
+
response = client.apply_decision({
|
136
136
|
decision_id: "block_bad_user",
|
137
137
|
source: "manual_review",
|
138
138
|
analyst: "bob@your_company.com",
|
@@ -140,7 +140,7 @@ response = client.apply_decision_to({
|
|
140
140
|
})
|
141
141
|
|
142
142
|
# apply decision to "bob@example.com"'s order
|
143
|
-
response = client.
|
143
|
+
response = client.apply_decision({
|
144
144
|
decision_id: "block_bad_order",
|
145
145
|
source: "manual_review",
|
146
146
|
analyst: "bob@your_company.com",
|
data/lib/sift/client.rb
CHANGED
data/lib/sift/client/decision.rb
CHANGED
@@ -9,7 +9,15 @@ module Sift
|
|
9
9
|
class Client
|
10
10
|
class Decision
|
11
11
|
class ApplyTo
|
12
|
-
PROPERTIES = %w{
|
12
|
+
PROPERTIES = %w{
|
13
|
+
source
|
14
|
+
analyst
|
15
|
+
description
|
16
|
+
order_id
|
17
|
+
user_id
|
18
|
+
account_id
|
19
|
+
time
|
20
|
+
}
|
13
21
|
|
14
22
|
attr_reader :decision_id, :configs, :getter, :api_key
|
15
23
|
|
@@ -57,7 +65,8 @@ module Sift
|
|
57
65
|
source: source,
|
58
66
|
description: description,
|
59
67
|
analyst: analyst,
|
60
|
-
decision_id: decision_id
|
68
|
+
decision_id: decision_id,
|
69
|
+
time: time
|
61
70
|
}
|
62
71
|
end
|
63
72
|
|
data/lib/sift/version.rb
CHANGED
@@ -41,12 +41,19 @@ module Sift
|
|
41
41
|
source: "manual",
|
42
42
|
analyst: "foobar@example.com",
|
43
43
|
description: "be blocking errrday allday",
|
44
|
-
|
45
|
-
|
44
|
+
user_id: "user_1234",
|
45
|
+
time: 1234,
|
46
|
+
fake_param: "this should not exist"
|
46
47
|
}
|
47
48
|
|
48
49
|
applier = ApplyTo.new(api_key, decision_id, configs)
|
49
|
-
request_body = MultiJson.dump(
|
50
|
+
request_body = MultiJson.dump({
|
51
|
+
source: configs[:source],
|
52
|
+
description: configs[:description],
|
53
|
+
analyst: configs[:analyst],
|
54
|
+
decision_id: decision_id,
|
55
|
+
time: 1234
|
56
|
+
})
|
50
57
|
|
51
58
|
response_body = {
|
52
59
|
"entity" => {
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sift
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fred Sadaghiani
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-
|
13
|
+
date: 2017-06-20 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
158
|
version: '0'
|
159
159
|
requirements: []
|
160
160
|
rubyforge_project: sift
|
161
|
-
rubygems_version: 2.
|
161
|
+
rubygems_version: 2.5.1
|
162
162
|
signing_key:
|
163
163
|
specification_version: 4
|
164
164
|
summary: Sift Science Ruby API Gem
|