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 +4 -4
- data/lib/istox/helpers/vault.rb +6 -5
- data/lib/istox/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7b6a754b24ddae521e93f2b1311b24d5d18047e1836d99372ace4322e96ac9e
|
4
|
+
data.tar.gz: 1cee6f4908b453f4cd471f188ca1f5f3ef56605feca6f86b2b79bf9d09a32fe5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcd958aee75f229c3159d713f53f843ffcebbab5af9eeda5baee48ca2d19e330e707c88afc38cdad940794b209d853c664cc40e88a0f460b615f5e063f11ede0
|
7
|
+
data.tar.gz: d8bfdcfb0b837f5cc2743198a187f3e1c6da587d5cdbfb719d6b1690bf89374a0929c608c5689d9a91852d454f23e456f66a594240841806b044ef3e5a6c3e40
|
data/lib/istox/helpers/vault.rb
CHANGED
@@ -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:
|
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
|
data/lib/istox/version.rb
CHANGED