x1-sat-support 0.0.4 → 0.0.5

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: 8c9b27b2ce2bcb50bfc73775488ac8ba586b0890
4
- data.tar.gz: 92cd0a2a11ee853cd117e0738c274efbe18e5341
3
+ metadata.gz: 6d1eb97672e07ca9c1979f70869a3993565fc9b2
4
+ data.tar.gz: c7062ca6ef03e9e1a53757c4775c6a334ef43c15
5
5
  SHA512:
6
- metadata.gz: 20a244b64f5f258114932bbc1c9fffdda2ec7bd5f29ba6ac5df185e4de29ab9689211c8bc66728f9ffc03c0db34387af3d57e2c6443e29f4215623ad6c2b13fd
7
- data.tar.gz: 4c39acd6d1ab5226e9e75a72c0218f5b82759af4dd590dd36ffac01d3621185ce1ac9a1360c64ac50779e964b75545d559c5e91c6a51826d4931df6c92e2f36d
6
+ metadata.gz: 4d028feb36b808aa84cd5df2ee2dfa3b887dd7ebdfebb7f6390fe36d96c45471f475ce6485aabefd54052669a55f944f4309559139bf76a1d7a6db7a72af046a
7
+ data.tar.gz: 39eb5000a3ff43939093b64766f495c56ec3f8507292f11330da311cf0bae6f8b22968c654f551071fede7bf14fa5145abb55ea0c39a2804f859050957ee1bbc
@@ -1,5 +1,5 @@
1
- require File.expand_path File.join(File.dirname(__FILE__), 'x1_sat_support/client.rb')
1
+ require File.expand_path File.join(File.dirname(__FILE__), 'x1_sat_support', 'client.rb')
2
2
 
3
3
  module X1SatSupport
4
- require 'x1_sat_support/railtie' if defined?(Rails)
4
+ require File.join('x1_sat_support', 'railtie') if defined?(Rails)
5
5
  end
@@ -35,7 +35,7 @@ module X1SatSupport
35
35
  key_name = kid + '.pub'
36
36
  key = get_current_key
37
37
  Dir.mkdir(@path_to_store_keys) unless File.exists?(@path_to_store_keys)
38
- File.open("#{@path_to_store_keys}/#{key_name}", 'w') {|f| f.write(key)}
38
+ File.open(File.join(@path_to_store_keys,key_name), 'w') {|f| f.write(key)}
39
39
  check_keys
40
40
  end
41
41
 
@@ -59,7 +59,7 @@ module X1SatSupport
59
59
  #
60
60
  def get_kid
61
61
  encoded_token = JSON.parse(RestClient.get(@sat_token_url, @headers).body)["serviceAccessToken"]
62
- token = JWT.decode encoded_token, nil, false
62
+ token = JWT.decode(encoded_token, nil, false, { verify_not_before: false })
63
63
  token.last["kid"]
64
64
  end
65
65
  #
@@ -80,7 +80,7 @@ module X1SatSupport
80
80
  # This method returns public key
81
81
  #
82
82
  def check_keys
83
- files = Dir[@path_to_store_keys + "/*.pub"].sort_by {|file| File.ctime(file)}
83
+ files = Dir[File.join(@path_to_store_keys, "/*.pub")].sort_by {|file| File.ctime(file)}
84
84
  files.each do |file|
85
85
  File.delete(files.delete(file)) if (Time.now - File.ctime(file)) > @keys_expiration_time
86
86
  end
@@ -6,7 +6,7 @@ module X1SatSupport
6
6
  railtie_name :x1_sat_support
7
7
 
8
8
  rake_tasks do
9
- load "tasks/x1_sat_support.rake"
9
+ load File.join("tasks", "x1_sat_support.rake")
10
10
  end
11
11
  end
12
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: x1-sat-support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kharchenko