From f57dd8ba382fce0dc3b28954a0c1799195a33ab3 Mon Sep 17 00:00:00 2001 From: Yan Date: Fri, 8 Dec 2017 14:58:35 +0630 Subject: [PATCH] license updating --- app/models/license.rb | 2 +- app/models/my_aes_crypt.rb | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/models/license.rb b/app/models/license.rb index f6b29820..961d4e5a 100755 --- a/app/models/license.rb +++ b/app/models/license.rb @@ -39,7 +39,7 @@ class License # end ##Check from local redis - if available load local otherwise get from remote cache_key = "#{lookup}:license:#{aes_key}:hostname" - byebug + # No Needs for current # @secret = key diff --git a/app/models/my_aes_crypt.rb b/app/models/my_aes_crypt.rb index b5a69400..9cbd77bd 100644 --- a/app/models/my_aes_crypt.rb +++ b/app/models/my_aes_crypt.rb @@ -31,7 +31,9 @@ class MyAesCrypt file_path = "config/shops.json" aes_key, aes_iv = export_key(passphrase) tmpHash = { - "lookup" => passphrase = { + "lookup" => passphrase, + "value" => + { "key" => aes_key, "iv" => aes_iv } @@ -39,9 +41,9 @@ class MyAesCrypt shop_data = File.read(file_path) if shop_data != "" - shop_json = JSON.parse(shop_data) - byebug + shop_json = JSON.parse(shop_data) shop_json.each do |j| + byebug if j == passphrase j.each do |k| return k["key"], k["iv"]