Module: Istox::Vault
- Defined in:
- lib/istox/helpers/vault.rb
Defined Under Namespace
Modules: TOTP
Class Method Summary collapse
- .get_otp(sid, host) ⇒ Object
- .initialize(secret_key, file_location) ⇒ Object
- .logical ⇒ Object
- .validate_otp(sid, otp) ⇒ Object
Class Method Details
.get_otp(sid, host) ⇒ Object
76 77 78 79 |
# File 'lib/istox/helpers/vault.rb', line 76 def get_otp(sid, host) ::Istox::Vault::TOTP.create(sid, host) Istox::Vault::TOTP.generate_code(sid) end |
.initialize(secret_key, file_location) ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/istox/helpers/vault.rb', line 61 def initialize(secret_key, file_location) ::Vault.configure do |config| config.address = secret_key if File.exist?(file_location) token = File.read(file_location).strip config.token = token config.ssl_verify = false config.timeout = 60 else log.info 'Vault token not found, OTP will not be able to use' end end end |
.logical ⇒ Object
57 58 59 |
# File 'lib/istox/helpers/vault.rb', line 57 def logical ::Vault.logical end |