licensing

This commit is contained in:
Yan
2017-11-14 16:06:17 +06:30
66 changed files with 985 additions and 398 deletions

View File

@@ -34,20 +34,13 @@ class License
end
end
def detail_with_local_file(lookup, key, iv)
def detail_with_local_cache(lookup)
##Check from local redis - if available load local otherwise get from remote
#cache_key = "store:license:#{key}:hostname"
cache_key = "store:license:#{@secret}:hostname"
end
# No Needs for current
# @secret = key
#cache_license = nil
##Get redis connection from connection pool
#
#Rails.logger.info "Cache key - " + cache_key.to_s
def detail_with_local_file(lookup, key, iv)
has_license = check_license_file
if has_license
@@ -56,7 +49,6 @@ 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, encrypted_key: key, iv_key: iv} }
response = self.class.get("/request_license", @params)