oschadbank 0.1.3 → 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/lib/oschadbank/mac_builder.rb +6 -2
- data/lib/oschadbank/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c52f1944e57113abd7d2b7cb5906d4096659a56
|
4
|
+
data.tar.gz: ccca335f9a2010ae1a3da2615c41cb0ed9cd9e9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff35a882d212f98c1dc840b5faf838281db1867cdb45e66e05e20fb9e5c34364569edd9b89b735cfe5c77859de02c84b653acab79c0cee3d82ed19d8d9d595ae
|
7
|
+
data.tar.gz: dfdcfaf30da014a8e62ff0f535311c0fbed65829523da9ade26c472555db29441d2a3d0dc56f4ef45921196621ccaecdd36db65c48f9474c4fd857f9402a1910
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Oschadbank
|
2
2
|
class MacBuilder
|
3
3
|
include Constants
|
4
|
-
|
4
|
+
|
5
5
|
def initialize(request_type, mac_key, request_params)
|
6
6
|
@request_type = request_type
|
7
7
|
@mac_key = mac_key
|
@@ -17,11 +17,15 @@ module Oschadbank
|
|
17
17
|
params_str = join_params(@request_params, params_order)
|
18
18
|
|
19
19
|
digest = OpenSSL::Digest.new('sha1')
|
20
|
-
OpenSSL::HMAC.hexdigest(digest,
|
20
|
+
OpenSSL::HMAC.hexdigest(digest, packed_key, params_str)
|
21
21
|
end
|
22
22
|
|
23
23
|
private
|
24
24
|
|
25
|
+
def packed_key
|
26
|
+
[@mac_key].pack('H*')
|
27
|
+
end
|
28
|
+
|
25
29
|
def join_params(params, params_order)
|
26
30
|
parts = params_order.map do |param|
|
27
31
|
value = params[param].to_s
|
data/lib/oschadbank/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oschadbank
|
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
|
- Roman Khrebtov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-initializer
|