incognia_api 0.3.0 → 0.4.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/.github/workflows/codeql.yml +76 -0
- data/CHANGELOG.md +9 -0
- data/Gemfile.lock +11 -7
- data/README.md +17 -1
- data/bin/console +1 -1
- data/{incognia.gemspec → incognia_api.gemspec} +4 -4
- data/lib/{incognia → incognia_api}/api.rb +3 -2
- data/lib/{incognia → incognia_api}/constants/feedback_event.rb +1 -1
- data/lib/{incognia → incognia_api}/version.rb +1 -1
- data/lib/{incognia.rb → incognia_api.rb} +12 -12
- metadata +20 -19
- /data/lib/{incognia → incognia_api}/address.rb +0 -0
- /data/lib/{incognia → incognia_api}/client.rb +0 -0
- /data/lib/{incognia → incognia_api}/resources/api_resource.rb +0 -0
- /data/lib/{incognia → incognia_api}/resources/credentials.rb +0 -0
- /data/lib/{incognia → incognia_api}/resources/login_assessment.rb +0 -0
- /data/lib/{incognia → incognia_api}/resources/signup_assessment.rb +0 -0
- /data/lib/{incognia → incognia_api}/util.rb +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c06d3f1dee05fda7643ec2f4fe90cc9701d268bf403dbffddb90e2a9f44fe78d
|
|
4
|
+
data.tar.gz: 7f40ea03ef4b6fccc3fe22b59ef0bec2d8418357c497facb8f07c505905e2617
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cdd6f1391a78d3ab2fd9989415056d9d54dc4b85fad42260b5ec1e8460eb5bc4094baa30c1588f5224a06e24d2ce9cd734dd590fb851f46703b2e7c3bdfddf3e
|
|
7
|
+
data.tar.gz: 8e706e0ec640801e8df377f2c84366b052727623e054b53f8fd7150a98128a027385a11707dfc1ffe6907eb9ed681ee5956feedc29e62646b595eaaa2bf92cf8
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# For most projects, this workflow file will not need changing; you simply need
|
|
2
|
+
# to commit it to your repository.
|
|
3
|
+
#
|
|
4
|
+
# You may wish to alter this file to override the set of languages analyzed,
|
|
5
|
+
# or to provide custom queries or build logic.
|
|
6
|
+
#
|
|
7
|
+
# ******** NOTE ********
|
|
8
|
+
# We have attempted to detect the languages in your repository. Please check
|
|
9
|
+
# the `language` matrix defined below to confirm you have the correct set of
|
|
10
|
+
# supported CodeQL languages.
|
|
11
|
+
#
|
|
12
|
+
name: "CodeQL"
|
|
13
|
+
|
|
14
|
+
on:
|
|
15
|
+
push:
|
|
16
|
+
branches: [ "main" ]
|
|
17
|
+
pull_request:
|
|
18
|
+
# The branches below must be a subset of the branches above
|
|
19
|
+
branches: [ "main" ]
|
|
20
|
+
schedule:
|
|
21
|
+
- cron: '25 9 * * 0'
|
|
22
|
+
|
|
23
|
+
jobs:
|
|
24
|
+
analyze:
|
|
25
|
+
name: Analyze
|
|
26
|
+
runs-on: ubuntu-latest
|
|
27
|
+
permissions:
|
|
28
|
+
actions: read
|
|
29
|
+
contents: read
|
|
30
|
+
security-events: write
|
|
31
|
+
|
|
32
|
+
strategy:
|
|
33
|
+
fail-fast: false
|
|
34
|
+
matrix:
|
|
35
|
+
language: [ 'ruby' ]
|
|
36
|
+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
|
37
|
+
# Use only 'java' to analyze code written in Java, Kotlin or both
|
|
38
|
+
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
|
|
39
|
+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
|
|
40
|
+
|
|
41
|
+
steps:
|
|
42
|
+
- name: Checkout repository
|
|
43
|
+
uses: actions/checkout@v3
|
|
44
|
+
|
|
45
|
+
# Initializes the CodeQL tools for scanning.
|
|
46
|
+
- name: Initialize CodeQL
|
|
47
|
+
uses: github/codeql-action/init@v2
|
|
48
|
+
with:
|
|
49
|
+
languages: ${{ matrix.language }}
|
|
50
|
+
# If you wish to specify custom queries, you can do so here or in a config file.
|
|
51
|
+
# By default, queries listed here will override any specified in a config file.
|
|
52
|
+
# Prefix the list here with "+" to use these queries and those in the config file.
|
|
53
|
+
|
|
54
|
+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
|
55
|
+
queries: security-extended,security-and-quality
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
|
|
59
|
+
# If this step fails, then you should remove it and run the build manually (see below)
|
|
60
|
+
- name: Autobuild
|
|
61
|
+
uses: github/codeql-action/autobuild@v2
|
|
62
|
+
|
|
63
|
+
# ℹ️ Command-line programs to run using the OS shell.
|
|
64
|
+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
|
65
|
+
|
|
66
|
+
# If the Autobuild fails above, remove it and uncomment the following three lines.
|
|
67
|
+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
|
|
68
|
+
|
|
69
|
+
# - run: |
|
|
70
|
+
# echo "Run, Build Application using script"
|
|
71
|
+
# ./location_of_script_within_repo/buildscript.sh
|
|
72
|
+
|
|
73
|
+
- name: Perform CodeQL Analysis
|
|
74
|
+
uses: github/codeql-action/analyze@v2
|
|
75
|
+
with:
|
|
76
|
+
category: "/language:${{matrix.language}}"
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.4.0] - 2023-04-14
|
|
4
|
+
|
|
5
|
+
- Rename main filename to match the gem name
|
|
6
|
+
|
|
7
|
+
## [0.3.1] - 2023-01-24
|
|
8
|
+
|
|
9
|
+
- Allow optional params on #register_signup
|
|
10
|
+
- Add Reset feedback event
|
|
11
|
+
|
|
3
12
|
## [0.3.0] - 2022-05-06
|
|
4
13
|
|
|
5
14
|
- Allow registering feedbacks
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
incognia_api (0.
|
|
4
|
+
incognia_api (0.4.0)
|
|
5
5
|
faraday
|
|
6
6
|
faraday_middleware
|
|
7
7
|
|
|
@@ -13,29 +13,33 @@ GEM
|
|
|
13
13
|
crack (0.4.5)
|
|
14
14
|
rexml
|
|
15
15
|
diff-lcs (1.4.4)
|
|
16
|
-
faraday (1.
|
|
16
|
+
faraday (1.10.3)
|
|
17
17
|
faraday-em_http (~> 1.0)
|
|
18
18
|
faraday-em_synchrony (~> 1.0)
|
|
19
19
|
faraday-excon (~> 1.1)
|
|
20
|
-
faraday-httpclient (~> 1.0
|
|
20
|
+
faraday-httpclient (~> 1.0)
|
|
21
|
+
faraday-multipart (~> 1.0)
|
|
21
22
|
faraday-net_http (~> 1.0)
|
|
22
|
-
faraday-net_http_persistent (~> 1.
|
|
23
|
+
faraday-net_http_persistent (~> 1.0)
|
|
23
24
|
faraday-patron (~> 1.0)
|
|
24
25
|
faraday-rack (~> 1.0)
|
|
25
|
-
|
|
26
|
+
faraday-retry (~> 1.0)
|
|
26
27
|
ruby2_keywords (>= 0.0.4)
|
|
27
28
|
faraday-em_http (1.0.0)
|
|
28
29
|
faraday-em_synchrony (1.0.0)
|
|
29
30
|
faraday-excon (1.1.0)
|
|
30
31
|
faraday-httpclient (1.0.1)
|
|
32
|
+
faraday-multipart (1.0.4)
|
|
33
|
+
multipart-post (~> 2)
|
|
31
34
|
faraday-net_http (1.0.1)
|
|
32
35
|
faraday-net_http_persistent (1.2.0)
|
|
33
36
|
faraday-patron (1.0.0)
|
|
34
37
|
faraday-rack (1.0.0)
|
|
35
|
-
|
|
38
|
+
faraday-retry (1.0.3)
|
|
39
|
+
faraday_middleware (1.2.0)
|
|
36
40
|
faraday (~> 1.0)
|
|
37
41
|
hashdiff (1.0.1)
|
|
38
|
-
multipart-post (2.
|
|
42
|
+
multipart-post (2.3.0)
|
|
39
43
|
public_suffix (4.0.6)
|
|
40
44
|
rake (13.0.3)
|
|
41
45
|
rexml (3.2.5)
|
data/README.md
CHANGED
|
@@ -64,6 +64,22 @@ assessment = api.register_signup(
|
|
|
64
64
|
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
+
It also supports optional parameters, for example:
|
|
68
|
+
|
|
69
|
+
```ruby
|
|
70
|
+
address = Incognia::Address.new(line: "West 34th Street, New York City, NY 10001")
|
|
71
|
+
installation_id = "WlMksW+jh5GPhqWBorsV8yDihoSHHpmt+DpjJ7eYxpHhuO/5tuHTuA..."
|
|
72
|
+
external_id = "7b02736a-7718-4b83-8982-f68fb6f501fa"
|
|
73
|
+
|
|
74
|
+
assessment = api.register_signup(
|
|
75
|
+
installation_id: installation_id,
|
|
76
|
+
address: address,
|
|
77
|
+
external_id: external_id
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
# => #<OpenStruct id="...", device_id="...", risk_assessment="..", evidence=...>
|
|
81
|
+
```
|
|
82
|
+
|
|
67
83
|
### Getting a Signup
|
|
68
84
|
|
|
69
85
|
This method allows you to query the latest assessment for a given signup event, returning signup assessment, containing the risk assessment and supporting evidence:
|
|
@@ -132,7 +148,7 @@ For custom fraud, set the value of `event` with the corresponding code:
|
|
|
132
148
|
|
|
133
149
|
```ruby
|
|
134
150
|
success = api.register_feedback(
|
|
135
|
-
event: 'custom_fraud_name'
|
|
151
|
+
event: 'custom_fraud_name',
|
|
136
152
|
timestamp: timestamp,
|
|
137
153
|
account_id: account_id,
|
|
138
154
|
installation_id: installation_id
|
data/bin/console
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative "lib/
|
|
3
|
+
require_relative "lib/incognia_api/version"
|
|
4
4
|
|
|
5
5
|
Gem::Specification.new do |spec|
|
|
6
6
|
spec.name = "incognia_api"
|
|
@@ -10,12 +10,12 @@ Gem::Specification.new do |spec|
|
|
|
10
10
|
|
|
11
11
|
spec.summary = "Official Ruby lib for communicating with Incognia API"
|
|
12
12
|
spec.description = "Official Ruby lib for communicating with Incognia API"
|
|
13
|
-
spec.homepage = "https://github.com/inloco/incognia-
|
|
13
|
+
spec.homepage = "https://github.com/inloco/incognia-ruby"
|
|
14
14
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
|
|
15
15
|
|
|
16
16
|
spec.metadata["homepage_uri"] = spec.homepage
|
|
17
|
-
spec.metadata["source_code_uri"] = "https://github.com/inloco/incognia-
|
|
18
|
-
spec.metadata["changelog_uri"] = "https://github.com/inloco/incognia-
|
|
17
|
+
spec.metadata["source_code_uri"] = "https://github.com/inloco/incognia-ruby"
|
|
18
|
+
spec.metadata["changelog_uri"] = "https://github.com/inloco/incognia-ruby/blob/master/"
|
|
19
19
|
|
|
20
20
|
# Specify which files should be added to the gem when it is released.
|
|
21
21
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
@@ -15,9 +15,10 @@ module Incognia
|
|
|
15
15
|
host: "https://api.incognia.com/api")
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
-
def register_signup(installation_id:, address: nil)
|
|
18
|
+
def register_signup(installation_id:, address: nil, **opts)
|
|
19
19
|
params = { installation_id: installation_id }
|
|
20
|
-
params.merge!(
|
|
20
|
+
params.merge!(opts)
|
|
21
|
+
params.merge!(address&.to_hash) if address
|
|
21
22
|
|
|
22
23
|
response = connection.request(
|
|
23
24
|
:post,
|
|
@@ -6,12 +6,12 @@ module Incognia
|
|
|
6
6
|
CHALLENGE_PASSED = 'challenge_passed'.freeze
|
|
7
7
|
CHARGEBACK = 'chargeback'.freeze
|
|
8
8
|
CHARGEBACK_NOTIFICATION = 'chargeback_notification'.freeze
|
|
9
|
-
CUSTOM_CHURN_DEBT_20D = 'custom_churn_debt_20d'.freeze
|
|
10
9
|
IDENTITY_FRAUD = 'identity_fraud'.freeze
|
|
11
10
|
MPOS_FRAUD = 'mpos_fraud'.freeze
|
|
12
11
|
PASSWORD_CHANGE_FAILED = 'password_change_failed'.freeze
|
|
13
12
|
PASSWORD_CHANGED_SUCCESSFULLY = 'password_changed_successfully'.freeze
|
|
14
13
|
PROMOTION_ABUSE = 'promotion_abuse'.freeze
|
|
14
|
+
RESET = 'reset'.freeze
|
|
15
15
|
VERIFIED = 'verified'.freeze
|
|
16
16
|
|
|
17
17
|
SIGNUP_ACCEPTED = 'signup_accepted'.freeze
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative "
|
|
4
|
-
require_relative "
|
|
5
|
-
require_relative "
|
|
6
|
-
require_relative "
|
|
7
|
-
require_relative "
|
|
8
|
-
|
|
9
|
-
require_relative "
|
|
10
|
-
require_relative "
|
|
11
|
-
require_relative "
|
|
12
|
-
require_relative "
|
|
13
|
-
|
|
14
|
-
require_relative "
|
|
3
|
+
require_relative "incognia_api/version"
|
|
4
|
+
require_relative "incognia_api/client"
|
|
5
|
+
require_relative "incognia_api/util"
|
|
6
|
+
require_relative "incognia_api/address"
|
|
7
|
+
require_relative "incognia_api/api"
|
|
8
|
+
|
|
9
|
+
require_relative "incognia_api/resources/api_resource"
|
|
10
|
+
require_relative "incognia_api/resources/signup_assessment"
|
|
11
|
+
require_relative "incognia_api/resources/login_assessment"
|
|
12
|
+
require_relative "incognia_api/resources/credentials"
|
|
13
|
+
|
|
14
|
+
require_relative "incognia_api/constants/feedback_event"
|
|
15
15
|
|
|
16
16
|
module Incognia
|
|
17
17
|
class APIError < StandardError
|
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: 0.
|
|
4
|
+
version: 0.4.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:
|
|
11
|
+
date: 2023-04-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -46,6 +46,7 @@ extensions: []
|
|
|
46
46
|
extra_rdoc_files: []
|
|
47
47
|
files:
|
|
48
48
|
- ".github/CODEOWNERS"
|
|
49
|
+
- ".github/workflows/codeql.yml"
|
|
49
50
|
- ".github/workflows/main.yml"
|
|
50
51
|
- ".gitignore"
|
|
51
52
|
- ".rspec"
|
|
@@ -57,24 +58,24 @@ files:
|
|
|
57
58
|
- bin/console
|
|
58
59
|
- bin/setup
|
|
59
60
|
- fixtures/vcr_cassettes/token.yml
|
|
60
|
-
-
|
|
61
|
-
- lib/
|
|
62
|
-
- lib/
|
|
63
|
-
- lib/
|
|
64
|
-
- lib/
|
|
65
|
-
- lib/
|
|
66
|
-
- lib/
|
|
67
|
-
- lib/
|
|
68
|
-
- lib/
|
|
69
|
-
- lib/
|
|
70
|
-
- lib/
|
|
71
|
-
- lib/
|
|
72
|
-
homepage: https://github.com/inloco/incognia-
|
|
61
|
+
- incognia_api.gemspec
|
|
62
|
+
- lib/incognia_api.rb
|
|
63
|
+
- lib/incognia_api/address.rb
|
|
64
|
+
- lib/incognia_api/api.rb
|
|
65
|
+
- lib/incognia_api/client.rb
|
|
66
|
+
- lib/incognia_api/constants/feedback_event.rb
|
|
67
|
+
- lib/incognia_api/resources/api_resource.rb
|
|
68
|
+
- lib/incognia_api/resources/credentials.rb
|
|
69
|
+
- lib/incognia_api/resources/login_assessment.rb
|
|
70
|
+
- lib/incognia_api/resources/signup_assessment.rb
|
|
71
|
+
- lib/incognia_api/util.rb
|
|
72
|
+
- lib/incognia_api/version.rb
|
|
73
|
+
homepage: https://github.com/inloco/incognia-ruby
|
|
73
74
|
licenses: []
|
|
74
75
|
metadata:
|
|
75
|
-
homepage_uri: https://github.com/inloco/incognia-
|
|
76
|
-
source_code_uri: https://github.com/inloco/incognia-
|
|
77
|
-
changelog_uri: https://github.com/inloco/incognia-
|
|
76
|
+
homepage_uri: https://github.com/inloco/incognia-ruby
|
|
77
|
+
source_code_uri: https://github.com/inloco/incognia-ruby
|
|
78
|
+
changelog_uri: https://github.com/inloco/incognia-ruby/blob/master/
|
|
78
79
|
post_install_message:
|
|
79
80
|
rdoc_options: []
|
|
80
81
|
require_paths:
|
|
@@ -90,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
90
91
|
- !ruby/object:Gem::Version
|
|
91
92
|
version: '0'
|
|
92
93
|
requirements: []
|
|
93
|
-
rubygems_version: 3.
|
|
94
|
+
rubygems_version: 3.1.6
|
|
94
95
|
signing_key:
|
|
95
96
|
specification_version: 4
|
|
96
97
|
summary: Official Ruby lib for communicating with Incognia API
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|