istox 0.1.55 → 0.1.56

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
  SHA256:
3
- metadata.gz: 71bb06ed584d29d10d80360f9241840ad64d36044d5d2b0bac7bfa4510c2c8d4
4
- data.tar.gz: 613113b862d348d6ff57784b31d23843254deb61e9c93d997c334fc0b6c74dbd
3
+ metadata.gz: f7b6a754b24ddae521e93f2b1311b24d5d18047e1836d99372ace4322e96ac9e
4
+ data.tar.gz: 1cee6f4908b453f4cd471f188ca1f5f3ef56605feca6f86b2b79bf9d09a32fe5
5
5
  SHA512:
6
- metadata.gz: 9fb8e2782e7c543454e74937edd8e1ca42587d657d0964235f3795b0808dd29eaedbe46deb74d42d1e2ea4d63e4ed0a7815b907f3868a93b249c01aa0b36112c
7
- data.tar.gz: d0ff53dab7f980f0bcde08e6cf2333827dede8715a8743d465fcbc65c2e6e6ce751d6a18eed1a699118c766646b8513c281ba33e303d7bfe0dce330635c1b707
6
+ metadata.gz: bcd958aee75f229c3159d713f53f843ffcebbab5af9eeda5baee48ca2d19e330e707c88afc38cdad940794b209d853c664cc40e88a0f460b615f5e063f11ede0
7
+ data.tar.gz: d8bfdcfb0b837f5cc2743198a187f3e1c6da587d5cdbfb719d6b1690bf89374a0929c608c5689d9a91852d454f23e456f66a594240841806b044ef3e5a6c3e40
@@ -5,12 +5,12 @@ module Istox
5
5
  module TOTP
6
6
  class << self
7
7
 
8
- def create(sid)
8
+ def create(sid, params={})
9
9
  Rails.logger.debug { "Generate vault TOTP for key #{totp_key(sid).inspect}" }
10
10
 
11
11
  write_data(totp_key(sid),
12
12
  generate: true,
13
- issuer: ENV.fetch('APP_NAME', 'ISTOX'),
13
+ issuer: params[:host],
14
14
  account_name: sid,
15
15
  qr_size: 300)
16
16
  end
@@ -41,6 +41,7 @@ module Istox
41
41
  end
42
42
 
43
43
  def write_data(key, params)
44
+ Rails.logger.debug { "in write data method" }
44
45
  ::Vault.logical.write(key, params)
45
46
  end
46
47
 
@@ -71,14 +72,14 @@ module Istox
71
72
  end
72
73
 
73
74
  def get_otp(sid)
74
- ::Vault::TOTP.create(sid)
75
- otp = ::Vault::TOTP.generate_code(sid)
75
+ ::Istox::Vault::TOTP.create(sid)
76
+ otp = Istox::Vault::TOTP.generate_code(sid)
76
77
 
77
78
  return otp
78
79
  end
79
80
 
80
81
  def validate_otp(sid, otp)
81
- return ::Vault::TOTP.validate?(sid, otp)
82
+ return ::Istox::Vault::TOTP.validate?(sid, otp)
82
83
  rescue => e
83
84
  raise e
84
85
  false
@@ -1,3 +1,3 @@
1
1
  module Istox
2
- VERSION = "0.1.55"
2
+ VERSION = "0.1.56"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: istox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.55
4
+ version: 0.1.56
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siong Leng