belvo 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/belvo/http.rb +13 -0
- data/lib/belvo/resources.rb +12 -0
- data/lib/belvo/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7e008d86a0b4f4ff368e9027711fc3b32a81886e8a5f392d5c67f84bb417c89
|
4
|
+
data.tar.gz: 7aa7a82b3ee88a0b0cb6f837edaab45996fc8f6eed41024996711cdebd3f9905
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a03bc5b178bf8065bdbd8a04eaf94ba627abbabe212c272ec64d782ba4edf804a22eae7e5c75275857501e22d23708eab6efe3521dc0d589a862ce01c61ee7a8
|
7
|
+
data.tar.gz: 28f60a6dc881c85b213a64c6881eca73fac7f18659a534e16a3bc6eff5c4013c09db9d635a79c2f3c59af90c5214311559335d989f37f35e401db0273610e29f
|
data/Gemfile.lock
CHANGED
data/lib/belvo/http.rb
CHANGED
@@ -120,6 +120,19 @@ module Belvo
|
|
120
120
|
response.body
|
121
121
|
end
|
122
122
|
|
123
|
+
# Perform a POST request to an API endpoint
|
124
|
+
# @param path [String] API endpoint
|
125
|
+
# @param id [String] Resource UUID
|
126
|
+
# @param data [object] JSON parseable object
|
127
|
+
# @return [Hash] Response details
|
128
|
+
# @raise [RequestError] If response code is different than 2XX
|
129
|
+
def token(path, id, data)
|
130
|
+
resource_path = format('%<path>s%<id>s/token/', path: path, id: id)
|
131
|
+
response = @session.post(resource_path, data.to_json)
|
132
|
+
raise_for_status response
|
133
|
+
response.body
|
134
|
+
end
|
135
|
+
|
123
136
|
# Perform a POST request to an API endpoint
|
124
137
|
# @param path [String] API endpoint
|
125
138
|
# @param data [object] JSON parseable object
|
data/lib/belvo/resources.rb
CHANGED
@@ -122,6 +122,18 @@ module Belvo
|
|
122
122
|
body = clean body: body
|
123
123
|
@session.put(@endpoint, id, body)
|
124
124
|
end
|
125
|
+
|
126
|
+
# Allows to create a token with client-specified scope and short TTL.
|
127
|
+
# @param id [String] Link UUID
|
128
|
+
# @param scopes [String] Configurable scopes eg: "read_links,write_links"
|
129
|
+
# @return [Hash] with a "refresh" and "access" token
|
130
|
+
# @raise [RequestError] If response code is different than 2XX
|
131
|
+
def token(id:, scopes:)
|
132
|
+
body = {
|
133
|
+
scopes: scopes
|
134
|
+
}
|
135
|
+
@session.token(@endpoint, id, body)
|
136
|
+
end
|
125
137
|
end
|
126
138
|
|
127
139
|
# An Account is the representation of a bank account inside a financial
|
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.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Belvo Finance S.L.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -176,7 +176,7 @@ metadata:
|
|
176
176
|
homepage_uri: https://github.com/belvo-finance/belvo-ruby
|
177
177
|
source_code_uri: https://github.com/belvo-finance/belvo-ruby
|
178
178
|
changelog_uri: https://github.com/belvo-finance/belvo-ruby/blob/master/README.md
|
179
|
-
post_install_message:
|
179
|
+
post_install_message:
|
180
180
|
rdoc_options: []
|
181
181
|
require_paths:
|
182
182
|
- lib
|
@@ -191,8 +191,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
191
191
|
- !ruby/object:Gem::Version
|
192
192
|
version: '0'
|
193
193
|
requirements: []
|
194
|
-
rubygems_version: 3.
|
195
|
-
signing_key:
|
194
|
+
rubygems_version: 3.1.4
|
195
|
+
signing_key:
|
196
196
|
specification_version: 4
|
197
197
|
summary: The Ruby gem for the Belvo API
|
198
198
|
test_files: []
|