belvo 1.6.0 → 1.7.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/danger-pr-reviews-custom.yml +2 -2
- data/.github/workflows/danger-pr-reviews.yml +2 -2
- data/Dangerfile.custom +1 -1
- data/Gemfile.lock +1 -1
- data/README.md +3 -3
- data/lib/belvo/options.rb +0 -2
- data/lib/belvo/resources.rb +3 -10
- data/lib/belvo/utils.rb +0 -14
- data/lib/belvo/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0fd340ed593283e4c1a3cecc0fa0d7f853c6becd6e7b7e287e5704656a8bac2
|
4
|
+
data.tar.gz: 53955ce40194359d65058a94471df2c2e07a54363646bb87bd33ca50f2fb0f44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c7689eb36509a25dd3520815bf1a481d57d27025fed6fadcfbd2d60d4ee66b868f4c073d2f52feddf2a2a704ec7f1cf605c39dcb1ff29f2f45cebfa71a42ebe
|
7
|
+
data.tar.gz: 9e11e41d5046a2d5bc20cf360ce4b548ded50b5bf8f53c2b338045e40069d4665ed497f01a775664dfb5aedee9910cc51edd4b37b7a7e700f4e86ab4f1a4a06b
|
data/Dangerfile.custom
CHANGED
@@ -2,5 +2,5 @@
|
|
2
2
|
if !github.pr_title.match(/\[Snyk\]/) &&
|
3
3
|
!github.pr_labels.include?("dependencies") &&
|
4
4
|
!github.pr_title.match(/^\[(?:Added|Changed|Docs|Fixed|Migrations|Other|Removed|Security)\]/)
|
5
|
-
|
5
|
+
raise "Please provide a valid PR title label: [Added]/[Changed]/[Docs]/[Fixed]/[Migrations]/[Other]/[Removed]/[Security]."
|
6
6
|
end
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -9,10 +9,10 @@
|
|
9
9
|
## 📕 Documentation
|
10
10
|
How to use `belvo-ruby`: https://belvo-finance.github.io/belvo-ruby/
|
11
11
|
|
12
|
-
If you want to check the full documentation about Belvo API: https://
|
12
|
+
If you want to check the full documentation about Belvo API: https://developers.belvo.com
|
13
13
|
|
14
14
|
Or if you want to more information about:
|
15
|
-
* [Getting Belvo API keys](https://developers.belvo.com/docs/get-your-belvo-api-keys)
|
15
|
+
* [Getting Belvo API keys](https://developers.belvo.com/docs/get-started-in-5-minutes#get-your-belvo-api-keys)
|
16
16
|
* [Using Connect Widget](https://developers.belvo.com/docs/connect-widget)
|
17
17
|
* [Testing in sandbox](https://developers.belvo.com/docs/test-in-sandbox)
|
18
18
|
* [Using webhooks and recurrent links](https://developers.belvo.com/docs/webhooks)
|
@@ -106,7 +106,7 @@ All `list` methods only return the first page of results. If you want to iterate
|
|
106
106
|
```
|
107
107
|
When the result of your call is `nil`, this indicates that there are no more pages to iterate over.
|
108
108
|
|
109
|
-
**Note:** If you create a `Link` without specifying [access_mode](https://
|
109
|
+
**Note:** If you create a `Link` without specifying [access_mode](https://developers.belvo.com/reference/registerlink), the SDK will respect the default value from the API.
|
110
110
|
|
111
111
|
## Development
|
112
112
|
|
data/lib/belvo/options.rb
CHANGED
data/lib/belvo/resources.rb
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
require 'date'
|
4
4
|
require 'belvo/options'
|
5
|
-
require 'belvo/utils'
|
6
5
|
require 'belvo/exceptions'
|
7
6
|
|
8
7
|
module Belvo
|
@@ -87,8 +86,6 @@ module Belvo
|
|
87
86
|
options: nil
|
88
87
|
)
|
89
88
|
options = LinkOptions.from(options)
|
90
|
-
options.certificate = Utils.read_file_to_b64(options.certificate)
|
91
|
-
options.private_key = Utils.read_file_to_b64(options.private_key)
|
92
89
|
body = {
|
93
90
|
institution: institution,
|
94
91
|
username: username,
|
@@ -108,15 +105,11 @@ module Belvo
|
|
108
105
|
# @raise [RequestError] If response code is different than 2XX
|
109
106
|
def update(id:, password: nil, password2: nil, options: nil)
|
110
107
|
options = LinkOptions.from(options)
|
111
|
-
options.certificate = Utils.read_file_to_b64(options.certificate)
|
112
|
-
options.private_key = Utils.read_file_to_b64(options.private_key)
|
113
108
|
body = {
|
114
109
|
password: password,
|
115
110
|
password2: password2,
|
116
111
|
token: options.token,
|
117
|
-
username_type: options.username_type
|
118
|
-
certificate: options.certificate,
|
119
|
-
private_key: options.private_key
|
112
|
+
username_type: options.username_type
|
120
113
|
}.merge(options)
|
121
114
|
body = clean body: body
|
122
115
|
@session.put(@endpoint, id, body)
|
@@ -124,7 +117,7 @@ module Belvo
|
|
124
117
|
|
125
118
|
# Allows to create a token with client-specified scope and short TTL.
|
126
119
|
# @param id [String] Link UUID
|
127
|
-
# @param scopes [String] Configurable scopes eg: "
|
120
|
+
# @param scopes [String] Configurable scopes eg: "write_links,delete_links"
|
128
121
|
# @return [Hash] with a "refresh" and "access" token
|
129
122
|
# @raise [RequestError] If response code is different than 2XX
|
130
123
|
def token(id:, scopes:)
|
@@ -622,7 +615,7 @@ module Belvo
|
|
622
615
|
body = {
|
623
616
|
id: @session.key_id,
|
624
617
|
password: @session.key_password,
|
625
|
-
scopes: 'read_institutions,write_links
|
618
|
+
scopes: 'read_institutions,write_links',
|
626
619
|
link_id: link_id,
|
627
620
|
widget: widget
|
628
621
|
}.merge(options)
|
data/lib/belvo/utils.rb
CHANGED
@@ -1,19 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'base64'
|
4
|
-
|
5
|
-
module Belvo
|
6
|
-
# Class with helper functions
|
7
|
-
class Utils
|
8
|
-
def self.read_file_to_b64(path)
|
9
|
-
return if path.nil? || !File.file?(path)
|
10
|
-
|
11
|
-
data = File.open(path).read
|
12
|
-
Base64.encode64(data)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
3
|
# Class to get the api url given an environment name
|
18
4
|
class Environment
|
19
5
|
SANDBOX = 'https://sandbox.belvo.com'
|
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: 1.
|
4
|
+
version: 1.7.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: 2023-
|
11
|
+
date: 2023-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -198,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
198
198
|
- !ruby/object:Gem::Version
|
199
199
|
version: '0'
|
200
200
|
requirements: []
|
201
|
-
rubygems_version: 3.
|
201
|
+
rubygems_version: 3.4.10
|
202
202
|
signing_key:
|
203
203
|
specification_version: 4
|
204
204
|
summary: The Ruby gem for the Belvo API
|