manacle_for 0.0.10 → 0.0.11

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 69a029a7be8ab4794ee14a5e693da6913f9c4593
4
- data.tar.gz: 2c87b5c405a4bbf5f3373bee2f7d9d4cdb46fe52
3
+ metadata.gz: 8925c1ed1a81437804edd552a8c86a1c7dd6d322
4
+ data.tar.gz: e785454dbf588e611b3308a3161ef800f8336dc8
5
5
  SHA512:
6
- metadata.gz: a36c503e2b47b5b149f3f6106286b7713641901f24b63ed941c2abb43d4a59709baf58e35f1252e0df81de8997e546a38c23a97907ada62674759619c54cf622
7
- data.tar.gz: 80ce0bdba26bd3d7a3f14fe9ef947c441bd3df019c845aa9d788894767ccf4e0490759b6d0726a80f51ec3028327056056f0a29e6a08cebec4fe3ddcc3736dc4
6
+ metadata.gz: 9b31318e5efa1de838282bebed54a38cd426279653552a12dbf30426380a916cd18fe4fd716c596dcff96d0a4f7137b6b7e545c1a0aadeed550ae928b20394ee
7
+ data.tar.gz: c755a499aae4468503369b3159b0a739122db0f737cdb79d01bfbc3c0915b3c6f262663d9572eb40afe47b6e95bf0307c23329127f5ade293d6045bc1032dee5
@@ -0,0 +1,24 @@
1
+ module Manacle
2
+ class Helper
3
+ def self.encrypt(password_string)
4
+ require 'openssl'
5
+ require 'base64'
6
+
7
+ # this creates the key, and the cipher
8
+ secret = OpenSSL::PKCS5.pbkdf2_hmac_sha1(ENV['CONSUMER_SECRET'], ENV['CONSUMER_KEY'], 1024, 128)
9
+ cipher = OpenSSL::Cipher::Cipher.new('AES-128-CBC')
10
+ cipher.encrypt
11
+ iv = cipher.random_iv
12
+ cipher.key = secret
13
+ cipher.iv = iv
14
+
15
+ # the following does the encryption
16
+ encrypted_data = cipher.update(password_string)
17
+ encrypted_data << cipher.final
18
+
19
+ # the encrypted string & the IV (concatenated by --) is to be sent across to the ESB
20
+ encrypted_password = [encrypted_data, iv].map {|v| Base64.strict_encode64(v)}.join("--")
21
+ return encrypted_password
22
+ end
23
+ end
24
+ end
@@ -40,7 +40,7 @@ $(function(){
40
40
  <th>Status</th>
41
41
  </tr>
42
42
 
43
- <% @examples.each_with_index do |ex, index| %>
43
+ <% @examples.sort_by{|r| [r.case]}.each_with_index do |ex, index| %>
44
44
  <tr>
45
45
  <td><%= ex.case %></td>
46
46
  <td>
data/lib/manacle/setup.rb CHANGED
@@ -11,7 +11,7 @@ module Manacle
11
11
  password: ENV['DB_PASSWORD']
12
12
  )
13
13
 
14
- [:API_USERNAME, :API_PASSWORD, :DB_USERNAME, :DB_ADAPTER, :DATABASE, :DB_PASSWORD, :SERVICE_URL].each do |e|
14
+ [:API_USERNAME, :API_PASSWORD, :DB_USERNAME, :DB_ADAPTER, :DATABASE, :DB_PASSWORD, :SERVICE_URL, :CONSUMER_KEY, :CONSUMER_SECRET].each do |e|
15
15
  raise "required ENV variable #{e} not set" if ENV[e.to_s].nil?
16
16
  end
17
17
 
@@ -1,3 +1,3 @@
1
1
  module Manacle
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
data/lib/manacle.rb CHANGED
@@ -3,6 +3,7 @@ require "api_banking"
3
3
  require "dotenv"
4
4
 
5
5
  require_relative "manacle/setup"
6
+ require_relative "manacle/helpers"
6
7
  require_relative "manacle/matchers"
7
8
  require_relative "manacle/formatter"
8
9
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manacle_for
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - akil
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-27 00:00:00.000000000 Z
11
+ date: 2016-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -154,6 +154,7 @@ files:
154
154
  - bin/setup
155
155
  - lib/manacle.rb
156
156
  - lib/manacle/formatter.rb
157
+ - lib/manacle/helpers.rb
157
158
  - lib/manacle/matchers.rb
158
159
  - lib/manacle/report.erb
159
160
  - lib/manacle/setup.rb