license updating

This commit is contained in:
Yan
2017-12-08 12:06:21 +06:30
parent 0591e4449e
commit ffb829fbc3
2 changed files with 28 additions and 12 deletions

View File

@@ -23,18 +23,18 @@ class License
# @params = { query: { device: "SX", token: SECRETS_CONFIG['provision_key'] } }
end
def detail_with_local_cache(lookup)
subdomain = request.subdomain.downcase
flag = ENV["AES_IV"]
# Check Exists IV
if flag == "<%= ENV['AES_IV'] %>"
# Export for Key
aes = MyAesCrypt.new
aes_key, aes_iv = aes.export_key(lookup)
else
aes_key = ENV["AES_KEY"]
aes_iv = ENV["AES_IV"]
end
def detail_with_local_cache(lookup)
# flag = ENV["AES_IV"]
# # Check Exists IV
# if flag == "<%= ENV['AES_IV'] %>"
# # Export for Key
# aes = MyAesCrypt.new
# aes_key, aes_iv = aes.export_key(lookup)
# else
# aes_key = ENV["AES_KEY"]
# aes_iv = ENV["AES_IV"]
# end
##Check from local redis - if available load local otherwise get from remote
cache_key = "#{lookup}:license:#{key}:hostname"