license updating

This commit is contained in:
Yan
2017-12-08 14:27:10 +06:30
parent 681b5afebc
commit 5310e3e534
4 changed files with 34 additions and 11 deletions

View File

@@ -24,7 +24,9 @@ class License
end
def detail_with_local_cache(lookup)
aes = MyAesCrypt.new
aes_key, aes_iv = aes.export_to_file(lookup)
# flag = ENV["AES_IV"]
# # Check Exists IV
# if flag == "<%= ENV['AES_IV'] %>"
@@ -36,8 +38,8 @@ class License
# aes_iv = ENV["AES_IV"]
# end
##Check from local redis - if available load local otherwise get from remote
cache_key = "#{lookup}:license:#{key}:hostname"
cache_key = "#{lookup}:license:#{aes_key}:hostname"
byebug
# No Needs for current
# @secret = key
@@ -54,7 +56,7 @@ class License
if cache_license.nil?
##change the d/e key
# @options = { query: {device: "SXlite", lookup: lookup, skey: @secret, token: SECRETS_CONFIG['provision_key']} }
@params = { query: { lookup_type: self.server_mode, lookup: lookup, iv_key: iv} }
@params = { query: { lookup_type: self.server_mode, lookup: lookup, iv_key: aes_iv} }
response = self.class.get("/subdomain", @params)
@license = response.parsed_response