idnow 2.2.0 → 2.4.1.pre.test
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build-release.yml +89 -0
- data/.github/workflows/lint-test-build.yml +39 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +3 -9
- data/Dockerfile +2 -6
- data/LICENSE.txt +1 -1
- data/Makefile +6 -0
- data/README.md +24 -4
- data/examples/idnow_automated_testing.rb +2 -2
- data/{idnow-client.gemspec → idnow.gemspec} +16 -12
- data/lib/idnow/API/automated_testing.rb +2 -2
- data/lib/idnow/API/document_definitions.rb +4 -3
- data/lib/idnow/API/download_documents.rb +1 -1
- data/lib/idnow/API/request_identifications.rb +1 -1
- data/lib/idnow/API/retrieve_identifications.rb +11 -2
- data/lib/idnow/API/upload_documents.rb +2 -1
- data/lib/idnow/client.rb +1 -0
- data/lib/idnow/configuration.rb +1 -6
- data/lib/idnow/helpers.rb +1 -1
- data/lib/idnow/json_response.rb +1 -1
- data/lib/idnow/models/identification_data.rb +4 -2
- data/lib/idnow/models/login_data.rb +1 -1
- data/lib/idnow/modules/jsonable.rb +2 -1
- data/lib/idnow/raw_response.rb +1 -1
- data/lib/idnow/sftp_client.rb +1 -0
- data/lib/idnow.rb +1 -0
- metadata +38 -36
- data/.travis.yml +0 -6
- data/circle.yml +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f07109a277cf31566d6c359ad645b2c268b61c2e3a4855b67b52b547314be9d
|
4
|
+
data.tar.gz: 59e0e7e48ed2b3e3c2ff081322f87e4b9c810bf08cd64a34d13e2ea5bf09e2b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b978d9f9e1214807e14c6124be08f136487603d0dba6e7367f37b385ba622479585fa2e6fa7266b3c40779bf1f1e50fcd5f6ccc4db43964f9f3cd4dc2d0ee87
|
7
|
+
data.tar.gz: 1afe5d07c345ad4588634f2b971929229e844d0f9c97a8c4b9598aa681c8695596250c9eb0ca6f324d2ff280ff1fe9cf3cd7e29816b41d4789e29b9ab0ac8f45
|
@@ -0,0 +1,89 @@
|
|
1
|
+
name: Build and release gem
|
2
|
+
|
3
|
+
on:
|
4
|
+
release:
|
5
|
+
types:
|
6
|
+
- published
|
7
|
+
|
8
|
+
env:
|
9
|
+
GEM_NAME: idnow
|
10
|
+
RUBY_VERSION: 3.1.2
|
11
|
+
VERSION: ${{github.event.release.tag_name}}
|
12
|
+
|
13
|
+
jobs:
|
14
|
+
validate_tag:
|
15
|
+
runs-on: ubuntu-latest
|
16
|
+
steps:
|
17
|
+
- name: 'Validate tag pattern: ${{ env.VERSION }}'
|
18
|
+
run: |
|
19
|
+
if [[ $VERSION =~ v[0-9]+\.[0-9]+\.[0-9]+ ]]; then
|
20
|
+
echo "Valid tagname, continue release"
|
21
|
+
else
|
22
|
+
echo "Invalid tagname, needs doesn't follow pattern: v<Semver>"
|
23
|
+
exit 1
|
24
|
+
fi
|
25
|
+
env:
|
26
|
+
VERSION: ${{env.VERSION}}
|
27
|
+
|
28
|
+
build:
|
29
|
+
name: Build gem
|
30
|
+
needs: validate_tag
|
31
|
+
runs-on: ubuntu-latest
|
32
|
+
permissions:
|
33
|
+
contents: read
|
34
|
+
steps:
|
35
|
+
- uses: actions/checkout@v2
|
36
|
+
|
37
|
+
- uses: ruby/setup-ruby@v1
|
38
|
+
with:
|
39
|
+
ruby-version: ${{env.RUBY_VERSION}}
|
40
|
+
|
41
|
+
- name: Build ${{env.VERSION}}
|
42
|
+
run: |
|
43
|
+
gem build $GEM_NAME.gemspec
|
44
|
+
|
45
|
+
- uses: actions/upload-artifact@v3
|
46
|
+
with:
|
47
|
+
name: ${{env.GEM_NAME}}-${{env.VERSION}}
|
48
|
+
path: '*.gem'
|
49
|
+
|
50
|
+
publish:
|
51
|
+
name: Publish to RubyGems.org
|
52
|
+
needs: build
|
53
|
+
runs-on: ubuntu-latest
|
54
|
+
steps:
|
55
|
+
- uses: actions/download-artifact@v3
|
56
|
+
with:
|
57
|
+
name: ${{env.GEM_NAME}}-${{env.VERSION}}
|
58
|
+
|
59
|
+
- uses: ruby/setup-ruby@v1
|
60
|
+
with:
|
61
|
+
ruby-version: ${{env.RUBY_VERSION}}
|
62
|
+
|
63
|
+
- name: Publish ${{env.VERSION}}
|
64
|
+
run: |
|
65
|
+
gem push $GEM_NAME-${VERSION:1}.gem
|
66
|
+
env:
|
67
|
+
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
|
68
|
+
|
69
|
+
publish_gpr:
|
70
|
+
name: Publish to GitHub Packages
|
71
|
+
needs: publish
|
72
|
+
runs-on: ubuntu-latest
|
73
|
+
permissions:
|
74
|
+
packages: write
|
75
|
+
steps:
|
76
|
+
- uses: actions/download-artifact@v3
|
77
|
+
with:
|
78
|
+
name: ${{env.GEM_NAME}}-${{env.VERSION}}
|
79
|
+
|
80
|
+
- uses: ruby/setup-ruby@v1
|
81
|
+
with:
|
82
|
+
ruby-version: ${{env.RUBY_VERSION}}
|
83
|
+
|
84
|
+
- name: Publish ${{env.VERSION}}
|
85
|
+
run: |
|
86
|
+
gem push $GEM_NAME-${VERSION:1}.gem
|
87
|
+
env:
|
88
|
+
GEM_HOST_API_KEY: Bearer ${{secrets.GITHUB_TOKEN}}
|
89
|
+
RUBYGEMS_HOST: https://rubygems.pkg.github.com/${{github.repository_owner}}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
name: Lint, test & build gem
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- main
|
7
|
+
|
8
|
+
pull_request:
|
9
|
+
|
10
|
+
jobs:
|
11
|
+
lint-test-build:
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
name: Ruby ${{ matrix.ruby }}
|
14
|
+
strategy:
|
15
|
+
matrix:
|
16
|
+
ruby:
|
17
|
+
- '2.7.6'
|
18
|
+
- '3.1.2'
|
19
|
+
|
20
|
+
steps:
|
21
|
+
- uses: actions/checkout@v2
|
22
|
+
|
23
|
+
- name: Set up Ruby
|
24
|
+
uses: ruby/setup-ruby@v1
|
25
|
+
with:
|
26
|
+
ruby-version: ${{ matrix.ruby }}
|
27
|
+
bundler-cache: true
|
28
|
+
|
29
|
+
- name: Install dependencies
|
30
|
+
run: bundle
|
31
|
+
|
32
|
+
- name: Run linter
|
33
|
+
run: bundle exec rubocop
|
34
|
+
|
35
|
+
- name: Run tests
|
36
|
+
run: bundle exec rspec
|
37
|
+
|
38
|
+
- name: Build gem
|
39
|
+
run: gem build *.gemspec
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
AllCops:
|
2
2
|
DisplayCopNames: true
|
3
|
-
TargetRubyVersion: 2.
|
3
|
+
TargetRubyVersion: 2.7
|
4
|
+
NewCops: enable
|
4
5
|
|
5
6
|
# This configuration was generated by
|
6
7
|
# `rubocop --auto-gen-config`
|
@@ -13,7 +14,7 @@ AllCops:
|
|
13
14
|
# Offense count: 8
|
14
15
|
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
|
15
16
|
# URISchemes: http, https
|
16
|
-
|
17
|
+
Layout/LineLength:
|
17
18
|
Max: 140
|
18
19
|
|
19
20
|
Metrics/MethodLength:
|
@@ -27,13 +28,6 @@ Metrics/BlockLength:
|
|
27
28
|
Metrics/AbcSize:
|
28
29
|
Enabled: false
|
29
30
|
|
30
|
-
# Offense count: 2
|
31
|
-
# Cop supports --auto-correct.
|
32
|
-
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
33
|
-
# SupportedStyles: braces, no_braces, context_dependent
|
34
|
-
Style/BracesAroundHashParameters:
|
35
|
-
Enabled: false
|
36
|
-
|
37
31
|
# Offense count: 7
|
38
32
|
Style/Documentation:
|
39
33
|
Enabled: false
|
data/Dockerfile
CHANGED
@@ -1,13 +1,9 @@
|
|
1
|
-
FROM ruby:2.
|
1
|
+
FROM ruby:2.7
|
2
2
|
|
3
3
|
RUN mkdir /gem
|
4
4
|
WORKDIR /gem
|
5
5
|
|
6
|
-
|
7
|
-
RUN apk add git build-base
|
8
|
-
RUN gem install bundler
|
9
|
-
|
10
|
-
COPY Gemfile idnow-client.gemspec /gem/
|
6
|
+
COPY Gemfile *.lock idnow.gemspec /gem/
|
11
7
|
RUN bundle install
|
12
8
|
|
13
9
|
COPY . /gem/
|
data/LICENSE.txt
CHANGED
data/Makefile
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# Idnow Client
|
2
2
|
|
3
|
-
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/idnow.svg)](https://badge.fury.io/rb/idnow)
|
4
|
+
|
5
|
+
Library to consume the [IDnow API](http://www.idnow.eu/developers) in Ruby.
|
4
6
|
|
5
7
|
## Installation
|
6
8
|
|
@@ -114,8 +116,11 @@ Idnow.client.list_identifications(status: 'pending')
|
|
114
116
|
# keep in mind that it might take a while until the identification is completed.
|
115
117
|
Idnow.client.get_identification(transaction_number: transaction_number)
|
116
118
|
|
117
|
-
# Download identification
|
119
|
+
# Download identification file via SFTP
|
118
120
|
Idnow.client.download_identification(transaction_number: transaction_number)
|
121
|
+
|
122
|
+
# Get identification file via HTTP
|
123
|
+
Idnow.client.get_identification_file(transaction_number: transaction_number)
|
119
124
|
```
|
120
125
|
|
121
126
|
#### Esigning
|
@@ -152,7 +157,22 @@ Idnow.client.download_default_document(document_identifier)
|
|
152
157
|
|
153
158
|
## Development & testing
|
154
159
|
|
155
|
-
RSpec is used for testing.
|
160
|
+
RSpec is used for testing. For easier development, the project is dockerized allowing development inisde the container. Make use of following make targets:
|
161
|
+
|
162
|
+
Create development container:
|
163
|
+
|
164
|
+
```
|
165
|
+
make build
|
166
|
+
```
|
167
|
+
|
168
|
+
Open development console
|
169
|
+
|
170
|
+
```
|
171
|
+
make dev
|
172
|
+
```
|
173
|
+
|
174
|
+
Inside the console, `rspec` or `bundle` can be executed.
|
175
|
+
|
156
176
|
|
157
177
|
### Coverage report
|
158
178
|
|
@@ -167,6 +187,6 @@ COV=true make test
|
|
167
187
|
To run the tests through docker, you can use the included `Dockerfile`:
|
168
188
|
|
169
189
|
```sh
|
170
|
-
|
190
|
+
make build
|
171
191
|
docker run -it idnow-client:latest make test
|
172
192
|
```
|
@@ -33,5 +33,5 @@ puts "\n\n"
|
|
33
33
|
puts '--- Testing video chat---'
|
34
34
|
Idnow.client.testing_request_video_chat(transaction_number: transaction_number)
|
35
35
|
|
36
|
-
puts 'It might take a while until the identification is marked as successfull,' \
|
37
|
-
'
|
36
|
+
puts 'It might take a while until the identification is marked as successfull, ' \
|
37
|
+
'wait a little bit and then run idnow_get_identification.rb script'
|
@@ -2,15 +2,13 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'idnow'
|
5
|
-
spec.version = '2.
|
5
|
+
spec.version = '2.4.1-test'
|
6
6
|
spec.authors = ['Joan Martinez, Tobias Bielohlawek']
|
7
|
-
spec.email = ['
|
7
|
+
spec.email = ['developers@solarisbank.de']
|
8
8
|
|
9
9
|
spec.summary = 'Ruby client for the IDnow API'
|
10
10
|
spec.description = 'Library to consume the IDnow API in Ruby, http://www.idnow.eu/developers'
|
11
11
|
|
12
|
-
raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.' unless spec.respond_to?(:metadata)
|
13
|
-
|
14
12
|
spec.homepage = 'https://github.com/solarisBank/idnow-client'
|
15
13
|
spec.license = 'MIT'
|
16
14
|
|
@@ -19,14 +17,20 @@ Gem::Specification.new do |spec|
|
|
19
17
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
18
|
spec.require_paths = ['lib']
|
21
19
|
|
22
|
-
spec.
|
20
|
+
spec.metadata = {
|
21
|
+
'github_repo' => 'ssh://github.com/Solarisbank/idnow-client',
|
22
|
+
'rubygems_mfa_required' => 'true'
|
23
|
+
}
|
23
24
|
|
24
|
-
spec.required_ruby_version = '
|
25
|
+
spec.required_ruby_version = '>= 2.7'
|
26
|
+
|
27
|
+
spec.add_runtime_dependency 'net-sftp', '~>2.1'
|
25
28
|
|
26
|
-
spec.add_development_dependency 'factory_bot'
|
27
|
-
spec.add_development_dependency 'rspec'
|
28
|
-
spec.add_development_dependency 'rubocop'
|
29
|
-
spec.add_development_dependency 'shoulda-matchers'
|
30
|
-
spec.add_development_dependency 'simplecov'
|
31
|
-
spec.add_development_dependency 'webmock'
|
29
|
+
spec.add_development_dependency 'factory_bot'
|
30
|
+
spec.add_development_dependency 'rspec'
|
31
|
+
spec.add_development_dependency 'rubocop'
|
32
|
+
spec.add_development_dependency 'shoulda-matchers'
|
33
|
+
spec.add_development_dependency 'simplecov'
|
34
|
+
spec.add_development_dependency 'webmock'
|
35
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
32
36
|
end
|
@@ -8,13 +8,13 @@ module Idnow
|
|
8
8
|
def testing_start(transaction_number:)
|
9
9
|
path = full_path_for("identifications/#{transaction_number}/start")
|
10
10
|
request = Idnow::PostJsonRequest.new(path, {})
|
11
|
-
execute(request, 'X-API_KEY' => @api_key, http_client: automated_testing_http_client)
|
11
|
+
execute(request, { 'X-API_KEY' => @api_key }, http_client: automated_testing_http_client)
|
12
12
|
end
|
13
13
|
|
14
14
|
def testing_request_video_chat(transaction_number:)
|
15
15
|
path = full_path_for("identifications/#{transaction_number}/requestVideoChat")
|
16
16
|
request = Idnow::PostJsonRequest.new(path, {})
|
17
|
-
execute(request, 'X-API_KEY' => @api_key, http_client: automated_testing_http_client)
|
17
|
+
execute(request, { 'X-API_KEY' => @api_key }, http_client: automated_testing_http_client)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -8,7 +8,7 @@ module Idnow
|
|
8
8
|
|
9
9
|
path = full_path_for('documentdefinitions')
|
10
10
|
request = Idnow::PostJsonRequest.new(path, document_data)
|
11
|
-
execute(request, 'X-API-LOGIN-TOKEN' => @auth_token)
|
11
|
+
execute(request, { 'X-API-LOGIN-TOKEN' => @auth_token })
|
12
12
|
end
|
13
13
|
|
14
14
|
def list_document_definitions
|
@@ -16,14 +16,15 @@ module Idnow
|
|
16
16
|
|
17
17
|
path = full_path_for('documentdefinitions')
|
18
18
|
request = Idnow::GetRequest.new(path)
|
19
|
-
response = execute(request, 'X-API-LOGIN-TOKEN' => @auth_token)
|
19
|
+
response = execute(request, { 'X-API-LOGIN-TOKEN' => @auth_token })
|
20
20
|
response.data.map do |data|
|
21
21
|
Idnow::DocumentDefinition.new(data)
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
def list_cached_document_definitions(refresh = false)
|
25
|
+
def list_cached_document_definitions(refresh = false) # rubocop:disable Style/OptionalBooleanParameter
|
26
26
|
return @list_cached_document_definitions = list_document_definitions if refresh
|
27
|
+
|
27
28
|
@list_cached_document_definitions ||= list_document_definitions
|
28
29
|
end
|
29
30
|
end
|
@@ -8,7 +8,7 @@ module Idnow
|
|
8
8
|
|
9
9
|
path = full_path_for("documentdefinitions/#{document_definition_identifier}/data")
|
10
10
|
request = Idnow::GetRequest.new(path, '')
|
11
|
-
execute(request, 'X-API-LOGIN-TOKEN' => @auth_token)
|
11
|
+
execute(request, { 'X-API-LOGIN-TOKEN' => @auth_token })
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
@@ -6,7 +6,7 @@ module Idnow
|
|
6
6
|
def request_identification(transaction_number:, identification_data:)
|
7
7
|
path = full_path_for("identifications/#{transaction_number}/start")
|
8
8
|
request = Idnow::PostJsonRequest.new(path, identification_data)
|
9
|
-
response = execute(request, 'X-API-KEY' => @api_key)
|
9
|
+
response = execute(request, { 'X-API-KEY' => @api_key })
|
10
10
|
Idnow::IdentificationRequest.new(response.data, transaction_number, @target_host, @company_id)
|
11
11
|
end
|
12
12
|
end
|
@@ -11,10 +11,11 @@ module Idnow
|
|
11
11
|
unless status.nil? || IDENTIFICATION_STATUSES.include?(status)
|
12
12
|
raise Idnow::InvalidArguments, "Status #{status} not defined, possible options are: #{IDENTIFICATION_STATUSES.join(',')}"
|
13
13
|
end
|
14
|
+
|
14
15
|
partial_path = status.nil? ? 'identifications' : "identifications?#{status}=true"
|
15
16
|
path = full_path_for(partial_path)
|
16
17
|
request = Idnow::GetRequest.new(path)
|
17
|
-
response = execute(request, 'X-API-LOGIN-TOKEN' => @auth_token)
|
18
|
+
response = execute(request, { 'X-API-LOGIN-TOKEN' => @auth_token })
|
18
19
|
response.data['identifications'].map do |data|
|
19
20
|
Idnow::Identification.new(data)
|
20
21
|
end
|
@@ -25,10 +26,18 @@ module Idnow
|
|
25
26
|
|
26
27
|
path = full_path_for("identifications/#{transaction_number}")
|
27
28
|
request = Idnow::GetRequest.new(path)
|
28
|
-
response = execute(request, 'X-API-LOGIN-TOKEN' => @auth_token)
|
29
|
+
response = execute(request, { 'X-API-LOGIN-TOKEN' => @auth_token })
|
29
30
|
Idnow::Identification.new(response.data)
|
30
31
|
end
|
31
32
|
|
33
|
+
def get_identification_file(transaction_number:)
|
34
|
+
raise Idnow::AuthenticationException if @auth_token.nil?
|
35
|
+
|
36
|
+
path = full_path_for("identifications/#{transaction_number}.zip")
|
37
|
+
request = Idnow::GetRequest.new(path, '')
|
38
|
+
execute(request, { 'X-API-LOGIN-TOKEN' => @auth_token })
|
39
|
+
end
|
40
|
+
|
32
41
|
def download_identification(transaction_number:)
|
33
42
|
path = "#{transaction_number}.zip"
|
34
43
|
@sftp_client.download(path)
|
@@ -17,8 +17,9 @@ module Idnow
|
|
17
17
|
|
18
18
|
def upload_document(file_data, request_path)
|
19
19
|
raise Idnow::AuthenticationException if @auth_token.nil?
|
20
|
+
|
20
21
|
request = Idnow::PostBinaryRequest.new(request_path, file_data)
|
21
|
-
execute(request, 'X-API-LOGIN-TOKEN' => @auth_token)
|
22
|
+
execute(request, { 'X-API-LOGIN-TOKEN' => @auth_token })
|
22
23
|
end
|
23
24
|
end
|
24
25
|
end
|
data/lib/idnow/client.rb
CHANGED
@@ -26,6 +26,7 @@ module Idnow
|
|
26
26
|
raise 'Please set env to :test or :live' unless Idnow::ENVIRONMENTS.keys.include?(env)
|
27
27
|
raise 'Please set your company_id' if company_id.nil?
|
28
28
|
raise 'Please set your api_key' if api_key.nil?
|
29
|
+
|
29
30
|
@host = Idnow.endpoint(env, :host)
|
30
31
|
@target_host = Idnow.endpoint(env, :target_host)
|
31
32
|
@company_id = company_id
|
data/lib/idnow/configuration.rb
CHANGED
@@ -10,9 +10,7 @@ module Idnow
|
|
10
10
|
# config.company_id = company_id
|
11
11
|
# end
|
12
12
|
|
13
|
-
attr_accessor :api_key
|
14
|
-
|
15
|
-
attr_accessor :company_id
|
13
|
+
attr_accessor :api_key, :company_id, :host, :api_version
|
16
14
|
|
17
15
|
module Idnow
|
18
16
|
module Host
|
@@ -20,8 +18,5 @@ module Idnow
|
|
20
18
|
PRODUCTION = 'https://gateway.idnow.de'
|
21
19
|
end
|
22
20
|
end
|
23
|
-
attr_accessor :host
|
24
|
-
|
25
|
-
attr_accessor :api_version
|
26
21
|
end
|
27
22
|
end
|
data/lib/idnow/helpers.rb
CHANGED
@@ -5,7 +5,7 @@ module Idnow
|
|
5
5
|
PROJECT_ROOT = File.dirname(File.dirname(File.dirname(__FILE__)))
|
6
6
|
|
7
7
|
module Factories
|
8
|
-
Dir[File.join(PROJECT_ROOT, 'spec', 'support', 'factories', '*.rb')].each { |file| require(file) }
|
8
|
+
Dir[File.join(PROJECT_ROOT, 'spec', 'support', 'factories', '*.rb')].sort.each { |file| require(file) }
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
data/lib/idnow/json_response.rb
CHANGED
@@ -9,22 +9,24 @@ module Idnow
|
|
9
9
|
FEMALE = 'FEMALE'
|
10
10
|
end
|
11
11
|
|
12
|
+
# rubocop:disable Naming/MethodName
|
12
13
|
attr_accessor :birthplace, :birthname, :city, :custom1,
|
13
14
|
:custom2, :custom3, :custom4, :custom5, :trackingid, :email, :firstname,
|
14
15
|
:lastname, :mobilephone, :nationality, :street, :streetnumber, :title, :zipcode,
|
15
16
|
:preferredLang
|
17
|
+
# rubocop:enable Naming/MethodName
|
16
18
|
|
17
19
|
attr_reader :country, :gender
|
18
20
|
|
19
21
|
def initialize(params = {})
|
20
|
-
params.
|
22
|
+
params.each_key do |key|
|
21
23
|
raise ArgumentError, "Attribute #{key} is not supported!" unless respond_to?(key.to_sym)
|
22
24
|
|
23
25
|
send("#{key}=", params[key])
|
24
26
|
end
|
25
27
|
end
|
26
28
|
|
27
|
-
def to_json
|
29
|
+
def to_json(*_args)
|
28
30
|
result = {}
|
29
31
|
instance_variables.each do |attribute|
|
30
32
|
result[attribute.to_s.delete('@')] = instance_variable_get(attribute)
|
@@ -14,7 +14,7 @@ module Idnow
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
def to_json
|
17
|
+
def to_json(*_args)
|
18
18
|
keys_without_underscores(to_h).to_json
|
19
19
|
end
|
20
20
|
|
@@ -22,6 +22,7 @@ module Idnow
|
|
22
22
|
|
23
23
|
def keys_without_underscores(obj)
|
24
24
|
return obj unless obj.is_a?(Hash)
|
25
|
+
|
25
26
|
obj.each_with_object({}) do |(k, v), result|
|
26
27
|
result[k.to_s.delete('_')] = keys_without_underscores(v)
|
27
28
|
end
|
data/lib/idnow/raw_response.rb
CHANGED
data/lib/idnow/sftp_client.rb
CHANGED
@@ -16,6 +16,7 @@ module Idnow
|
|
16
16
|
options = @options.merge(password: @password)
|
17
17
|
Net::SFTP.start(@host, @username, options) do |sftp|
|
18
18
|
raise Idnow::Exception, "Invalid path. No identification file found under #{file_name}" unless file_exists(sftp, file_name)
|
19
|
+
|
19
20
|
begin
|
20
21
|
data = sftp.download!(file_name)
|
21
22
|
rescue Net::SFTP::Exception => e
|
data/lib/idnow.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: idnow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.1.pre.test
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joan Martinez, Tobias Bielohlawek
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-sftp
|
@@ -28,110 +28,110 @@ dependencies:
|
|
28
28
|
name: factory_bot
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rubocop
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0
|
61
|
+
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: shoulda-matchers
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: simplecov
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '0
|
89
|
+
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '0
|
96
|
+
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: webmock
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
103
|
+
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - "
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
110
|
+
version: '0'
|
111
111
|
description: Library to consume the IDnow API in Ruby, http://www.idnow.eu/developers
|
112
112
|
email:
|
113
|
-
-
|
113
|
+
- developers@solarisbank.de
|
114
114
|
executables: []
|
115
115
|
extensions: []
|
116
116
|
extra_rdoc_files: []
|
117
117
|
files:
|
118
|
+
- ".github/workflows/build-release.yml"
|
119
|
+
- ".github/workflows/lint-test-build.yml"
|
118
120
|
- ".gitignore"
|
119
121
|
- ".rspec"
|
120
122
|
- ".rubocop.yml"
|
121
|
-
- ".travis.yml"
|
122
123
|
- CODE_OF_CONDUCT.md
|
123
124
|
- Dockerfile
|
124
125
|
- Gemfile
|
125
126
|
- LICENSE.txt
|
126
127
|
- Makefile
|
127
128
|
- README.md
|
128
|
-
- circle.yml
|
129
129
|
- docs/IDnow_API.pdf
|
130
130
|
- examples/idnow_automated_testing.rb
|
131
131
|
- examples/idnow_download_identification.rb
|
132
132
|
- examples/idnow_get_identification.rb
|
133
133
|
- examples/idnow_upload_download_default_document.rb
|
134
|
-
- idnow
|
134
|
+
- idnow.gemspec
|
135
135
|
- lib/idnow.rb
|
136
136
|
- lib/idnow/API/authentication.rb
|
137
137
|
- lib/idnow/API/automated_testing.rb
|
@@ -165,23 +165,25 @@ files:
|
|
165
165
|
homepage: https://github.com/solarisBank/idnow-client
|
166
166
|
licenses:
|
167
167
|
- MIT
|
168
|
-
metadata:
|
168
|
+
metadata:
|
169
|
+
github_repo: ssh://github.com/Solarisbank/idnow-client
|
170
|
+
rubygems_mfa_required: 'true'
|
169
171
|
post_install_message:
|
170
172
|
rdoc_options: []
|
171
173
|
require_paths:
|
172
174
|
- lib
|
173
175
|
required_ruby_version: !ruby/object:Gem::Requirement
|
174
176
|
requirements:
|
175
|
-
- - "
|
177
|
+
- - ">="
|
176
178
|
- !ruby/object:Gem::Version
|
177
|
-
version: '2.
|
179
|
+
version: '2.7'
|
178
180
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
179
181
|
requirements:
|
180
|
-
- - "
|
182
|
+
- - ">"
|
181
183
|
- !ruby/object:Gem::Version
|
182
|
-
version:
|
184
|
+
version: 1.3.1
|
183
185
|
requirements: []
|
184
|
-
rubygems_version: 3.
|
186
|
+
rubygems_version: 3.1.6
|
185
187
|
signing_key:
|
186
188
|
specification_version: 4
|
187
189
|
summary: Ruby client for the IDnow API
|
data/.travis.yml
DELETED