istox 0.1.51 → 0.1.52
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/istox/helpers/vault.rb +6 -6
- 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: 20a01bdb4f2f5e00d64d08ee3e21d273120a7f1853cdcc5c64b217fd5556d3ad
|
4
|
+
data.tar.gz: 5171117303a86e5a7eb35e75f98e73bd8297ca3fcf665c0bb82fc4ce18640b50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ebe641bcc52615263588bdd0a73df01cc91a712e2aacd894f88376c0cec693e0df9689b800ea7404b74fd609839d687a5871e96de350bf703606d19381adcf2
|
7
|
+
data.tar.gz: d53e5342148add4f0748e31dedf1d267bda5f3d21703b3c67afbe920ef88015f5bd842ce66bcb108b157a1f9159d7f83801174a86fd0b5276a595b1145f17fc2
|
data/README.md
CHANGED
@@ -2,8 +2,8 @@ to publish new version
|
|
2
2
|
|
3
3
|
1. Change version number in version.rb
|
4
4
|
|
5
|
-
2. gem build istox
|
5
|
+
2. `gem build istox`
|
6
6
|
|
7
|
-
3. gem push istox-<VERSION>.gem
|
7
|
+
3. `gem push istox-<VERSION>.gem`
|
8
8
|
|
9
|
-
4. in local repo: bundle install istox
|
9
|
+
4. in local repo: `bundle install istox --full-index`
|
data/lib/istox/helpers/vault.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'vault'
|
2
2
|
|
3
3
|
module Istox
|
4
|
-
module
|
4
|
+
module IVault
|
5
5
|
module TOTP
|
6
6
|
class << self
|
7
7
|
|
@@ -37,11 +37,11 @@ module Istox
|
|
37
37
|
private
|
38
38
|
|
39
39
|
def read_data(key)
|
40
|
-
|
40
|
+
::Vault.logical.read(key)
|
41
41
|
end
|
42
42
|
|
43
43
|
def write_data(key, params)
|
44
|
-
Vault.logical.write(key, params)
|
44
|
+
::Vault.logical.write(key, params)
|
45
45
|
end
|
46
46
|
|
47
47
|
def totp_key(sid)
|
@@ -56,7 +56,7 @@ module Istox
|
|
56
56
|
|
57
57
|
class << self
|
58
58
|
def initialize(secret_key, file_location)
|
59
|
-
Vault.configure do |config|
|
59
|
+
::Vault.configure do |config|
|
60
60
|
config.address = secret_key
|
61
61
|
|
62
62
|
if File.exist?(file_location)
|
@@ -72,8 +72,8 @@ module Istox
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def get_otp(sid)
|
75
|
-
|
76
|
-
otp =
|
75
|
+
TOTP.create(sid)
|
76
|
+
otp = TOTP.generate_code(sid)
|
77
77
|
|
78
78
|
return otp
|
79
79
|
end
|
data/lib/istox/version.rb
CHANGED