truelayer 0.1.2 → 0.1.4
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 -3
- data/bin/console +9 -2
- data/lib/truelayer/authentication_repository.rb +2 -3
- data/lib/truelayer/client.rb +3 -1
- data/lib/truelayer/configuration.rb +0 -6
- data/lib/truelayer/version.rb +1 -1
- data/truelayer.gemspec +0 -1
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6964a98ba5a719a4e4e099b0cb18381dcab2bc6a58ee3be9ab5b7359fe6e1f3d
|
4
|
+
data.tar.gz: bd81ee54ae6a3c7fb5197dbe338899e44fc097d4d39a54bbf03e889a958595b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6005eb3ac3de0635bffc500326c44d2e46dd2317bd9994d7b93d2543be42f6598647cb064d095566ec5853f55967b4e5f00b56b8a4164d8c8d3cb2ca0f216c9
|
7
|
+
data.tar.gz: 7c11b9c465b583c1c104569713c5e5ebf704237ff8ce7cf47d8481a8d8d6b810b5eed1ee833623ffbb464ad596fb08ba30a526b8be3f755f7d9804ce905ede57
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
truelayer (0.1.
|
4
|
+
truelayer (0.1.4)
|
5
5
|
faraday (~> 2.7)
|
6
|
-
multi_json
|
7
6
|
|
8
7
|
GEM
|
9
8
|
remote: https://rubygems.org/
|
@@ -21,7 +20,6 @@ GEM
|
|
21
20
|
faraday-net_http (3.0.2)
|
22
21
|
hashdiff (1.0.1)
|
23
22
|
method_source (1.0.0)
|
24
|
-
multi_json (1.15.0)
|
25
23
|
pry (0.13.1)
|
26
24
|
coderay (~> 1.1)
|
27
25
|
method_source (~> 1.0)
|
data/bin/console
CHANGED
@@ -4,8 +4,15 @@ require 'bundler/setup'
|
|
4
4
|
require 'truelayer'
|
5
5
|
require 'json'
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
|
8
|
+
Truelayer.configure do |c|
|
9
|
+
c.client_id = ENV['TRUELAYER_CLIENT_ID']
|
10
|
+
c.client_secret = ENV['TRUELAYER_CLIENT_SECRET']
|
11
|
+
c.debug = true
|
12
|
+
c.verbose = true
|
13
|
+
c.environment = :sandbox
|
14
|
+
end
|
15
|
+
|
9
16
|
|
10
17
|
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
18
|
require 'pry'
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'faraday'
|
4
|
-
require 'multi_json'
|
5
4
|
require 'truelayer/configuration'
|
6
5
|
require 'truelayer/errors'
|
7
6
|
require 'truelayer/version'
|
@@ -27,7 +26,7 @@ module Truelayer
|
|
27
26
|
|
28
27
|
result = post('/v1/authuri', params: nil) do |req|
|
29
28
|
req.headers[:content_type] = 'application/json'
|
30
|
-
req.body =
|
29
|
+
req.body = JSON.generate(params)
|
31
30
|
end
|
32
31
|
|
33
32
|
AuthLink.build(json: result.body)
|
@@ -99,7 +98,7 @@ module Truelayer
|
|
99
98
|
conn.headers.merge!(
|
100
99
|
user_agent: "finpoint/#{Truelayer::VERSION}"
|
101
100
|
)
|
102
|
-
conn.response :
|
101
|
+
conn.response :json, parser_options: { symbolize_names: true }
|
103
102
|
if Truelayer.configuration.debug
|
104
103
|
conn.response :logger, nil, { headers: true, bodies: Truelayer.configuration.verbose }
|
105
104
|
end
|
data/lib/truelayer/client.rb
CHANGED
@@ -4,6 +4,7 @@ require 'faraday'
|
|
4
4
|
|
5
5
|
require 'truelayer/configuration'
|
6
6
|
require 'truelayer/errors'
|
7
|
+
require 'truelayer/faraday_auth'
|
7
8
|
|
8
9
|
module Truelayer
|
9
10
|
class Client
|
@@ -33,7 +34,8 @@ module Truelayer
|
|
33
34
|
|
34
35
|
def connection
|
35
36
|
@connection ||= Faraday.new(url: base_url) do |conn|
|
36
|
-
conn.request :truelayer_auth, access_token
|
37
|
+
# conn.request :truelayer_auth, access_token
|
38
|
+
conn.use Truelayer::FaradayAuth, access_token
|
37
39
|
conn.response :json, parser_options: { symbolize_names: true }
|
38
40
|
if Truelayer.configuration.debug
|
39
41
|
conn.response :logger, nil, { headers: true, bodies: Truelayer.configuration.verbose }
|
@@ -1,7 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'truelayer/faraday_auth'
|
4
|
-
|
5
3
|
module Truelayer
|
6
4
|
class Configuration
|
7
5
|
BASE_URLS = {
|
@@ -21,10 +19,6 @@ module Truelayer
|
|
21
19
|
@environment = :sandbox # can be either :sandbox or :production
|
22
20
|
@debug = false
|
23
21
|
@verbose = false
|
24
|
-
|
25
|
-
return if Faraday::Request.fetch_middleware(:truelayer_auth)
|
26
|
-
|
27
|
-
Faraday::Request.register_middleware truelayer_auth: -> { Truelayer::FaradayAuth }
|
28
22
|
end
|
29
23
|
|
30
24
|
def base_url
|
data/lib/truelayer/version.rb
CHANGED
data/truelayer.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: truelayer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Finpoint
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.7'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: multi_json
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
27
|
description: Truelayer client
|
42
28
|
email:
|
43
29
|
- nenad@finpoint.co.uk
|