unleashed 0.1.16 → 0.1.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ee9407d6e3e388a6398ec1bffe7f40b9d2a8d8be94fe8dbab1a512c3bc1caad9
4
- data.tar.gz: a64d9632f3fb0867ff1df15307563324be5b4983d35f76e6c23f5e3f8a9e5788
3
+ metadata.gz: 64bf42de94dbe048a5de0a81983e05e92ae7199df7c9f1d31b3af12759af408c
4
+ data.tar.gz: 10dfcd117b381f209e2e740a1a290e264ebb903d4c5121ba926aa01e440d05ed
5
5
  SHA512:
6
- metadata.gz: 8bd91eb660d49c5b88aa674063efe780ce9953fe1e206eb1fb855c9f5d665eb60a303896c710d2eb3b66601ac49cb979e72f7189e11eabca80bf45821ce11752
7
- data.tar.gz: b2ab21634ee32dd4fa9ed61116ba566949475749f52f6dbd5783f80409fd9459b40937d5e53799aa6d4cbcb1acb93f867e217ac694e1a853491c85cbb5a4075b
6
+ metadata.gz: 2b4186e4593a6eab6fd8225c3abc7ae16ad3c65e1dece3753d42a76483ae3682d52c142fa3cb66ba46631a001423e65a56e0d928a04de26772b74ca9203735a1
7
+ data.tar.gz: e0f30e55e86a48cf1d37a357de098788a3f7d059d9af542f0fe862891f96c45a9e3f4c3d397444eaa49b950ca33eb44bce9f1525e37051a98e59460deae22411
@@ -2,6 +2,10 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [0.1.17] - 2021-01-14
6
+
7
+ - Update HMAC input.
8
+
5
9
  ## [0.1.16] - 2020-04-10
6
10
 
7
11
  - Add new model `Company` and resources.
@@ -50,6 +50,16 @@ module Unleashed
50
50
  end
51
51
  end
52
52
 
53
+ def hmac_input(params_hash)
54
+ hmac_input_a = []
55
+
56
+ params_hash.each do |k, v|
57
+ hmac_input_a << "#{k}=#{v}"
58
+ end
59
+
60
+ hmac_input_a.join('&')
61
+ end
62
+
53
63
  # Create a signature for request
54
64
  def signature(params = '')
55
65
  hash = OpenSSL::HMAC.digest('sha256', @api_key, params)
@@ -61,7 +71,7 @@ module Unleashed
61
71
  request.headers['Accept'] = 'application/json'
62
72
  request.headers['Content-Type'] = 'application/json'
63
73
  request.headers['api-auth-id'] = @api_id
64
- request.headers['api-auth-signature'] = signature(request.params.to_query)
74
+ request.headers['api-auth-signature'] = signature(hmac_input(request.params))
65
75
  request
66
76
  end
67
77
 
@@ -2,7 +2,7 @@ module Unleashed
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- TINY = 16
5
+ TINY = 17
6
6
 
7
7
  STRING = "#{MAJOR}.#{MINOR}.#{TINY}".freeze
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unleashed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nhan Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-09 00:00:00.000000000 Z
11
+ date: 2021-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday