belvo 0.4.1 → 0.5.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/Gemfile.lock +9 -9
- data/lib/belvo/options.rb +3 -1
- data/lib/belvo/resources.rb +13 -3
- data/lib/belvo/utils.rb +13 -0
- data/lib/belvo/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cd5733a59d486efcc6a6d9e62331a2d6734304bc231e76a19f27a285f7b4c47f
|
|
4
|
+
data.tar.gz: 408ae0cb0d7a27e8b4f8f4f8a9b7a7a6b3a6d08539d5f938e328af137f26bcb4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 84f3d999c67f38697b1c18973a70503787a2a4009d41b4bb7d9525bfbc8844451cdfb7f9b1bb71b150df5e1cf76f6164c527d92c4129d49696a80f5526662fbf
|
|
7
|
+
data.tar.gz: ff94f967de7f91895bc8323f0c6265d405991f4ce547582b920ec657b4c76926225adb6ddade63c72fe3b0e4f1c2e80ea6a7d12764c4ac9d7c3d83c93c6583dc
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
belvo (0.
|
|
4
|
+
belvo (0.5.0)
|
|
5
5
|
faraday
|
|
6
6
|
faraday_middleware
|
|
7
7
|
typhoeus
|
|
@@ -34,9 +34,9 @@ GEM
|
|
|
34
34
|
json (2.3.0)
|
|
35
35
|
multipart-post (2.1.1)
|
|
36
36
|
parallel (1.19.1)
|
|
37
|
-
parser (2.7.1.
|
|
37
|
+
parser (2.7.1.2)
|
|
38
38
|
ast (~> 2.4.0)
|
|
39
|
-
public_suffix (4.0.
|
|
39
|
+
public_suffix (4.0.5)
|
|
40
40
|
rainbow (3.0.0)
|
|
41
41
|
rake (12.3.3)
|
|
42
42
|
rexml (3.2.4)
|
|
@@ -44,15 +44,15 @@ GEM
|
|
|
44
44
|
rspec-core (~> 3.9.0)
|
|
45
45
|
rspec-expectations (~> 3.9.0)
|
|
46
46
|
rspec-mocks (~> 3.9.0)
|
|
47
|
-
rspec-core (3.9.
|
|
48
|
-
rspec-support (~> 3.9.
|
|
49
|
-
rspec-expectations (3.9.
|
|
47
|
+
rspec-core (3.9.2)
|
|
48
|
+
rspec-support (~> 3.9.3)
|
|
49
|
+
rspec-expectations (3.9.2)
|
|
50
50
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
51
51
|
rspec-support (~> 3.9.0)
|
|
52
52
|
rspec-mocks (3.9.1)
|
|
53
53
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
54
54
|
rspec-support (~> 3.9.0)
|
|
55
|
-
rspec-support (3.9.
|
|
55
|
+
rspec-support (3.9.3)
|
|
56
56
|
rubocop (0.81.0)
|
|
57
57
|
jaro_winkler (~> 1.5.1)
|
|
58
58
|
parallel (~> 1.10)
|
|
@@ -61,7 +61,7 @@ GEM
|
|
|
61
61
|
rexml
|
|
62
62
|
ruby-progressbar (~> 1.7)
|
|
63
63
|
unicode-display_width (>= 1.4.0, < 2.0)
|
|
64
|
-
rubocop-rspec (1.
|
|
64
|
+
rubocop-rspec (1.39.0)
|
|
65
65
|
rubocop (>= 0.68.1)
|
|
66
66
|
ruby-progressbar (1.10.1)
|
|
67
67
|
safe_yaml (1.0.5)
|
|
@@ -76,7 +76,7 @@ GEM
|
|
|
76
76
|
thor (1.0.1)
|
|
77
77
|
tins (1.24.1)
|
|
78
78
|
sync
|
|
79
|
-
typhoeus (1.
|
|
79
|
+
typhoeus (1.4.0)
|
|
80
80
|
ethon (>= 0.9.0)
|
|
81
81
|
unicode-display_width (1.7.0)
|
|
82
82
|
webmock (3.8.3)
|
data/lib/belvo/options.rb
CHANGED
data/lib/belvo/resources.rb
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require 'date'
|
|
4
4
|
require 'belvo/options'
|
|
5
|
+
require 'belvo/utils'
|
|
5
6
|
|
|
6
7
|
module Belvo
|
|
7
8
|
# Represents a consumable REST resource from Belvo API
|
|
@@ -88,6 +89,8 @@ module Belvo
|
|
|
88
89
|
options: nil
|
|
89
90
|
)
|
|
90
91
|
options = LinkOptions.from(options)
|
|
92
|
+
options.certificate = Utils.read_file_to_b64(options.certificate)
|
|
93
|
+
options.private_key = Utils.read_file_to_b64(options.private_key)
|
|
91
94
|
body = {
|
|
92
95
|
institution: institution,
|
|
93
96
|
username: username,
|
|
@@ -96,7 +99,9 @@ module Belvo
|
|
|
96
99
|
token: options.token,
|
|
97
100
|
encryption_key: options.encryption_key,
|
|
98
101
|
access_mode: options.access_mode || AccessMode::SINGLE,
|
|
99
|
-
username_type: options.username_type
|
|
102
|
+
username_type: options.username_type,
|
|
103
|
+
certificate: options.certificate,
|
|
104
|
+
private_key: options.private_key
|
|
100
105
|
}.merge(options)
|
|
101
106
|
body = clean body: body
|
|
102
107
|
@session.post(@endpoint, body)
|
|
@@ -109,13 +114,18 @@ module Belvo
|
|
|
109
114
|
# @param options [LinkOptions] Configurable properties
|
|
110
115
|
# @return [Hash] link details
|
|
111
116
|
# @raise [RequestError] If response code is different than 2XX
|
|
112
|
-
def update(id:, password
|
|
117
|
+
def update(id:, password: nil, password2: nil, options: nil)
|
|
113
118
|
options = LinkOptions.from(options)
|
|
119
|
+
options.certificate = Utils.read_file_to_b64(options.certificate)
|
|
120
|
+
options.private_key = Utils.read_file_to_b64(options.private_key)
|
|
114
121
|
body = {
|
|
115
122
|
password: password,
|
|
116
123
|
password2: password2,
|
|
117
124
|
token: options.token,
|
|
118
|
-
encryption_key: options.encryption_key
|
|
125
|
+
encryption_key: options.encryption_key,
|
|
126
|
+
username_type: options.username_type,
|
|
127
|
+
certificate: options.certificate,
|
|
128
|
+
private_key: options.private_key
|
|
119
129
|
}.merge(options)
|
|
120
130
|
body = clean body: body
|
|
121
131
|
@session.put(@endpoint, id, body)
|
data/lib/belvo/utils.rb
ADDED
data/lib/belvo/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: belvo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Belvo Finance S.L.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-05-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -167,6 +167,7 @@ files:
|
|
|
167
167
|
- lib/belvo/http.rb
|
|
168
168
|
- lib/belvo/options.rb
|
|
169
169
|
- lib/belvo/resources.rb
|
|
170
|
+
- lib/belvo/utils.rb
|
|
170
171
|
- lib/belvo/version.rb
|
|
171
172
|
homepage: https://github.com/belvo-finance/belvo-ruby
|
|
172
173
|
licenses:
|