idnow 2.3.0 → 2.4.0
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 +93 -0
- data/.github/workflows/lint-test-build.yml +39 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +2 -2
- data/Dockerfile +2 -2
- data/LICENSE.txt +1 -1
- data/README.md +7 -2
- data/examples/idnow_automated_testing.rb +2 -2
- data/{idnow-client.gemspec → idnow.gemspec} +5 -6
- data/lib/idnow/API/retrieve_identifications.rb +8 -0
- data/lib/idnow/json_response.rb +1 -1
- metadata +10 -12
- data/.github/workflows/gem-push.yml +0 -67
- data/.travis.yml +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6de30eb89edb8583c59fc39909c4f8e2d85038a43a52586892f7b84b13c692a9
|
4
|
+
data.tar.gz: 4dd0371f8e80b4a41ff3f9bda3a1132a00cd08a384c17ee92ee3b908d95a91c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c50ec5fb86201da528a5ac186519dac8dbba252b2c15672ce4293d26cb240b16a415e4e0053c5b19dcedaf7507cc89a41a78eef94bc97fa553e0d7a0065e754
|
7
|
+
data.tar.gz: 472f48eb394d6ba897f7cd27bdb5466a722d7e3704a8eafe82079586220ec805fd3514cec6512a6e1065e713e85a80332d6f8869a00467b7ddd620f8c47e2498
|
@@ -0,0 +1,93 @@
|
|
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
|
+
GEM_NAME: ${{env.GEM_NAME}}
|
69
|
+
VERSION: ${{env.VERSION}}
|
70
|
+
|
71
|
+
publish_gpr:
|
72
|
+
name: Publish to GitHub Packages
|
73
|
+
needs: publish
|
74
|
+
runs-on: ubuntu-latest
|
75
|
+
permissions:
|
76
|
+
packages: write
|
77
|
+
steps:
|
78
|
+
- uses: actions/download-artifact@v3
|
79
|
+
with:
|
80
|
+
name: ${{env.GEM_NAME}}-${{env.VERSION}}
|
81
|
+
|
82
|
+
- uses: ruby/setup-ruby@v1
|
83
|
+
with:
|
84
|
+
ruby-version: ${{env.RUBY_VERSION}}
|
85
|
+
|
86
|
+
- name: Publish ${{env.VERSION}}
|
87
|
+
run: |
|
88
|
+
gem push $GEM_NAME-${VERSION:1}.gem
|
89
|
+
env:
|
90
|
+
GEM_HOST_API_KEY: Bearer ${{secrets.GITHUB_TOKEN}}
|
91
|
+
RUBYGEMS_HOST: https://rubygems.pkg.github.com/${{github.repository_owner}}
|
92
|
+
GEM_NAME: ${{env.GEM_NAME}}
|
93
|
+
VERSION: ${{env.VERSION}}
|
@@ -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,6 @@
|
|
1
1
|
AllCops:
|
2
2
|
DisplayCopNames: true
|
3
|
-
TargetRubyVersion: 2.
|
3
|
+
TargetRubyVersion: 2.7
|
4
4
|
NewCops: enable
|
5
5
|
|
6
6
|
# This configuration was generated by
|
@@ -14,7 +14,7 @@ AllCops:
|
|
14
14
|
# Offense count: 8
|
15
15
|
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
|
16
16
|
# URISchemes: http, https
|
17
|
-
|
17
|
+
Layout/LineLength:
|
18
18
|
Max: 140
|
19
19
|
|
20
20
|
Metrics/MethodLength:
|
data/Dockerfile
CHANGED
data/LICENSE.txt
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
|
@@ -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.0'
|
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,9 +17,9 @@ 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.required_ruby_version = '>= 2.7'
|
23
21
|
|
24
|
-
spec.
|
22
|
+
spec.add_runtime_dependency 'net-sftp', '~>2.1'
|
25
23
|
|
26
24
|
spec.add_development_dependency 'factory_bot'
|
27
25
|
spec.add_development_dependency 'rspec'
|
@@ -29,4 +27,5 @@ Gem::Specification.new do |spec|
|
|
29
27
|
spec.add_development_dependency 'shoulda-matchers'
|
30
28
|
spec.add_development_dependency 'simplecov'
|
31
29
|
spec.add_development_dependency 'webmock'
|
30
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
32
31
|
end
|
@@ -30,6 +30,14 @@ module Idnow
|
|
30
30
|
Idnow::Identification.new(response.data)
|
31
31
|
end
|
32
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
|
+
|
33
41
|
def download_identification(transaction_number:)
|
34
42
|
path = "#{transaction_number}.zip"
|
35
43
|
@sftp_client.download(path)
|
data/lib/idnow/json_response.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.0
|
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
|
@@ -110,16 +110,16 @@ dependencies:
|
|
110
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/
|
118
|
+
- ".github/workflows/build-release.yml"
|
119
|
+
- ".github/workflows/lint-test-build.yml"
|
119
120
|
- ".gitignore"
|
120
121
|
- ".rspec"
|
121
122
|
- ".rubocop.yml"
|
122
|
-
- ".travis.yml"
|
123
123
|
- CODE_OF_CONDUCT.md
|
124
124
|
- Dockerfile
|
125
125
|
- Gemfile
|
@@ -131,7 +131,7 @@ files:
|
|
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,7 +165,8 @@ files:
|
|
165
165
|
homepage: https://github.com/solarisBank/idnow-client
|
166
166
|
licenses:
|
167
167
|
- MIT
|
168
|
-
metadata:
|
168
|
+
metadata:
|
169
|
+
rubygems_mfa_required: 'true'
|
169
170
|
post_install_message:
|
170
171
|
rdoc_options: []
|
171
172
|
require_paths:
|
@@ -174,17 +175,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
174
175
|
requirements:
|
175
176
|
- - ">="
|
176
177
|
- !ruby/object:Gem::Version
|
177
|
-
version: '2.
|
178
|
-
- - "<"
|
179
|
-
- !ruby/object:Gem::Version
|
180
|
-
version: '3.1'
|
178
|
+
version: '2.7'
|
181
179
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
182
180
|
requirements:
|
183
181
|
- - ">="
|
184
182
|
- !ruby/object:Gem::Version
|
185
183
|
version: '0'
|
186
184
|
requirements: []
|
187
|
-
rubygems_version: 3.
|
185
|
+
rubygems_version: 3.3.7
|
188
186
|
signing_key:
|
189
187
|
specification_version: 4
|
190
188
|
summary: Ruby client for the IDnow API
|
@@ -1,67 +0,0 @@
|
|
1
|
-
name: Ruby Gem
|
2
|
-
|
3
|
-
on:
|
4
|
-
workflow_dispatch:
|
5
|
-
|
6
|
-
jobs:
|
7
|
-
build:
|
8
|
-
name: Build
|
9
|
-
runs-on: ubuntu-latest
|
10
|
-
permissions:
|
11
|
-
contents: read
|
12
|
-
packages: write
|
13
|
-
|
14
|
-
steps:
|
15
|
-
- uses: actions/checkout@v2
|
16
|
-
- name: Set up Ruby 2.5
|
17
|
-
uses: actions/setup-ruby@v1
|
18
|
-
with:
|
19
|
-
ruby-version: 2.5.x
|
20
|
-
|
21
|
-
- name: Build gem
|
22
|
-
run: |
|
23
|
-
gem build *.gemspec
|
24
|
-
- name: Upload gem
|
25
|
-
uses: actions/upload-artifact@v2
|
26
|
-
with:
|
27
|
-
name: idnow-client.gem
|
28
|
-
path: "*.gem"
|
29
|
-
|
30
|
-
publish:
|
31
|
-
name: Publish RubyGems
|
32
|
-
needs: build
|
33
|
-
runs-on: ubuntu-latest
|
34
|
-
steps:
|
35
|
-
- uses: actions/download-artifact@v2
|
36
|
-
with:
|
37
|
-
name: idnow-client.gem
|
38
|
-
- name: Set up Ruby 2.5
|
39
|
-
uses: actions/setup-ruby@v1
|
40
|
-
with:
|
41
|
-
ruby-version: 2.5.x
|
42
|
-
- name: Publish to RubyGems
|
43
|
-
run: gem push *.gem
|
44
|
-
env:
|
45
|
-
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
|
46
|
-
|
47
|
-
publish_gpr:
|
48
|
-
name: Publish GPR
|
49
|
-
needs: build
|
50
|
-
runs-on: ubuntu-latest
|
51
|
-
steps:
|
52
|
-
- uses: actions/download-artifact@v2
|
53
|
-
with:
|
54
|
-
name: idnow-client.gem
|
55
|
-
- name: Set up Ruby 2.5
|
56
|
-
uses: actions/setup-ruby@v1
|
57
|
-
with:
|
58
|
-
ruby-version: 2.5.x
|
59
|
-
- name: Publish to GPR
|
60
|
-
run: |
|
61
|
-
mv *.gem idnow-client-2.3.0.gem
|
62
|
-
gem push --host https://rubygems.pkg.github.com/${OWNER} idnow-client-2.3.0.gem
|
63
|
-
env:
|
64
|
-
GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
|
65
|
-
OWNER: ${{github.repository_owner}}
|
66
|
-
|
67
|
-
|