tipalti-ruby 0.4.0 → 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/CHANGELOG.md +4 -0
- data/lib/tipalti-ruby/actions/token.rb +12 -6
- data/lib/tipalti-ruby/client.rb +1 -1
- data/lib/tipalti-ruby/connection.rb +8 -3
- data/lib/tipalti-ruby/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fbb867289f56f9dfd500df89903857d6c73fe258000f0084fe15f9b9d491e515
|
4
|
+
data.tar.gz: 0bea49d4b1bca9b722280b59063229769a17e6d6e2b842ab719f37c552bf6faa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 745877696d1638187c04880bb3d0408f6b2a7dcbe2a8d6ca1b9e027ef12d00acb5906d481f5b3e1bac0fba339dcbb19e81da1d1355e03f95efc1dd16177f24cf
|
7
|
+
data.tar.gz: ac4053987f5eae061d1edf031467894cc3948d51ebd8f6730c5109f0c49d44979629920e1c9935dd94d0adf8f232028ff895bda13062a64f5f798ceae6b912a5
|
data/CHANGELOG.md
CHANGED
@@ -3,13 +3,19 @@
|
|
3
3
|
module Tipalti
|
4
4
|
module Actions
|
5
5
|
module Token
|
6
|
-
def token_refresh
|
6
|
+
def token_refresh # rubocop:disable Metrics/MethodLength
|
7
7
|
response = connection_token.post("/connect/token",
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
{
|
9
|
+
client_id: @client_id,
|
10
|
+
client_secret: @client_secret,
|
11
|
+
grant_type: "refresh_token",
|
12
|
+
refresh_token: @refresh_token,
|
13
|
+
code_verifier: @code_verifier
|
14
|
+
},
|
15
|
+
{
|
16
|
+
body: :form,
|
17
|
+
content_type: "application/x-www-form-urlencoded"
|
18
|
+
})
|
13
19
|
|
14
20
|
# Refresh the client values inline
|
15
21
|
@access_token = response["access_token"]
|
data/lib/tipalti-ruby/client.rb
CHANGED
@@ -23,18 +23,23 @@ module Tipalti
|
|
23
23
|
request(:head, path, params)
|
24
24
|
end
|
25
25
|
|
26
|
-
def post(path,
|
27
|
-
request(:post, path, params)
|
26
|
+
def post(path, params = {}, options = {})
|
27
|
+
request(:post, path, params, options)
|
28
28
|
end
|
29
29
|
|
30
30
|
def put(path, **params)
|
31
31
|
request(:put, path, params)
|
32
32
|
end
|
33
33
|
|
34
|
-
def request(method, path, params)
|
34
|
+
def request(method, path, params, options = {}) # rubocop:disable Metrics/MethodLength
|
35
35
|
response = connection.public_send(method, path, params) do |request|
|
36
36
|
request.headers["accept"] = "application/json"
|
37
37
|
request.headers["authorization"] = "Bearer #{@access_token}" if @access_token
|
38
|
+
|
39
|
+
if options[:body] == :form
|
40
|
+
request.headers["Content-Type"] = "application/x-www-form-urlencoded"
|
41
|
+
request.body = URI.encode_www_form(params)
|
42
|
+
end
|
38
43
|
end
|
39
44
|
|
40
45
|
error = Error.from_response(response)
|
data/lib/tipalti-ruby/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tipalti-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jordan Ell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|