incognia_api 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c92b64976c39bcd601a9a7aa6901c28a3ea41e773389e23274985372b261d45
4
- data.tar.gz: 21c4bd2fc41170a8ab1d1962a2dc7be6c5fcbb7a52257743a2033af79662f16c
3
+ metadata.gz: 1a8273559cc0083cb3373809d8ecf76edd3f843cb40b49b450e6ec2fc2de4455
4
+ data.tar.gz: 598e1eeb493b7f9eba3882b032e33803d472181bfbb61a9e9b7e60f2fbf67512
5
5
  SHA512:
6
- metadata.gz: 35919782b5b8f3182fb9130cf4c7c89c2f0f2b998c884ec173f8bbc41edded16885c3ce5a76fe0673a4eb675ba3ad1909ec087479bad85db7e25280cdedccca4
7
- data.tar.gz: b23238db561ec59ce3992944c5311f3b712362d7294b02510e85eb15eb6f8514443a9bdab96039ceead59e58052d3cd0de72912ef78d0681674d7d6108d429c1
6
+ metadata.gz: f7bb01031ef75a1dc426bff6ef8fec7d17dd9d0a7022db6c0ccac7a8bc1c2a552b30ebd779fe094eeed45b57d8d60f922fffb1ccae72430c992fd290118af627
7
+ data.tar.gz: 63e398c7600a573d4cbcf742953944a63e2c116382c976e7dcc819bc4e6908ea7d0fa42e98d0fadea2753bc2e187d2e198613e534be019ace70f176f8101c4cf
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.1.0] - 2024-07-24
4
+
5
+ - Add support to passing request_token and occurred_at to #register_feedback
6
+
3
7
  ## [1.0.0] - 2024-07-05
4
8
 
5
9
  - Remove #get_signup_assessment, because the endpoint was discontinued
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- incognia_api (1.0.0)
4
+ incognia_api (1.1.0)
5
5
  faraday (~> 1.10)
6
6
  faraday_middleware (~> 1.2)
7
7
 
data/README.md CHANGED
@@ -202,12 +202,14 @@ The `expires_at` argument should be a _Time_, _DateTime_ or an date in **RFC 333
202
202
 
203
203
 
204
204
  ```ruby
205
- account_id = "cdb2cfbb-8ad8-4668-b276-5fff9bbfdc96"
206
- timestamp = DateTime.parse('2022-06-20 23:29:00 UTC-3')
205
+ installation_id = 'installation-id'
206
+ account_id = 'account-id'
207
+ occurred_at = DateTime.parse('2024-07-22T15:20:00Z')
207
208
 
208
209
  success = api.register_feedback(
209
- event: Incognia::Constants::FeedbackEvent::IDENTITY_FRAUD,
210
- timestamp: timestamp,
210
+ event: Incognia::Constants::FeedbackEvent::ACCOUNT_TAKEOVER,
211
+ occurred_at: occurred_at,
212
+ installation_id: installation_id,
211
213
  account_id: account_id
212
214
  )
213
215
 
@@ -219,9 +221,9 @@ For custom fraud, set the value of `event` with the corresponding code:
219
221
  ```ruby
220
222
  success = api.register_feedback(
221
223
  event: 'custom_fraud_name',
222
- timestamp: timestamp,
223
- account_id: account_id,
224
- installation_id: installation_id
224
+ occurred_at: occurred_at,
225
+ installation_id: installation_id,
226
+ account_id: account_id
225
227
  )
226
228
 
227
229
  # => true
@@ -46,11 +46,16 @@ module Incognia
46
46
  LoginAssessment.from_hash(response.body) if response.success?
47
47
  end
48
48
 
49
- def register_feedback(event:, timestamp: nil, expires_at: nil, **ids)
49
+ def register_feedback(event:, occurred_at: nil, expires_at: nil, timestamp: nil, **ids)
50
+ if !timestamp.nil?
51
+ warn("Deprecation warning: use occurred_at instead of timestamp")
52
+ end
53
+
50
54
  timestamp = timestamp.strftime('%s%L') if timestamp.respond_to? :strftime
55
+ occurred_at = occurred_at.to_datetime.rfc3339 if occurred_at.respond_to? :to_datetime
51
56
  expires_at = expires_at.to_datetime.rfc3339 if expires_at.respond_to? :to_datetime
52
57
 
53
- params = { event: event, timestamp: timestamp&.to_i, expires_at: expires_at }.compact
58
+ params = { event: event, timestamp: timestamp&.to_i, occurred_at: occurred_at, expires_at: expires_at }.compact
54
59
  params.merge!(ids)
55
60
 
56
61
  response = connection.request(
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Incognia
4
- VERSION = "1.0.0"
4
+ VERSION = "1.1.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: incognia_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guilherme Cavalcanti
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-08 00:00:00.000000000 Z
11
+ date: 2024-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday