idnow 2.3.0 → 2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3caa1be49888278cacbd44efe6daaccaca538b747312243f55c4b529f4b060da
4
- data.tar.gz: 9fdd7352d6dc258acbc7c36e1697eee0865791146390c530bc75476933da6aec
3
+ metadata.gz: 6de30eb89edb8583c59fc39909c4f8e2d85038a43a52586892f7b84b13c692a9
4
+ data.tar.gz: 4dd0371f8e80b4a41ff3f9bda3a1132a00cd08a384c17ee92ee3b908d95a91c3
5
5
  SHA512:
6
- metadata.gz: f3a64af1fd998df4db251c4ddf6d7b728e759024d4f9174fb3817c30c598234bcd0589f118d36fdf062ff86fad813dda5c1b825d0ae0f582cd3cb1acef7a5fb9
7
- data.tar.gz: 9e355e9c36dbdab33c17b8715f9a36b11c3e985bc6370eada59ed034eb198d0d88f230003a668698bafc1567a6e648007f6f5b5e84f49ca06c0b0f621beb16b1
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
@@ -11,3 +11,4 @@
11
11
  /tmp/
12
12
  tags
13
13
  .*.sw?
14
+ *.gem
data/.rubocop.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  AllCops:
2
2
  DisplayCopNames: true
3
- TargetRubyVersion: 2.5
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
- Metrics/LineLength:
17
+ Layout/LineLength:
18
18
  Max: 140
19
19
 
20
20
  Metrics/MethodLength:
data/Dockerfile CHANGED
@@ -1,9 +1,9 @@
1
- FROM ruby:2.5
1
+ FROM ruby:2.7
2
2
 
3
3
  RUN mkdir /gem
4
4
  WORKDIR /gem
5
5
 
6
- COPY Gemfile idnow-client.gemspec /gem/
6
+ COPY Gemfile *.lock idnow-client.gemspec /gem/
7
7
  RUN bundle install
8
8
 
9
9
  COPY . /gem/
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2016 solarisBank AG
3
+ Copyright (c) 2016 Solarisbank AG
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Idnow Client
2
2
 
3
- Library to consume the [IDnow API](http://www.idnow.eu/developers) in Ruby. [![Build Status](https://travis-ci.com/Solarisbank/idnow-client.svg?branch=master)](https://travis-ci.com/Solarisbank/idnow-client)
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 files
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
- ' wait a little bit and then run idnow_get_identification.rb script'
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.3.0'
5
+ spec.version = '2.4.0'
6
6
  spec.authors = ['Joan Martinez, Tobias Bielohlawek']
7
- spec.email = ['joan.martinez@solarisbank.de']
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.add_runtime_dependency 'net-sftp', '~>2.1'
20
+ spec.required_ruby_version = '>= 2.7'
23
21
 
24
- spec.required_ruby_version = '>= 2.5', '< 3.1'
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)
@@ -6,7 +6,7 @@ module Idnow
6
6
 
7
7
  def initialize(raw_response)
8
8
  super
9
- raw_response = raw_response == '' ? '{}' : raw_response
9
+ raw_response = '{}' if raw_response == ''
10
10
  @data = JSON.parse(raw_response)
11
11
  end
12
12
  end
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.3.0
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: 2021-06-25 00:00:00.000000000 Z
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
- - joan.martinez@solarisbank.de
113
+ - developers@solarisbank.de
114
114
  executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
- - ".github/workflows/gem-push.yml"
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-client.gemspec
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.5'
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.0.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
-
data/.travis.yml DELETED
@@ -1,6 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.5.3
4
-
5
- script:
6
- - make test